SpinCtrl combines TextCtrl and SpinButton in one control.
This class supports the following styles:
Handlers bound for the following event types will receive a SpinEvent parameter.
You may also use the SpinButton event macros, however the corresponding events will not be generated under all platforms. Finally, if the user modifies the text in the edit part of the spin control directly, the EVT_TEXT is generated, like for the TextCtrl. When the use enters text into the text area, the text is not validated until the control loses focus (e.g. by using the TAB key). The value is then adjusted to the range and a SpinEvent sent then if the value is different from the last value sent.
See also
__init__ | Default constructor. |
Create | Creation function called by the spin control constructor. |
GetMax | Gets maximal allowable value. |
GetMin | Gets minimal allowable value. |
GetRange | |
GetValue | Gets the value of the spin control. |
SetMax | |
SetMin | |
SetRange | Sets range of allowable values. |
SetSelection | Select the text in the text part of the control between positions from (inclusive) and to (exclusive). |
SetValue | Sets the value of the spin control. |
Max | See GetMax and SetMax |
Min | See GetMin and SetMin |
Range | See GetRange |
Value | See GetValue and SetValue |
SpinCtrl combines TextCtrl and SpinButton in one control.
Possible constructors:
SpinCtrl()
SpinCtrl(parent, id=ID_ANY, value='', pos=DefaultPosition,
size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0,
name="wxSpinCtrl")
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, value=’‘, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, name=”wxSpinCtrl”)
Constructor, creating and showing a spin control.
If value is non-empty, it will be shown in the text entry part of the control and if it has numeric value, the initial numeric value of the control, as returned by GetValue will also be determined by it instead of by initial. Hence, it only makes sense to specify initial if value is an empty string or is not convertible to a number, otherwise initial is simply ignored and the number specified by value is used.
Parameters: |
|
---|
See also
Creation function called by the spin control constructor.
See SpinCtrl for details.
Parameters: | |
---|---|
Return type: | bool |
Gets maximal allowable value.
Return type: | int |
---|
Gets minimal allowable value.
Return type: | int |
---|
Gets the value of the spin control.
Return type: | int |
---|
Sets range of allowable values.
Parameters: |
|
---|
Select the text in the text part of the control between positions from (inclusive) and to (exclusive).
This is similar to TextCtrl.SetSelection .
Parameters: |
|
---|
Note
this is currently only implemented for Windows and generic versions of the control.
Overloaded Implementations:
SetValue (self, text)
Sets the value of the spin control.
Use the variant using int instead.
Parameters: | text (string) – |
---|
SetValue (self, value)
Sets the value of the spin control.
Parameters: | value (int) – |
---|