1 \section{\class{wxSlider
}}\label{wxslider
}
3 A slider is a control with a handle which can be pulled
4 back and forth to change the value.
6 On Windows, the track bar control is used.
8 Slider events are handled in the same way as a scrollbar.
10 \wxheading{Derived from
}
12 \helpref{wxControl
}{wxcontrol
}\\
13 \helpref{wxWindow
}{wxwindow
}\\
14 \helpref{wxEvtHandler
}{wxevthandler
}\\
15 \helpref{wxObject
}{wxobject
}
17 \wxheading{Include files
}
23 \helpref{wxCore
}{librarieslist
}
25 \wxheading{Window styles
}
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.
}
41 See also
\helpref{window styles overview
}{windowstyles
}.
47 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxScrollBar
}{wxscrollbar
}
49 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxSlider::wxSlider
}\label{wxsliderctor
}
53 \func{}{wxSlider
}{\void}
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"
}}
64 Constructor, creating and showing a slider.
66 \wxheading{Parameters
}
68 \docparam{parent
}{Parent window. Must not be NULL.
}
70 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
72 \docparam{value
}{Initial position for the slider.
}
74 \docparam{minValue
}{Minimum slider position.
}
76 \docparam{maxValue
}{Maximum slider position.
}
78 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
80 \docparam{style
}{Window style. See
\helpref{wxSlider
}{wxslider
}.
}
82 \docparam{validator
}{Window validator.
}
84 \docparam{name
}{Window name.
}
88 \helpref{wxSlider::Create
}{wxslidercreate
},
\helpref{wxValidator
}{wxvalidator
}
90 \membersection{wxSlider::
\destruct{wxSlider
}}\label{wxsliderdtor
}
92 \func{void
}{\destruct{wxSlider
}}{\void}
94 Destructor, destroying the slider.
96 \membersection{wxSlider::ClearSel
}\label{wxsliderclearsel
}
98 \func{void
}{ClearSel
}{\void}
100 Clears the selection, for a slider with the
{\bf wxSL
\_SELRANGE} style.
106 \membersection{wxSlider::ClearTicks
}\label{wxsliderclearticks
}
108 \func{void
}{ClearTicks
}{\void}
116 \membersection{wxSlider::Create
}\label{wxslidercreate
}
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"
}}
125 Used for two-step slider construction. See
\helpref{wxSlider::wxSlider
}{wxsliderctor
}\rtfsp
128 \membersection{wxSlider::GetLineSize
}\label{wxslidergetlinesize
}
130 \constfunc{int
}{GetLineSize
}{\void}
132 Returns the line size.
136 \helpref{wxSlider::SetLineSize
}{wxslidersetlinesize
}
138 \membersection{wxSlider::GetMax
}\label{wxslidergetmax
}
140 \constfunc{int
}{GetMax
}{\void}
142 Gets the maximum slider value.
146 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
148 \membersection{wxSlider::GetMin
}\label{wxslidergetmin
}
150 \constfunc{int
}{GetMin
}{\void}
152 Gets the minimum slider value.
156 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
158 \membersection{wxSlider::GetPageSize
}\label{wxslidergetpagesize
}
160 \constfunc{int
}{GetPageSize
}{\void}
162 Returns the page size.
166 \helpref{wxSlider::SetPageSize
}{wxslidersetpagesize
}
168 \membersection{wxSlider::GetSelEnd
}\label{wxslidergetselend
}
170 \constfunc{int
}{GetSelEnd
}{\void}
172 Returns the selection end point.
180 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
182 \membersection{wxSlider::GetSelStart
}\label{wxslidergetselstart
}
184 \constfunc{int
}{GetSelStart
}{\void}
186 Returns the selection start point.
194 \helpref{wxSlider::GetSelEnd
}{wxslidergetselend
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
196 \membersection{wxSlider::GetThumbLength
}\label{wxslidergetthumblength
}
198 \constfunc{int
}{GetThumbLength
}{\void}
200 Returns the thumb length.
208 \helpref{wxSlider::SetThumbLength
}{wxslidersetthumblength
}
210 \membersection{wxSlider::GetTickFreq
}\label{wxslidergettickfreq
}
212 \constfunc{int
}{GetTickFreq
}{\void}
214 Returns the tick frequency.
222 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
224 \membersection{wxSlider::GetValue
}\label{wxslidergetvalue
}
226 \constfunc{int
}{GetValue
}{\void}
228 Gets the current slider value.
232 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
},
\rtfsp
233 \helpref{wxSlider::SetValue
}{wxslidersetvalue
}
235 \membersection{wxSlider::SetLineSize
}\label{wxslidersetlinesize
}
237 \func{void
}{SetLineSize
}{\param{int
}{lineSize
}}
239 Sets the line size for the slider.
241 \wxheading{Parameters
}
243 \docparam{lineSize
}{The number of steps the slider moves when the user moves it up or down a line.
}
247 \helpref{wxSlider::GetLineSize
}{wxslidergetlinesize
}
249 \membersection{wxSlider::SetPageSize
}\label{wxslidersetpagesize
}
251 \func{void
}{SetPageSize
}{\param{int
}{pageSize
}}
253 Sets the page size for the slider.
255 \wxheading{Parameters
}
257 \docparam{pageSize
}{The number of steps the slider moves when the user pages up or down.
}
261 \helpref{wxSlider::GetPageSize
}{wxslidergetpagesize
}
263 \membersection{wxSlider::SetRange
}\label{wxslidersetrange
}
265 \func{void
}{SetRange
}{\param{int
}{ minValue
},
\param{int
}{ maxValue
}}
267 Sets the minimum and maximum slider values.
271 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
}
273 \membersection{wxSlider::SetSelection
}\label{wxslidersetselection
}
275 \func{void
}{SetSelection
}{\param{int
}{startPos
},
\param{int
}{endPos
}}
279 \wxheading{Parameters
}
281 \docparam{startPos
}{The selection start position.
}
283 \docparam{endPos
}{The selection end position.
}
291 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::GetSelEnd
}{wxslidergetselend
}
293 \membersection{wxSlider::SetThumbLength
}\label{wxslidersetthumblength
}
295 \func{void
}{SetThumbLength
}{\param{int
}{len
}}
297 Sets the slider thumb length.
299 \wxheading{Parameters
}
301 \docparam{len
}{The thumb length.
}
309 \helpref{wxSlider::GetThumbLength
}{wxslidergetthumblength
}
311 \membersection{wxSlider::SetTick
}\label{wxslidersettick
}
313 \func{void
}{SetTick
}{\param{int
}{ tickPos
}}
315 Sets a tick position.
317 \wxheading{Parameters
}
319 \docparam{tickPos
}{The tick position.
}
327 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
329 \membersection{wxSlider::SetTickFreq
}\label{wxslidersettickfreq
}
331 \func{void
}{SetTickFreq
}{\param{int
}{n
},
\param{int
}{pos
}}
333 Sets the tick mark frequency and position.
335 \wxheading{Parameters
}
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.
}
340 \docparam{pos
}{Position. Must be greater than zero. TODO: what is this for?
}
348 \helpref{wxSlider::GetTickFreq
}{wxslidergettickfreq
}
350 \membersection{wxSlider::SetValue
}\label{wxslidersetvalue
}
352 \func{void
}{SetValue
}{\param{int
}{ value
}}
354 Sets the slider position.
356 \wxheading{Parameters
}
358 \docparam{value
}{The slider position.
}
362 \helpref{wxSlider::GetValue
}{wxslidergetvalue
}