wxSpinCtrlwxSpinCtrl combines wxTextCtrl and wxSpinButton in one control. Derived from
wxControl Include files <wx/spinctrl.h> Window styles
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 wxSpinEvent argument:
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 wxSpinEvent sent then if the value is different from the last value sent. See also Event handling overview, wxSpinButton, wxControl Members
wxSpinCtrl::wxSpinCtrl
wxSpinCtrl::wxSpinCtrlwxSpinCtrl() Default constructor. wxSpinCtrl(wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, const wxString& name = _T("wxSpinCtrl")) Constructor, creating and showing a spin control. Parameters parent
value
id
pos
size
style
min
max
initial
name
See also
wxSpinCtrl::Createbool Create(wxWindow* parent, wxWindowID id = -1, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, const wxString& name = _T("wxSpinCtrl")) Creation function called by the spin control constructor. See wxSpinCtrl::wxSpinCtrl for details.
wxSpinCtrl::SetValuevoid SetValue(const wxString& text) void SetValue(int value) Sets the value of the spin control.
wxSpinCtrl::GetValueint GetValue() const Gets the value of the spin control.
wxSpinCtrl::SetRangevoid SetRange(int minVal, int maxVal) Sets range of allowable values.
wxSpinCtrl::SetSelectionvoid SetSelection(long from, long to) Select the text in the text part of the control between positions from (inclusive) and to (exclusive). This is similar to wxTextCtrl::SetSelection. NB: this is currently only implemented for Windows and generic versions of the control.
wxSpinCtrl::GetMinint GetMin() const Gets minimal allowable value.
wxSpinCtrl::GetMaxint GetMax() const Gets maximal allowable value.
|