#include </home/zeitlin/src/wx/github/interface/wx/spinbutt.h>
A wxSpinButton has two small up and down (or left and right) arrow buttons.
It is often used next to a text control for increment and decrementing a value. Portable programs should try to use wxSpinCtrl instead as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it degenerates to a simple wxTextCtrl on such platforms.
-0x8000
to 0x7fff
. Under GTK and Win32 with sufficiently new version of comctrl32.dll
(at least 4.71 is required, 5.80 is recommended) the full 32 bit range is supported.This class supports the following styles:
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
Note that if you handle both SPIN and UP or DOWN events, you will be notified about each of them twice: first the UP/DOWN event will be received and then, if it wasn't vetoed, the SPIN event will be sent.
wxMSW appearance | wxGTK appearance | wxMac appearance |
Public Member Functions | |
wxSpinButton () | |
Default constructor. | |
wxSpinButton (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSP_VERTICAL, const wxString &name="spinButton") | |
Constructor, creating and showing a spin button. | |
virtual | ~wxSpinButton () |
Destructor, destroys the spin button control. | |
bool | Create (wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSP_VERTICAL, const wxString &name="wxSpinButton") |
Scrollbar creation function called by the spin button constructor. | |
virtual int | GetMax () const |
Returns the maximum permissible value. | |
virtual int | GetMin () const |
Returns the minimum permissible value. | |
virtual int | GetValue () const |
Returns the current spin button value. | |
virtual void | SetRange (int min, int max) |
Sets the range of the spin button. | |
virtual void | SetValue (int value) |
Sets the value of the spin button. |
wxSpinButton::wxSpinButton | ( | ) |
Default constructor.
wxSpinButton::wxSpinButton | ( | wxWindow * | parent, |
wxWindowID | id = -1 , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxSP_VERTICAL , |
||
const wxString & | name = "spinButton" |
||
) |
Constructor, creating and showing a spin button.
parent | Parent window. Must not be NULL. |
id | Window identifier. The value wxID_ANY indicates a default value. |
pos | Window position. If wxDefaultPosition is specified then a default position is chosen. |
size | Window size. If wxDefaultSize is specified then a default size is chosen. |
style | Window style. See wxSpinButton class description. |
name | Window name. |
virtual wxSpinButton::~wxSpinButton | ( | ) | [virtual] |
Destructor, destroys the spin button control.
bool wxSpinButton::Create | ( | wxWindow * | parent, |
wxWindowID | id = -1 , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxSP_VERTICAL , |
||
const wxString & | name = "wxSpinButton" |
||
) |
Scrollbar creation function called by the spin button constructor.
See wxSpinButton() for details.
Reimplemented from wxWindow.
virtual int wxSpinButton::GetMax | ( | ) | const [virtual] |
Returns the maximum permissible value.
virtual int wxSpinButton::GetMin | ( | ) | const [virtual] |
Returns the minimum permissible value.
virtual int wxSpinButton::GetValue | ( | ) | const [virtual] |
Returns the current spin button value.
virtual void wxSpinButton::SetRange | ( | int | min, |
int | max | ||
) | [virtual] |
virtual void wxSpinButton::SetValue | ( | int | value | ) | [virtual] |
Sets the value of the spin button.
value | The value for the spin button. |