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