]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/slider.tex
Some manual updates; in MDI sample, child frames now have default size/position ...
[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
6In Windows versions below Windows 95, a scrollbar is used to simulate the slider. In Windows 95,
7the track bar control is used.
8
9Slider 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
32See 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
44Default slider.
45
eaaa6a06
JS
46\func{}{wxSlider}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
47\param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
a660d684 48\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 49\param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
a660d684
KB
50\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
51\param{const wxString\& }{name = ``slider"}}
52
53Constructor, 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
83Destructor, destroying the slider.
84
85\membersection{wxSlider::ClearSel}\label{wxsliderclearsel}
86
87\func{void}{ClearSel}{\void}
88
89Clears the selection, for a slider with the {\bf wxSL\_SELRANGE} style.
90
91\wxheading{Remarks}
92
93Windows 95 only.
94
95\membersection{wxSlider::ClearTicks}\label{wxsliderclearticks}
96
97\func{void}{ClearTicks}{\void}
98
99Clears the ticks.
100
101\wxheading{Remarks}
102
103Windows 95 only.
104
105\membersection{wxSlider::Create}\label{wxslidercreate}
106
eaaa6a06
JS
107\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{int }{value },\rtfsp
108\param{int}{ minValue}, \param{int}{ maxValue},\rtfsp
a660d684 109\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 110\param{long}{ style = wxSL\_HORIZONTAL},\rtfsp
a660d684
KB
111\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
112\param{const wxString\& }{name = ``slider"}}
113
114Used for two-step slider construction. See \helpref{wxSlider::wxSlider}{wxsliderconstr}\rtfsp
115for further details.
116
117\membersection{wxSlider::GetLineSize}\label{wxslidergetlinesize}
118
119\constfunc{int}{GetLineSize}{\void}
120
121Returns 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
131Gets 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
141Gets 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
151Returns 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
161Returns the selection end point.
162
163\wxheading{Remarks}
164
165Windows 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
175Returns the selection start point.
176
177\wxheading{Remarks}
178
179Windows 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
189Returns the thumb length.
190
191\wxheading{Remarks}
192
193Windows 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
203Returns the tick frequency.
204
205\wxheading{Remarks}
206
207Windows 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
217Gets 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
eaaa6a06 226\func{void}{SetRange}{\param{int}{ minValue}, \param{int}{ maxValue}}
a660d684
KB
227
228Sets 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
eaaa6a06 236\func{void}{SetTickFreq}{\param{int }{n}, \param{int }{pos}}
a660d684
KB
237
238Sets 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
243every 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
249Windows 95 only.
250
251\wxheading{See also}
252
253\helpref{wxSlider::GetTickFreq}{wxslidergettickfreq}
254
255\membersection{wxSlider::SetLineSize}\label{wxslidersetlinesize}
256
eaaa6a06 257\func{void}{SetLineSize}{\param{int }{lineSize}}
a660d684
KB
258
259Sets 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
eaaa6a06 271\func{void}{SetPageSize}{\param{int }{pageSize}}
a660d684
KB
272
273Sets 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
eaaa6a06 285\func{void}{SetSelection}{\param{int }{startPos}, \param{int }{endPos}}
a660d684
KB
286
287Sets 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
297Windows 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
eaaa6a06 305\func{void}{SetThumbLength}{\param{int }{len}}
a660d684
KB
306
307Sets the slider thumb length.
308
309\wxheading{Parameters}
310
311\docparam{len}{The thumb length.}
312
313\wxheading{Remarks}
314
315Windows 95 only.
316
317\wxheading{See also}
318
319\helpref{wxSlider::GetThumbLength}{wxslidergetthumblength}
320
321\membersection{wxSlider::SetTick}\label{wxslidersettick}
322
eaaa6a06 323\func{void}{SetTick}{\param{int}{ tickPos}}
a660d684
KB
324
325Sets a tick position.
326
327\wxheading{Parameters}
328
329\docparam{tickPos}{The tick position.}
330
331\wxheading{Remarks}
332
333Windows 95 only.
334
335\wxheading{See also}
336
337\helpref{wxSlider::SetTickFreq}{wxslidersettickfreq}
338
339\membersection{wxSlider::SetValue}\label{wxslidersetvalue}
340
eaaa6a06 341\func{void}{SetValue}{\param{int}{ value}}
a660d684
KB
342
343Sets 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