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