]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/slider.tex
API change: a single SELECTION_CHANGED not lots of SELECT and UNSELECT events
[wxWidgets.git] / docs / latex / wx / slider.tex
CommitLineData
a660d684
KB
1\section{\class{wxSlider}}\label{wxslider}
2
3A slider is a control with a handle which can be pulled
4back and forth to change the value.
5
dceb1c09 6On Windows, the track bar control is used.
a660d684
KB
7
8Slider 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
954b8ae6
JS
17\wxheading{Include files}
18
19<wx/slider.h>
20
a7af285d
VZ
21\wxheading{Library}
22
23\helpref{wxCore}{librarieslist}
24
a660d684
KB
25\wxheading{Window styles}
26
27\twocolwidtha{5cm}
28\begin{twocollist}\itemsep=0pt
7c2cb1f4 29\twocolitem{\windowstyle{wxSL\_HORIZONTAL}}{Displays the slider horizontally (this is the default).}
a660d684
KB
30\twocolitem{\windowstyle{wxSL\_VERTICAL}}{Displays the slider vertically.}
31\twocolitem{\windowstyle{wxSL\_AUTOTICKS}}{Displays tick marks.}
184686f6 32\twocolitem{\windowstyle{wxSL\_LABELS}}{Displays minimum, maximum and value labels.}
7c2cb1f4
VZ
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).}
184686f6
JS
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}
a660d684
KB
40
41See also \helpref{window styles overview}{windowstyles}.
42
dd56228c 43\input scrolevt.inc
5de76427 44
a660d684
KB
45\wxheading{See also}
46
47\helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxScrollBar}{wxscrollbar}
48
49\latexignore{\rtfignore{\wxheading{Members}}}
50
08f1d438 51\membersection{wxSlider::wxSlider}\label{wxsliderctor}
a660d684
KB
52
53\func{}{wxSlider}{\void}
54
55Default slider.
56
eaaa6a06
JS
57\func{}{wxSlider}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
58\param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
a660d684 59\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 60\param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
a660d684
KB
61\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
62\param{const wxString\& }{name = ``slider"}}
63
64Constructor, 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
08f1d438 90\membersection{wxSlider::\destruct{wxSlider}}\label{wxsliderdtor}
a660d684
KB
91
92\func{void}{\destruct{wxSlider}}{\void}
93
94Destructor, destroying the slider.
95
96\membersection{wxSlider::ClearSel}\label{wxsliderclearsel}
97
98\func{void}{ClearSel}{\void}
99
100Clears the selection, for a slider with the {\bf wxSL\_SELRANGE} style.
101
102\wxheading{Remarks}
103
104Windows 95 only.
105
106\membersection{wxSlider::ClearTicks}\label{wxsliderclearticks}
107
108\func{void}{ClearTicks}{\void}
109
110Clears the ticks.
111
112\wxheading{Remarks}
113
114Windows 95 only.
115
116\membersection{wxSlider::Create}\label{wxslidercreate}
117
eaaa6a06
JS
118\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
119\param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
a660d684 120\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 121\param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
a660d684
KB
122\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
123\param{const wxString\& }{name = ``slider"}}
124
08f1d438 125Used for two-step slider construction. See \helpref{wxSlider::wxSlider}{wxsliderctor}\rtfsp
a660d684
KB
126for further details.
127
128\membersection{wxSlider::GetLineSize}\label{wxslidergetlinesize}
129
130\constfunc{int}{GetLineSize}{\void}
131
132Returns 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
142Gets 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
152Gets 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
162Returns 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
172Returns the selection end point.
173
174\wxheading{Remarks}
175
176Windows 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
186Returns the selection start point.
187
188\wxheading{Remarks}
189
190Windows 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
200Returns the thumb length.
201
202\wxheading{Remarks}
203
204Windows 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
214Returns the tick frequency.
215
216\wxheading{Remarks}
217
218Windows 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
228Gets 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
a660d684
KB
235\membersection{wxSlider::SetLineSize}\label{wxslidersetlinesize}
236
eaaa6a06 237\func{void}{SetLineSize}{\param{int }{lineSize}}
a660d684
KB
238
239Sets 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
eaaa6a06 251\func{void}{SetPageSize}{\param{int }{pageSize}}
a660d684
KB
252
253Sets 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
43e8916f
MW
263\membersection{wxSlider::SetRange}\label{wxslidersetrange}
264
265\func{void}{SetRange}{\param{int}{ minValue}, \param{int}{ maxValue}}
266
267Sets the minimum and maximum slider values.
268
269\wxheading{See also}
270
271\helpref{wxSlider::GetMin}{wxslidergetmin}, \helpref{wxSlider::GetMax}{wxslidergetmax}
272
a660d684
KB
273\membersection{wxSlider::SetSelection}\label{wxslidersetselection}
274
eaaa6a06 275\func{void}{SetSelection}{\param{int }{startPos}, \param{int }{endPos}}
a660d684
KB
276
277Sets 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
287Windows 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
eaaa6a06 295\func{void}{SetThumbLength}{\param{int }{len}}
a660d684
KB
296
297Sets the slider thumb length.
298
299\wxheading{Parameters}
300
301\docparam{len}{The thumb length.}
302
303\wxheading{Remarks}
304
305Windows 95 only.
306
307\wxheading{See also}
308
309\helpref{wxSlider::GetThumbLength}{wxslidergetthumblength}
310
311\membersection{wxSlider::SetTick}\label{wxslidersettick}
312
eaaa6a06 313\func{void}{SetTick}{\param{int}{ tickPos}}
a660d684
KB
314
315Sets a tick position.
316
317\wxheading{Parameters}
318
319\docparam{tickPos}{The tick position.}
320
321\wxheading{Remarks}
322
323Windows 95 only.
324
325\wxheading{See also}
326
327\helpref{wxSlider::SetTickFreq}{wxslidersettickfreq}
328
43e8916f
MW
329\membersection{wxSlider::SetTickFreq}\label{wxslidersettickfreq}
330
331\func{void}{SetTickFreq}{\param{int }{n}, \param{int }{pos}}
332
333Sets 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
338every 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
344Windows 95 only.
345
346\wxheading{See also}
347
348\helpref{wxSlider::GetTickFreq}{wxslidergettickfreq}
349
a660d684
KB
350\membersection{wxSlider::SetValue}\label{wxslidersetvalue}
351
eaaa6a06 352\func{void}{SetValue}{\param{int}{ value}}
a660d684
KB
353
354Sets 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