]> git.saurik.com Git - wxWidgets.git/blob - interface/spinctrl.h
e4b068516d116a57805287056f08c12a3a76f90e
[wxWidgets.git] / interface / spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: spinctrl.h
3 // Purpose: documentation for wxSpinCtrl class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxSpinCtrl
11 @wxheader{spinctrl.h}
12
13 wxSpinCtrl combines wxTextCtrl and
14 wxSpinButton in one control.
15
16 @beginStyleTable
17 @style{wxSP_ARROW_KEYS}:
18 The user can use arrow keys to change the value.
19 @style{wxSP_WRAP}:
20 The value wraps at the minimum and maximum.
21 @endStyleTable
22
23 @library{wxcore}
24 @category{ctrl}
25 @appearance{spinctrl.png}
26
27 @seealso
28 @ref overview_eventhandlingoverview "Event handling overview", wxSpinButton,
29 wxControl
30 */
31 class wxSpinCtrl : public wxControl
32 {
33 public:
34 //@{
35 /**
36 )
37
38 Constructor, creating and showing a spin control.
39
40 @param parent
41 Parent window. Must not be @NULL.
42
43 @param value
44 Default value.
45
46 @param id
47 Window identifier. The value wxID_ANY indicates a default value.
48
49 @param pos
50 Window position. If wxDefaultPosition is specified then a default position
51 is chosen.
52
53 @param size
54 Window size. If wxDefaultSize is specified then a default size is
55 chosen.
56
57 @param style
58 Window style. See wxSpinButton.
59
60 @param min
61 Minimal value.
62
63 @param max
64 Maximal value.
65
66 @param initial
67 Initial value.
68
69 @param name
70 Window name.
71
72 @sa Create()
73 */
74 wxSpinCtrl();
75 wxSpinCtrl(wxWindow* parent, wxWindowID id = -1,
76 const wxString& value = wxEmptyString,
77 const wxPoint& pos = wxDefaultPosition,
78 const wxSize& size = wxDefaultSize,
79 long style = wxSP_ARROW_KEYS,
80 int min = 0, int max = 100,
81 int initial = 0);
82 //@}
83
84 /**
85 )
86
87 Creation function called by the spin control constructor.
88
89 See wxSpinCtrl() for details.
90 */
91 bool Create(wxWindow* parent, wxWindowID id = -1,
92 const wxString& value = wxEmptyString,
93 const wxPoint& pos = wxDefaultPosition,
94 const wxSize& size = wxDefaultSize,
95 long style = wxSP_ARROW_KEYS,
96 int min = 0, int max = 100,
97 int initial = 0);
98
99 /**
100 Gets maximal allowable value.
101 */
102 int GetMax();
103
104 /**
105 Gets minimal allowable value.
106 */
107 int GetMin();
108
109 /**
110 Gets the value of the spin control.
111 */
112 int GetValue();
113
114 /**
115 Sets range of allowable values.
116 */
117 void SetRange(int minVal, int maxVal);
118
119 /**
120 Select the text in the text part of the control between positions
121 @e from (inclusive) and @e to (exclusive). This is similar to
122 wxTextCtrl::SetSelection.
123
124 @b NB: this is currently only implemented for Windows and generic versions
125 of the control.
126 */
127 void SetSelection(long from, long to);
128
129 //@{
130 /**
131 Sets the value of the spin control.
132 */
133 void SetValue(const wxString& text);
134 void SetValue(int value);
135 //@}
136 };