]>
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.
20 @style{wxTE_PROCESS_ENTER}
21 Indicates that the control should generate wxEVT_COMMAND_TEXT_ENTER
22 events. Using this style will prevent the user from using the Enter key
23 for dialog navigation (e.g. activating the default button in the
29 <!-- @appearance{spinctrl.png} -->
31 @see wxSpinButton, wxSpinCtrlDouble, wxControl
33 class wxSpinCtrl
: public wxControl
42 Constructor, creating and showing a spin control.
45 Parent window. Must not be @NULL.
47 Default value (as text).
49 Window identifier. The value wxID_ANY indicates a default value.
51 Window position. If wxDefaultPosition is specified then a default
54 Window size. If wxDefaultSize is specified then a default size
57 Window style. See wxSpinButton.
69 wxSpinCtrl(wxWindow
* parent
, wxWindowID id
= -1,
70 const wxString
& value
= wxEmptyString
,
71 const wxPoint
& pos
= wxDefaultPosition
,
72 const wxSize
& size
= wxDefaultSize
,
73 long style
= wxSP_ARROW_KEYS
,
74 int min
= 0, int max
= 100,
75 int initial
= 0, const wxString
& name
= _T("wxSpinCtrl"));
78 Creation function called by the spin control constructor.
79 See wxSpinCtrl() for details.
81 bool Create(wxWindow
* parent
, wxWindowID id
= -1,
82 const wxString
& value
= wxEmptyString
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
85 long style
= wxSP_ARROW_KEYS
,
86 int min
= 0, int max
= 100,
87 int initial
= 0, const wxString
& name
= _T("wxSpinCtrl"));
90 Gets maximal allowable value.
95 Gets minimal allowable value.
100 Gets the value of the spin control.
102 int GetValue() const;
105 Sets range of allowable values.
107 void SetRange(int minVal
, int maxVal
);
110 Select the text in the text part of the control between positions
111 @a from (inclusive) and @a to (exclusive). This is similar to
112 wxTextCtrl::SetSelection.
113 @note this is currently only implemented for Windows and generic versions
116 void SetSelection(long from
, long to
);
119 Sets the value of the spin control. Use the variant using int instead.
121 void SetValue(const wxString
& text
);
124 Sets the value of the spin control.
126 void SetValue(int value
);