]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: spinbutt.h | |
3 | // Purpose: documentation for wxSpinEvent class | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSpinEvent | |
11 | @wxheader{spinbutt.h} | |
7c913512 FM |
12 | |
13 | This event class is used for the events generated by | |
23324ae1 | 14 | wxSpinButton and wxSpinCtrl. |
7c913512 | 15 | |
23324ae1 FM |
16 | @library{wxcore} |
17 | @category{events} | |
7c913512 | 18 | |
23324ae1 FM |
19 | @seealso |
20 | wxSpinButton and wxSpinCtrl | |
21 | */ | |
22 | class wxSpinEvent : public wxNotifyEvent | |
23 | { | |
24 | public: | |
25 | /** | |
26 | The constructor is not normally used by the user code. | |
27 | */ | |
4cc4bfaf | 28 | wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0); |
23324ae1 FM |
29 | |
30 | /** | |
31 | Retrieve the current spin button or control value. | |
32 | */ | |
328f5751 | 33 | int GetPosition() const; |
23324ae1 FM |
34 | |
35 | /** | |
36 | Set the value associated with the event. | |
37 | */ | |
38 | void SetPosition(int pos); | |
39 | }; | |
40 | ||
41 | ||
42 | /** | |
43 | @class wxSpinButton | |
44 | @wxheader{spinbutt.h} | |
7c913512 | 45 | |
23324ae1 FM |
46 | A wxSpinButton has two small up and down (or left and right) arrow buttons. It |
47 | is often used next to a text control for increment and decrementing a value. | |
48 | Portable programs should try to use wxSpinCtrl instead | |
49 | as wxSpinButton is not implemented for all platforms but wxSpinCtrl is as it | |
50 | degenerates to a simple wxTextCtrl on such platforms. | |
7c913512 | 51 | |
23324ae1 FM |
52 | @b NB: the range supported by this control (and wxSpinCtrl) depends on the |
53 | platform but is at least @c -0x8000 to @c 0x7fff. Under GTK and | |
54 | Win32 with sufficiently new version of @c comctrl32.dll (at least 4.71 is | |
55 | required, 5.80 is recommended) the full 32 bit range is supported. | |
7c913512 | 56 | |
23324ae1 FM |
57 | @beginStyleTable |
58 | @style{wxSP_HORIZONTAL}: | |
59 | Specifies a horizontal spin button (note that this style is not | |
60 | supported in wxGTK). | |
61 | @style{wxSP_VERTICAL}: | |
62 | Specifies a vertical spin button. | |
63 | @style{wxSP_ARROW_KEYS}: | |
64 | The user can use arrow keys to change the value. | |
65 | @style{wxSP_WRAP}: | |
66 | The value wraps at the minimum and maximum. | |
67 | @endStyleTable | |
7c913512 | 68 | |
23324ae1 FM |
69 | @library{wxcore} |
70 | @category{ctrl} | |
71 | @appearance{spinbutton.png} | |
7c913512 | 72 | |
23324ae1 FM |
73 | @seealso |
74 | wxSpinCtrl | |
75 | */ | |
76 | class wxSpinButton : public wxControl | |
77 | { | |
78 | public: | |
79 | //@{ | |
80 | /** | |
81 | Constructor, creating and showing a spin button. | |
82 | ||
7c913512 | 83 | @param parent |
4cc4bfaf | 84 | Parent window. Must not be @NULL. |
7c913512 | 85 | @param id |
4cc4bfaf | 86 | Window identifier. The value wxID_ANY indicates a default value. |
7c913512 | 87 | @param pos |
4cc4bfaf FM |
88 | Window position. If wxDefaultPosition is specified then a default |
89 | position is chosen. | |
7c913512 | 90 | @param size |
4cc4bfaf FM |
91 | Window size. If wxDefaultSize is specified then a default size |
92 | is chosen. | |
7c913512 | 93 | @param style |
4cc4bfaf | 94 | Window style. See wxSpinButton. |
7c913512 | 95 | @param name |
4cc4bfaf | 96 | Window name. |
23324ae1 | 97 | |
4cc4bfaf | 98 | @see Create() |
23324ae1 FM |
99 | */ |
100 | wxSpinButton(); | |
7c913512 FM |
101 | wxSpinButton(wxWindow* parent, wxWindowID id, |
102 | const wxPoint& pos = wxDefaultPosition, | |
103 | const wxSize& size = wxDefaultSize, | |
104 | long style = wxSP_HORIZONTAL, | |
105 | const wxString& name = "spinButton"); | |
23324ae1 FM |
106 | //@} |
107 | ||
108 | /** | |
109 | Destructor, destroys the spin button control. | |
110 | */ | |
111 | ~wxSpinButton(); | |
112 | ||
113 | /** | |
114 | Scrollbar creation function called by the spin button constructor. | |
115 | See wxSpinButton() for details. | |
116 | */ | |
117 | bool Create(wxWindow* parent, wxWindowID id, | |
118 | const wxPoint& pos = wxDefaultPosition, | |
119 | const wxSize& size = wxDefaultSize, | |
120 | long style = wxSP_HORIZONTAL, | |
121 | const wxString& name = "spinButton"); | |
122 | ||
123 | /** | |
124 | Returns the maximum permissible value. | |
125 | ||
4cc4bfaf | 126 | @see SetRange() |
23324ae1 | 127 | */ |
328f5751 | 128 | int GetMax() const; |
23324ae1 FM |
129 | |
130 | /** | |
131 | Returns the minimum permissible value. | |
132 | ||
4cc4bfaf | 133 | @see SetRange() |
23324ae1 | 134 | */ |
328f5751 | 135 | int GetMin() const; |
23324ae1 FM |
136 | |
137 | /** | |
138 | Returns the current spin button value. | |
139 | ||
4cc4bfaf | 140 | @see SetValue() |
23324ae1 | 141 | */ |
328f5751 | 142 | int GetValue() const; |
23324ae1 FM |
143 | |
144 | /** | |
145 | Sets the range of the spin button. | |
146 | ||
7c913512 | 147 | @param min |
4cc4bfaf | 148 | The minimum value for the spin button. |
7c913512 | 149 | @param max |
4cc4bfaf | 150 | The maximum value for the spin button. |
23324ae1 | 151 | |
4cc4bfaf | 152 | @see GetMin(), GetMax() |
23324ae1 FM |
153 | */ |
154 | void SetRange(int min, int max); | |
155 | ||
156 | /** | |
157 | Sets the value of the spin button. | |
158 | ||
7c913512 | 159 | @param value |
4cc4bfaf | 160 | The value for the spin button. |
23324ae1 FM |
161 | */ |
162 | void SetValue(int value); | |
163 | }; |