]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: slider.h | |
3 | // Purpose: documentation for wxSlider class | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSlider | |
11 | @wxheader{slider.h} | |
12 | ||
13 | A slider is a control with a handle which can be pulled | |
14 | back and forth to change the value. | |
15 | ||
16 | On Windows, the track bar control is used. | |
17 | ||
18 | Slider events are handled in the same way as a scrollbar. | |
19 | ||
20 | @beginStyleTable | |
21 | @style{wxSL_HORIZONTAL}: | |
22 | Displays the slider horizontally (this is the default). | |
23 | @style{wxSL_VERTICAL}: | |
24 | Displays the slider vertically. | |
25 | @style{wxSL_AUTOTICKS}: | |
26 | Displays tick marks. | |
27 | @style{wxSL_LABELS}: | |
28 | Displays minimum, maximum and value labels. | |
29 | @style{wxSL_LEFT}: | |
30 | Displays ticks on the left and forces the slider to be vertical. | |
31 | @style{wxSL_RIGHT}: | |
32 | Displays ticks on the right and forces the slider to be vertical. | |
33 | @style{wxSL_TOP}: | |
34 | Displays ticks on the top. | |
35 | @style{wxSL_BOTTOM}: | |
36 | Displays ticks on the bottom (this is the default). | |
37 | @style{wxSL_SELRANGE}: | |
38 | Allows the user to select a range on the slider. Windows only. | |
39 | @style{wxSL_INVERSE}: | |
40 | Inverses the mininum and maximum endpoints on the slider. Not | |
41 | compatible with wxSL_SELRANGE. | |
42 | @endStyleTable | |
43 | ||
44 | @library{wxcore} | |
45 | @category{ctrl} | |
46 | @appearance{slider.png} | |
47 | ||
48 | @seealso | |
49 | @ref overview_eventhandlingoverview "Event handling overview", wxScrollBar | |
50 | */ | |
51 | class wxSlider : public wxControl | |
52 | { | |
53 | public: | |
54 | //@{ | |
55 | /** | |
56 | Constructor, creating and showing a slider. | |
57 | ||
58 | @param parent | |
59 | Parent window. Must not be @NULL. | |
60 | ||
61 | @param id | |
62 | Window identifier. The value wxID_ANY indicates a default value. | |
63 | ||
64 | @param value | |
65 | Initial position for the slider. | |
66 | ||
67 | @param minValue | |
68 | Minimum slider position. | |
69 | ||
70 | @param maxValue | |
71 | Maximum slider position. | |
72 | ||
73 | @param size | |
74 | Window size. If wxDefaultSize is specified then a default size is | |
75 | chosen. | |
76 | ||
77 | @param style | |
78 | Window style. See wxSlider. | |
79 | ||
80 | @param validator | |
81 | Window validator. | |
82 | ||
83 | @param name | |
84 | Window name. | |
85 | ||
86 | @sa Create(), wxValidator | |
87 | */ | |
88 | wxSlider(); | |
89 | wxSlider(wxWindow* parent, wxWindowID id, int value, | |
90 | int minValue, int maxValue, | |
91 | const wxPoint& point = wxDefaultPosition, | |
92 | const wxSize& size = wxDefaultSize, | |
93 | long style = wxSL_HORIZONTAL, | |
94 | const wxValidator& validator = wxDefaultValidator, | |
95 | const wxString& name = "slider"); | |
96 | //@} | |
97 | ||
98 | /** | |
99 | Destructor, destroying the slider. | |
100 | */ | |
101 | ~wxSlider(); | |
102 | ||
103 | /** | |
104 | Clears the selection, for a slider with the @b wxSL_SELRANGE style. | |
105 | ||
106 | @remarks Windows 95 only. | |
107 | */ | |
108 | void ClearSel(); | |
109 | ||
110 | /** | |
111 | Clears the ticks. | |
112 | ||
113 | @remarks Windows 95 only. | |
114 | */ | |
115 | void ClearTicks(); | |
116 | ||
117 | /** | |
118 | Used for two-step slider construction. See wxSlider() | |
119 | for further details. | |
120 | */ | |
121 | bool Create(wxWindow* parent, wxWindowID id, int value, | |
122 | int minValue, int maxValue, | |
123 | const wxPoint& point = wxDefaultPosition, | |
124 | const wxSize& size = wxDefaultSize, | |
125 | long style = wxSL_HORIZONTAL, | |
126 | const wxValidator& validator = wxDefaultValidator, | |
127 | const wxString& name = "slider"); | |
128 | ||
129 | /** | |
130 | Returns the line size. | |
131 | ||
132 | @sa SetLineSize() | |
133 | */ | |
134 | int GetLineSize(); | |
135 | ||
136 | /** | |
137 | Gets the maximum slider value. | |
138 | ||
139 | @sa GetMin(), SetRange() | |
140 | */ | |
141 | int GetMax(); | |
142 | ||
143 | /** | |
144 | Gets the minimum slider value. | |
145 | ||
146 | @sa GetMin(), SetRange() | |
147 | */ | |
148 | int GetMin(); | |
149 | ||
150 | /** | |
151 | Returns the page size. | |
152 | ||
153 | @sa SetPageSize() | |
154 | */ | |
155 | int GetPageSize(); | |
156 | ||
157 | /** | |
158 | Returns the selection end point. | |
159 | ||
160 | @remarks Windows 95 only. | |
161 | ||
162 | @sa GetSelStart(), SetSelection() | |
163 | */ | |
164 | int GetSelEnd(); | |
165 | ||
166 | /** | |
167 | Returns the selection start point. | |
168 | ||
169 | @remarks Windows 95 only. | |
170 | ||
171 | @sa GetSelEnd(), SetSelection() | |
172 | */ | |
173 | int GetSelStart(); | |
174 | ||
175 | /** | |
176 | Returns the thumb length. | |
177 | ||
178 | @remarks Windows 95 only. | |
179 | ||
180 | @sa SetThumbLength() | |
181 | */ | |
182 | int GetThumbLength(); | |
183 | ||
184 | /** | |
185 | Returns the tick frequency. | |
186 | ||
187 | @remarks Windows 95 only. | |
188 | ||
189 | @sa SetTickFreq() | |
190 | */ | |
191 | int GetTickFreq(); | |
192 | ||
193 | /** | |
194 | Gets the current slider value. | |
195 | ||
196 | @sa GetMin(), GetMax(), SetValue() | |
197 | */ | |
198 | int GetValue(); | |
199 | ||
200 | /** | |
201 | Sets the line size for the slider. | |
202 | ||
203 | @param lineSize | |
204 | The number of steps the slider moves when the user moves it up or down a line. | |
205 | ||
206 | @sa GetLineSize() | |
207 | */ | |
208 | void SetLineSize(int lineSize); | |
209 | ||
210 | /** | |
211 | Sets the page size for the slider. | |
212 | ||
213 | @param pageSize | |
214 | The number of steps the slider moves when the user pages up or down. | |
215 | ||
216 | @sa GetPageSize() | |
217 | */ | |
218 | void SetPageSize(int pageSize); | |
219 | ||
220 | /** | |
221 | Sets the minimum and maximum slider values. | |
222 | ||
223 | @sa GetMin(), GetMax() | |
224 | */ | |
225 | void SetRange(int minValue, int maxValue); | |
226 | ||
227 | /** | |
228 | Sets the selection. | |
229 | ||
230 | @param startPos | |
231 | The selection start position. | |
232 | ||
233 | @param endPos | |
234 | The selection end position. | |
235 | ||
236 | @remarks Windows 95 only. | |
237 | ||
238 | @sa GetSelStart(), GetSelEnd() | |
239 | */ | |
240 | void SetSelection(int startPos, int endPos); | |
241 | ||
242 | /** | |
243 | Sets the slider thumb length. | |
244 | ||
245 | @param len | |
246 | The thumb length. | |
247 | ||
248 | @remarks Windows 95 only. | |
249 | ||
250 | @sa GetThumbLength() | |
251 | */ | |
252 | void SetThumbLength(int len); | |
253 | ||
254 | /** | |
255 | Sets a tick position. | |
256 | ||
257 | @param tickPos | |
258 | The tick position. | |
259 | ||
260 | @remarks Windows 95 only. | |
261 | ||
262 | @sa SetTickFreq() | |
263 | */ | |
264 | void SetTick(int tickPos); | |
265 | ||
266 | /** | |
267 | Sets the tick mark frequency and position. | |
268 | ||
269 | @param n | |
270 | Frequency. For example, if the frequency is set to two, a tick mark is | |
271 | displayed for | |
272 | every other increment in the slider's range. | |
273 | ||
274 | @param pos | |
275 | Position. Must be greater than zero. TODO: what is this for? | |
276 | ||
277 | @remarks Windows 95 only. | |
278 | ||
279 | @sa GetTickFreq() | |
280 | */ | |
281 | void SetTickFreq(int n, int pos); | |
282 | ||
283 | /** | |
284 | Sets the slider position. | |
285 | ||
286 | @param value | |
287 | The slider position. | |
288 | */ | |
289 | void SetValue(int value); | |
290 | }; |