]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/slider.tex
Restored a couple of label
[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 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
18 \wxheading{Include files}
19
20 <wx/slider.h>
21
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.}
29 \twocolitem{\windowstyle{wxSL\_LABELS}}{Displays minimum, maximum and value labels.
30 (NB: only displays the current value label under wxGTK)}
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.}
35 \twocolitem{\windowstyle{wxSL\_INVERSE}}{Inverses the mininum and maximum endpoints on the slider. wxGTK only.}
36 \end{twocollist}
37
38 See also \helpref{window styles overview}{windowstyles}.
39
40 \input scrolevt.inc
41
42 \wxheading{See also}
43
44 \helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxScrollBar}{wxscrollbar}
45
46 \latexignore{\rtfignore{\wxheading{Members}}}
47
48 \membersection{wxSlider::wxSlider}\label{wxsliderctor}
49
50 \func{}{wxSlider}{\void}
51
52 Default slider.
53
54 \func{}{wxSlider}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
55 \param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
56 \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
57 \param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
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
87 \membersection{wxSlider::\destruct{wxSlider}}\label{wxsliderdtor}
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
115 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
116 \param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
117 \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
118 \param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
119 \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
120 \param{const wxString\& }{name = ``slider"}}
121
122 Used for two-step slider construction. See \helpref{wxSlider::wxSlider}{wxsliderctor}\rtfsp
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
234 \func{void}{SetRange}{\param{int}{ minValue}, \param{int}{ maxValue}}
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
244 \func{void}{SetTickFreq}{\param{int }{n}, \param{int }{pos}}
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
265 \func{void}{SetLineSize}{\param{int }{lineSize}}
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
279 \func{void}{SetPageSize}{\param{int }{pageSize}}
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
293 \func{void}{SetSelection}{\param{int }{startPos}, \param{int }{endPos}}
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
313 \func{void}{SetThumbLength}{\param{int }{len}}
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
331 \func{void}{SetTick}{\param{int}{ tickPos}}
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
349 \func{void}{SetValue}{\param{int}{ value}}
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