]>
git.saurik.com Git - wxWidgets.git/blob - interface/spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSpinCtrl
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxSpinCtrl combines wxTextCtrl and
14 wxSpinButton in one control.
17 @style{wxSP_ARROW_KEYS}
18 The user can use arrow keys to change the value.
20 The value wraps at the minimum and maximum.
25 <!-- @appearance{spinctrl.png} -->
27 @see wxSpinButton, wxControl
29 class wxSpinCtrl
: public wxControl
38 Constructor, creating and showing a spin control.
41 Parent window. Must not be @NULL.
43 Default value (as text).
45 Window identifier. The value wxID_ANY indicates a default value.
47 Window position. If wxDefaultPosition is specified then a default
50 Window size. If wxDefaultSize is specified then a default size
53 Window style. See wxSpinButton.
65 wxSpinCtrl(wxWindow
* parent
, wxWindowID id
= -1,
66 const wxString
& value
= wxEmptyString
,
67 const wxPoint
& pos
= wxDefaultPosition
,
68 const wxSize
& size
= wxDefaultSize
,
69 long style
= wxSP_ARROW_KEYS
,
70 int min
= 0, int max
= 100,
74 Creation function called by the spin control constructor.
75 See wxSpinCtrl() for details.
77 bool Create(wxWindow
* parent
, wxWindowID id
= -1,
78 const wxString
& value
= wxEmptyString
,
79 const wxPoint
& pos
= wxDefaultPosition
,
80 const wxSize
& size
= wxDefaultSize
,
81 long style
= wxSP_ARROW_KEYS
,
82 int min
= 0, int max
= 100,
86 Gets maximal allowable value.
91 Gets minimal allowable value.
96 Gets the value of the spin control.
101 Sets range of allowable values.
103 void SetRange(int minVal
, int maxVal
);
106 Select the text in the text part of the control between positions
107 @a from (inclusive) and @a to (exclusive). This is similar to
108 wxTextCtrl::SetSelection.
109 @note this is currently only implemented for Windows and generic versions
112 void SetSelection(long from
, long to
);
115 Sets the value of the spin control. Use the variant using int instead.
117 void SetValue(const wxString
& text
);
120 Sets the value of the spin control.
122 void SetValue(int value
);