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