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.
Derived from
wxControl
wxWindow
wxEvtHandler
wxObject
Include files
<wx/spinbutt.h>
Window styles
wxSP_HORIZONTAL | Specifies a horizontal spin button. |
wxSP_VERTICAL | Specifies a vertical spin button. |
wxSP_ARROW_KEYS | The user can use arrow keys. |
wxSP_WRAP | The value wraps at the minimum and maximum. |
See also window styles overview.
Event handling
To process input from a spin button, use one of these event handler macros to direct input to member functions that take a wxScrollEvent argument:
EVT_SPIN(id, func) | Catch all scroll commands. |
EVT_SPIN_UP(id, func) | Catch up (or left) commands. |
EVT_SPIN_DOWN(id, func) | Catch down (or right) commands. |
EVT_COMMAND_TOP(id, func) | Catch a command to put the scroll thumb at the maximum position. |
EVT_COMMAND_SCROLL(id, func) | Catch all scroll commands. |
EVT_COMMAND_TOP(id, func) | Catch a command to put the scroll thumb at the maximum position. |
EVT_COMMAND_BOTTOM(id, func) | Catch a command to put the scroll thumb at the maximum position. |
EVT_COMMAND_LINEUP(id, func) | Catch a line up command. |
EVT_COMMAND_LINEDOWN(id, func) | Catch a line down command. |
EVT_COMMAND_PAGEUP(id, func) | Catch a page up command. |
EVT_COMMAND_PAGEDOWN(id, func) | Catch a page down command. |
EVT_COMMAND_THUMBTRACK(id, func) | Catch a thumbtrack command (continuous movement of the scroll thumb). |
Members
wxSpinButton::wxSpinButton
wxSpinButton::~wxSpinButton
wxSpinButton::Create
wxSpinButton::GetMax
wxSpinButton::GetMin
wxSpinButton::GetValue
wxSpinButton::SetRange
wxSpinButton::SetValue
wxSpinButton()
Default constructor.
wxSpinButton(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "spinButton")
Constructor, creating and showing a spin button.
Parameters
parent
id
pos
size
style
validator
name
See also
wxSpinButton::Create, wxValidator
void ~wxSpinButton()
Destructor, destroying the spin button.
bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "spinButton")
Scrollbar creation function called by the spin button constructor. See wxSpinButton::wxSpinButton for details.
int GetMax() const
Returns the maximum permissable value.
See also
int GetMin() const
Returns the minimum permissable value.
See also
int GetValue() const
Returns the current spin button value.
See also
void SetRange(int min, int max)
Sets the range of the spin button.
Parameters
min
max
See also
wxSpinButton::GetMin, wxSpinButton::GetMax
void SetValue(int value)
Sets the value of the spin button.
Parameters
value
See also