]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSpinCtrl
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 wxSpinCtrl combines wxTextCtrl and
13 wxSpinButton in one control.
16 @style{wxSP_ARROW_KEYS}
17 The user can use arrow keys to change the value.
19 The value wraps at the minimum and maximum.
24 <!-- @appearance{spinctrl.png} -->
26 @see wxSpinButton, wxControl
28 class wxSpinCtrl
: public wxControl
37 Constructor, creating and showing a spin control.
40 Parent window. Must not be @NULL.
42 Default value (as text).
44 Window identifier. The value wxID_ANY indicates a default value.
46 Window position. If wxDefaultPosition is specified then a default
49 Window size. If wxDefaultSize is specified then a default size
52 Window style. See wxSpinButton.
64 wxSpinCtrl(wxWindow
* parent
, wxWindowID id
= -1,
65 const wxString
& value
= wxEmptyString
,
66 const wxPoint
& pos
= wxDefaultPosition
,
67 const wxSize
& size
= wxDefaultSize
,
68 long style
= wxSP_ARROW_KEYS
,
69 int min
= 0, int max
= 100,
73 Creation function called by the spin control constructor.
74 See wxSpinCtrl() for details.
76 bool Create(wxWindow
* parent
, wxWindowID id
= -1,
77 const wxString
& value
= wxEmptyString
,
78 const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
,
80 long style
= wxSP_ARROW_KEYS
,
81 int min
= 0, int max
= 100,
85 Gets maximal allowable value.
90 Gets minimal allowable value.
95 Gets the value of the spin control.
100 Sets range of allowable values.
102 void SetRange(int minVal
, int maxVal
);
105 Select the text in the text part of the control between positions
106 @a from (inclusive) and @a to (exclusive). This is similar to
107 wxTextCtrl::SetSelection.
108 @note this is currently only implemented for Windows and generic versions
111 void SetSelection(long from
, long to
);
114 Sets the value of the spin control. Use the variant using int instead.
116 void SetValue(const wxString
& text
);
119 Sets the value of the spin control.
121 void SetValue(int value
);