Generic param interface.
Param objects follow the lifetime of the class, and so are not
typically destroyed until the end of the program. That also means that
they operate as flyweight objects with their state stored extrinsically.
They are also factories for creating editing widgets (the getCtrl method)
and as visitors to process the conversion between the user interface
representation of the value and the user code's representation of the
value (the get/setValue methods).
It's important to understand the two representations of the param.
What I call "text" is the textual representation that is stored
in the user configuration file, and what I call "value" is the
result of the conversion into the correct python type. The value is what
the python code operates on, and doesn't need to know anything about the
textual representation. These conversions are handled by the textToValue
and valueToText methods.
Note that depending on the wx control used to display the value,
additional conversion may be necessary to show the value. This is
handled by the getValue and setValue methods.
The default Param is a string param, and no restriction on the value
of the string is imposed.
|
|
__init__(self,
keyword,
default=None,
help='',
save_to_file=True,
**kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
|
|
|
isSettable(self)
True if the user can set this parameter |
|
|
|
|
isVisible(self)
True if this item is to be displayed. |
|
|
|
|
|
|
|
getCtrl(self,
parent,
initial=None)
Create and editing control. |
|
|
|
|
processCallback(self,
evt,
ctrl,
ctrl_list)
Subclasses should override this to provide functionality. |
|
|
|
|
OnCallback(self,
evt)
Callback driver for the control |
|
|
|
|
setCallback(self,
ctrl,
ctrl_list)
Set the callback that responds to changes inthe state of the control |
|
|
|
|
setInitialState(self,
ctrl,
ctrl_list)
Set the initial state of the control. |
|
|
|
|
textToValue(self,
text)
Convert the user's config text to the type expected by the python
code. |
|
|
|
|
valueToText(self,
value)
Convert the user value to a string suitable to be written to the
config file. |
|
|
|
|
setValue(self,
ctrl,
value)
Populate the control given the user value. |
|
|
|
|
setValueWithoutCallback(self,
ctrl,
value)
Populate the control given the user value, but don't execute any
callbacks. |
|
|
|
|
getValue(self,
ctrl)
Get the user value from the control. |
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__
|