Phoenix Logo

phoenix_title wx.SpinCtrlDouble

wx.SpinCtrlDouble combines wx.TextCtrl and wx.SpinButton in one control and displays a real number.

( wx.SpinCtrl displays an integer.)

styles Window Styles

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.

events Events Emitted by this Class

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.

class_hierarchy Class Hierarchy

Inheritance diagram for class SpinCtrlDouble:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


method_summary Methods Summary

__init__ Default constructor.
Create Creation function called by the spin control constructor.
GetDigits Gets the number of digits in the display.
GetIncrement Gets the increment value.
GetMax Gets maximal allowable value.
GetMin Gets minimal allowable value.
GetRange  
GetValue Gets the value of the spin control.
SetDigits Sets the number of digits in the display.
SetIncrement Sets the increment value.
SetMax  
SetMin  
SetRange Sets range of allowable values.
SetValue Sets the value of the spin control.

api Class API



class 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.


Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__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.

Parameters:
  • 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





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.

Parameters:
  • parent (wx.Window) –
  • id (wx.WindowID) –
  • value (string) –
  • pos (wx.Point) –
  • size (wx.Size) –
  • style (long) –
  • min (float) –
  • max (float) –
  • initial (float) –
  • inc (float) –
  • name (string) –
Return type:

bool



GetDigits(self)

Gets the number of digits in the display.

Return type:int


GetIncrement(self)

Gets the increment value.

Return type:float


GetMax(self)

Gets maximal allowable value.

Return type:float


GetMin(self)

Gets minimal allowable value.

Return type:float


GetRange(self)


GetValue(self)

Gets the value of the spin control.

Return type:float


SetDigits(self, digits)

Sets the number of digits in the display.

Parameters:digits (int) –


SetIncrement(self, inc)

Sets the increment value.

Parameters: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.

Parameters:
  • minVal (float) –
  • maxVal (float) –


SetValue(self, *args, **kw)

overload Overloaded Implementations:



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.

Parameters:text (string) –



SetValue (self, value)

Sets the value of the spin control.

Calling this method doesn’t generate any wxEVT_SPINCTRLDOUBLE events.

Parameters:value (float) –




Properties



Digits

See GetDigits and SetDigits



Increment

See GetIncrement and SetIncrement



Max

See GetMax and SetMax



Min

See GetMin and SetMin



Range

See GetRange



Value

See GetValue and SetValue