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