]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxSlider}}\label{wxslider} |
2 | ||
3 | A slider is a control with a handle which can be pulled | |
4 | back and forth to change the value. | |
5 | ||
6 | In Windows versions below Windows 95, a scrollbar is used to simulate the slider. In Windows 95, | |
7 | the track bar control is used. | |
8 | ||
9 | Slider events are handled in the same way as a scrollbar. | |
10 | ||
11 | \wxheading{Derived from} | |
12 | ||
13 | \helpref{wxControl}{wxcontrol}\\ | |
14 | \helpref{wxWindow}{wxwindow}\\ | |
15 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
16 | \helpref{wxObject}{wxobject} | |
17 | ||
954b8ae6 JS |
18 | \wxheading{Include files} |
19 | ||
20 | <wx/slider.h> | |
21 | ||
a660d684 KB |
22 | \wxheading{Window styles} |
23 | ||
24 | \twocolwidtha{5cm} | |
25 | \begin{twocollist}\itemsep=0pt | |
26 | \twocolitem{\windowstyle{wxSL\_HORIZONTAL}}{Displays the slider horizontally.} | |
27 | \twocolitem{\windowstyle{wxSL\_VERTICAL}}{Displays the slider vertically.} | |
28 | \twocolitem{\windowstyle{wxSL\_AUTOTICKS}}{Displays tick marks.} | |
9a8c7620 VZ |
29 | \twocolitem{\windowstyle{wxSL\_LABELS}}{Displays minimum, maximum and value labels. |
30 | (NB: only displays the current value label under wxGTK)} | |
a660d684 KB |
31 | \twocolitem{\windowstyle{wxSL\_LEFT}}{Displays ticks on the left, if a vertical slider.} |
32 | \twocolitem{\windowstyle{wxSL\_RIGHT}}{Displays ticks on the right, if a vertical slider.} | |
33 | \twocolitem{\windowstyle{wxSL\_TOP}}{Displays ticks on the top, if a horizontal slider.} | |
34 | \twocolitem{\windowstyle{wxSL\_SELRANGE}}{Allows the user to select a range on the slider. Windows 95 only.} | |
5101728b | 35 | \twocolitem{\windowstyle{wxSL\_INVERSE}}{Inverses the mininum and maximum endpoints on the slider. wxGTK only.} |
a660d684 KB |
36 | \end{twocollist} |
37 | ||
38 | See also \helpref{window styles overview}{windowstyles}. | |
39 | ||
dd56228c | 40 | \input scrolevt.inc |
5de76427 | 41 | |
a660d684 KB |
42 | \wxheading{See also} |
43 | ||
44 | \helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxScrollBar}{wxscrollbar} | |
45 | ||
46 | \latexignore{\rtfignore{\wxheading{Members}}} | |
47 | ||
08f1d438 | 48 | \membersection{wxSlider::wxSlider}\label{wxsliderctor} |
a660d684 KB |
49 | |
50 | \func{}{wxSlider}{\void} | |
51 | ||
52 | Default slider. | |
53 | ||
eaaa6a06 JS |
54 | \func{}{wxSlider}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp |
55 | \param{int}{ minValue}, \param{int}{ maxValue},\rtfsp | |
a660d684 | 56 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 57 | \param{long}{ style = wxSL\_HORIZONTAL},\rtfsp |
a660d684 KB |
58 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
59 | \param{const wxString\& }{name = ``slider"}} | |
60 | ||
61 | Constructor, creating and showing a slider. | |
62 | ||
63 | \wxheading{Parameters} | |
64 | ||
65 | \docparam{parent}{Parent window. Must not be NULL.} | |
66 | ||
67 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
68 | ||
69 | \docparam{value}{Initial position for the slider.} | |
70 | ||
71 | \docparam{minValue}{Minimum slider position.} | |
72 | ||
73 | \docparam{maxValue}{Maximum slider position.} | |
74 | ||
75 | \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.} | |
76 | ||
77 | \docparam{style}{Window style. See \helpref{wxSlider}{wxslider}.} | |
78 | ||
79 | \docparam{validator}{Window validator.} | |
80 | ||
81 | \docparam{name}{Window name.} | |
82 | ||
83 | \wxheading{See also} | |
84 | ||
85 | \helpref{wxSlider::Create}{wxslidercreate}, \helpref{wxValidator}{wxvalidator} | |
86 | ||
08f1d438 | 87 | \membersection{wxSlider::\destruct{wxSlider}}\label{wxsliderdtor} |
a660d684 KB |
88 | |
89 | \func{void}{\destruct{wxSlider}}{\void} | |
90 | ||
91 | Destructor, destroying the slider. | |
92 | ||
93 | \membersection{wxSlider::ClearSel}\label{wxsliderclearsel} | |
94 | ||
95 | \func{void}{ClearSel}{\void} | |
96 | ||
97 | Clears the selection, for a slider with the {\bf wxSL\_SELRANGE} style. | |
98 | ||
99 | \wxheading{Remarks} | |
100 | ||
101 | Windows 95 only. | |
102 | ||
103 | \membersection{wxSlider::ClearTicks}\label{wxsliderclearticks} | |
104 | ||
105 | \func{void}{ClearTicks}{\void} | |
106 | ||
107 | Clears the ticks. | |
108 | ||
109 | \wxheading{Remarks} | |
110 | ||
111 | Windows 95 only. | |
112 | ||
113 | \membersection{wxSlider::Create}\label{wxslidercreate} | |
114 | ||
eaaa6a06 JS |
115 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp |
116 | \param{int}{ minValue}, \param{int}{ maxValue},\rtfsp | |
a660d684 | 117 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 118 | \param{long}{ style = wxSL\_HORIZONTAL},\rtfsp |
a660d684 KB |
119 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
120 | \param{const wxString\& }{name = ``slider"}} | |
121 | ||
08f1d438 | 122 | Used for two-step slider construction. See \helpref{wxSlider::wxSlider}{wxsliderctor}\rtfsp |
a660d684 KB |
123 | for further details. |
124 | ||
125 | \membersection{wxSlider::GetLineSize}\label{wxslidergetlinesize} | |
126 | ||
127 | \constfunc{int}{GetLineSize}{\void} | |
128 | ||
129 | Returns the line size. | |
130 | ||
131 | \wxheading{See also} | |
132 | ||
133 | \helpref{wxSlider::SetLineSize}{wxslidersetlinesize} | |
134 | ||
135 | \membersection{wxSlider::GetMax}\label{wxslidergetmax} | |
136 | ||
137 | \constfunc{int}{GetMax}{\void} | |
138 | ||
139 | Gets the maximum slider value. | |
140 | ||
141 | \wxheading{See also} | |
142 | ||
143 | \helpref{wxSlider::GetMin}{wxslidergetmin}, \helpref{wxSlider::SetRange}{wxslidersetrange} | |
144 | ||
145 | \membersection{wxSlider::GetMin}\label{wxslidergetmin} | |
146 | ||
147 | \constfunc{int}{GetMin}{\void} | |
148 | ||
149 | Gets the minimum slider value. | |
150 | ||
151 | \wxheading{See also} | |
152 | ||
153 | \helpref{wxSlider::GetMin}{wxslidergetmin}, \helpref{wxSlider::SetRange}{wxslidersetrange} | |
154 | ||
155 | \membersection{wxSlider::GetPageSize}\label{wxslidergetpagesize} | |
156 | ||
157 | \constfunc{int}{GetPageSize}{\void} | |
158 | ||
159 | Returns the page size. | |
160 | ||
161 | \wxheading{See also} | |
162 | ||
163 | \helpref{wxSlider::SetPageSize}{wxslidersetpagesize} | |
164 | ||
165 | \membersection{wxSlider::GetSelEnd}\label{wxslidergetselend} | |
166 | ||
167 | \constfunc{int}{GetSelEnd}{\void} | |
168 | ||
169 | Returns the selection end point. | |
170 | ||
171 | \wxheading{Remarks} | |
172 | ||
173 | Windows 95 only. | |
174 | ||
175 | \wxheading{See also} | |
176 | ||
177 | \helpref{wxSlider::GetSelStart}{wxslidergetselstart}, \helpref{wxSlider::SetSelection}{wxslidersetselection} | |
178 | ||
179 | \membersection{wxSlider::GetSelStart}\label{wxslidergetselstart} | |
180 | ||
181 | \constfunc{int}{GetSelStart}{\void} | |
182 | ||
183 | Returns the selection start point. | |
184 | ||
185 | \wxheading{Remarks} | |
186 | ||
187 | Windows 95 only. | |
188 | ||
189 | \wxheading{See also} | |
190 | ||
191 | \helpref{wxSlider::GetSelEnd}{wxslidergetselend}, \helpref{wxSlider::SetSelection}{wxslidersetselection} | |
192 | ||
193 | \membersection{wxSlider::GetThumbLength}\label{wxslidergetthumblength} | |
194 | ||
195 | \constfunc{int}{GetThumbLength}{\void} | |
196 | ||
197 | Returns the thumb length. | |
198 | ||
199 | \wxheading{Remarks} | |
200 | ||
201 | Windows 95 only. | |
202 | ||
203 | \wxheading{See also} | |
204 | ||
205 | \helpref{wxSlider::SetThumbLength}{wxslidersetthumblength} | |
206 | ||
207 | \membersection{wxSlider::GetTickFreq}\label{wxslidergettickfreq} | |
208 | ||
209 | \constfunc{int}{GetTickFreq}{\void} | |
210 | ||
211 | Returns the tick frequency. | |
212 | ||
213 | \wxheading{Remarks} | |
214 | ||
215 | Windows 95 only. | |
216 | ||
217 | \wxheading{See also} | |
218 | ||
219 | \helpref{wxSlider::SetTickFreq}{wxslidersettickfreq} | |
220 | ||
221 | \membersection{wxSlider::GetValue}\label{wxslidergetvalue} | |
222 | ||
223 | \constfunc{int}{GetValue}{\void} | |
224 | ||
225 | Gets the current slider value. | |
226 | ||
227 | \wxheading{See also} | |
228 | ||
229 | \helpref{wxSlider::GetMin}{wxslidergetmin}, \helpref{wxSlider::GetMax}{wxslidergetmax},\rtfsp | |
230 | \helpref{wxSlider::SetValue}{wxslidersetvalue} | |
231 | ||
232 | \membersection{wxSlider::SetRange}\label{wxslidersetrange} | |
233 | ||
eaaa6a06 | 234 | \func{void}{SetRange}{\param{int}{ minValue}, \param{int}{ maxValue}} |
a660d684 KB |
235 | |
236 | Sets the minimum and maximum slider values. | |
237 | ||
238 | \wxheading{See also} | |
239 | ||
240 | \helpref{wxSlider::GetMin}{wxslidergetmin}, \helpref{wxSlider::GetMax}{wxslidergetmax} | |
241 | ||
242 | \membersection{wxSlider::SetTickFreq}\label{wxslidersettickfreq} | |
243 | ||
eaaa6a06 | 244 | \func{void}{SetTickFreq}{\param{int }{n}, \param{int }{pos}} |
a660d684 KB |
245 | |
246 | Sets the tick mark frequency and position. | |
247 | ||
248 | \wxheading{Parameters} | |
249 | ||
250 | \docparam{n}{Frequency. For example, if the frequency is set to two, a tick mark is displayed for | |
251 | every other increment in the slider's range.} | |
252 | ||
253 | \docparam{pos}{Position. Must be greater than zero. TODO: what is this for?} | |
254 | ||
255 | \wxheading{Remarks} | |
256 | ||
257 | Windows 95 only. | |
258 | ||
259 | \wxheading{See also} | |
260 | ||
261 | \helpref{wxSlider::GetTickFreq}{wxslidergettickfreq} | |
262 | ||
263 | \membersection{wxSlider::SetLineSize}\label{wxslidersetlinesize} | |
264 | ||
eaaa6a06 | 265 | \func{void}{SetLineSize}{\param{int }{lineSize}} |
a660d684 KB |
266 | |
267 | Sets the line size for the slider. | |
268 | ||
269 | \wxheading{Parameters} | |
270 | ||
271 | \docparam{lineSize}{The number of steps the slider moves when the user moves it up or down a line.} | |
272 | ||
273 | \wxheading{See also} | |
274 | ||
275 | \helpref{wxSlider::GetLineSize}{wxslidergetlinesize} | |
276 | ||
277 | \membersection{wxSlider::SetPageSize}\label{wxslidersetpagesize} | |
278 | ||
eaaa6a06 | 279 | \func{void}{SetPageSize}{\param{int }{pageSize}} |
a660d684 KB |
280 | |
281 | Sets the page size for the slider. | |
282 | ||
283 | \wxheading{Parameters} | |
284 | ||
285 | \docparam{pageSize}{The number of steps the slider moves when the user pages up or down.} | |
286 | ||
287 | \wxheading{See also} | |
288 | ||
289 | \helpref{wxSlider::GetPageSize}{wxslidergetpagesize} | |
290 | ||
291 | \membersection{wxSlider::SetSelection}\label{wxslidersetselection} | |
292 | ||
eaaa6a06 | 293 | \func{void}{SetSelection}{\param{int }{startPos}, \param{int }{endPos}} |
a660d684 KB |
294 | |
295 | Sets the selection. | |
296 | ||
297 | \wxheading{Parameters} | |
298 | ||
299 | \docparam{startPos}{The selection start position.} | |
300 | ||
301 | \docparam{endPos}{The selection end position.} | |
302 | ||
303 | \wxheading{Remarks} | |
304 | ||
305 | Windows 95 only. | |
306 | ||
307 | \wxheading{See also} | |
308 | ||
309 | \helpref{wxSlider::GetSelStart}{wxslidergetselstart}, \helpref{wxSlider::GetSelEnd}{wxslidergetselend} | |
310 | ||
311 | \membersection{wxSlider::SetThumbLength}\label{wxslidersetthumblength} | |
312 | ||
eaaa6a06 | 313 | \func{void}{SetThumbLength}{\param{int }{len}} |
a660d684 KB |
314 | |
315 | Sets the slider thumb length. | |
316 | ||
317 | \wxheading{Parameters} | |
318 | ||
319 | \docparam{len}{The thumb length.} | |
320 | ||
321 | \wxheading{Remarks} | |
322 | ||
323 | Windows 95 only. | |
324 | ||
325 | \wxheading{See also} | |
326 | ||
327 | \helpref{wxSlider::GetThumbLength}{wxslidergetthumblength} | |
328 | ||
329 | \membersection{wxSlider::SetTick}\label{wxslidersettick} | |
330 | ||
eaaa6a06 | 331 | \func{void}{SetTick}{\param{int}{ tickPos}} |
a660d684 KB |
332 | |
333 | Sets a tick position. | |
334 | ||
335 | \wxheading{Parameters} | |
336 | ||
337 | \docparam{tickPos}{The tick position.} | |
338 | ||
339 | \wxheading{Remarks} | |
340 | ||
341 | Windows 95 only. | |
342 | ||
343 | \wxheading{See also} | |
344 | ||
345 | \helpref{wxSlider::SetTickFreq}{wxslidersettickfreq} | |
346 | ||
347 | \membersection{wxSlider::SetValue}\label{wxslidersetvalue} | |
348 | ||
eaaa6a06 | 349 | \func{void}{SetValue}{\param{int}{ value}} |
a660d684 KB |
350 | |
351 | Sets the slider position. | |
352 | ||
353 | \wxheading{Parameters} | |
354 | ||
355 | \docparam{value}{The slider position.} | |
356 | ||
357 | \wxheading{See also} | |
358 | ||
359 | \helpref{wxSlider::GetValue}{wxslidergetvalue} | |
360 |