wx.SpinCtrlDouble combines wx.TextCtrl and wx.SpinButton in one control and displays a real number.
( wx.SpinCtrl displays an integer.)
This class supports the following styles:
wx.SP_ARROW_KEYS
: The user can use arrow keys to change the value.
wx.SP_WRAP
: The value wraps at the minimum and maximum.
Handlers bound for the following event types will receive a wx.SpinDoubleEvent parameter.
EVT_SPINCTRLDOUBLE: Generated whenever the numeric value of the spin control is changed, that is, when the up/down spin button is clicked, when ENTER
is pressed, or the control loses focus and the new value is different from the last. See wx.SpinDoubleEvent.
See also
Default constructor. |
|
Creation function called by the spin control constructor. |
|
Gets the number of digits in the display. |
|
Gets the increment value. |
|
Gets maximal allowable value. |
|
Gets minimal allowable value. |
|
Gets the value of the spin control. |
|
Sets the number of digits in the display. |
|
Sets the increment value. |
|
Sets range of allowable values. |
|
Sets the value of the spin control. |
wx.
SpinCtrlDouble
(Control)¶Possible constructors:
SpinCtrlDouble()
SpinCtrlDouble(parent, id=-1, value="", pos=DefaultPosition,
size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, inc=1,
name=T("wxSpinCtrlDouble"))
SpinCtrlDouble combines TextCtrl and SpinButton in one control and displays a real number.
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=-1, value=””, pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, inc=1, name=T(“wxSpinCtrlDouble”))
Constructor, creating and showing a spin control.
parent (wx.Window) – Parent window. Must not be None
.
id (wx.WindowID) – Window identifier. The value wx.ID_ANY
indicates a default value.
value (string) – Default value (as text).
pos (wx.Point) – Window position. If wx.DefaultPosition
is specified then a default position is chosen.
size (wx.Size) – Window size. If wx.DefaultSize
is specified then a default size is chosen.
style (long) – Window style. See wx.SpinButton.
min (float) – Minimal value.
max (float) – Maximal value.
initial (float) – Initial value.
inc (float) – Increment value.
name (string) – Window name.
See also
Create
(self, parent, id=ID_ANY, value="", pos=DefaultPosition, size=DefaultSize, style=SP_ARROW_KEYS, min=0, max=100, initial=0, inc=1, name="wxSpinCtrlDouble")¶Creation function called by the spin control constructor.
See wx.SpinCtrlDouble for details.
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
GetDigits
(self)¶Gets the number of digits in the display.
int
GetIncrement
(self)¶Gets the increment value.
float
GetMax
(self)¶Gets maximal allowable value.
float
GetMin
(self)¶Gets minimal allowable value.
float
GetRange
(self)¶GetValue
(self)¶Gets the value of the spin control.
float
SetDigits
(self, digits)¶Sets the number of digits in the display.
digits (int) –
SetIncrement
(self, inc)¶Sets the increment value.
inc (float) –
Note
You may also need to increase the number of visible digits using SetDigits
SetMax
(self, maxVal)¶SetMin
(self, minVal)¶SetRange
(self, minVal, maxVal)¶Sets range of allowable values.
minVal (float) –
maxVal (float) –
SetValue
(self, *args, **kw)¶SetValue (self, text)
Sets the value of the spin control.
It is recommended to use the overload taking a float value instead.
Notice that, unlike wx.TextCtrl.SetValue
, but like most of the other setter methods in wxWidgets, calling this method does not generate any events as events are only generated for the user actions.
text (string) –
SetValue (self, value)
Sets the value of the spin control.
Calling this method doesn’t generate any wxEVT_SPINCTRLDOUBLE
events.
value (float) –
Increment
¶See GetIncrement
and SetIncrement