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
}
21 \wxheading{Window styles
}
24 \begin{twocollist
}\itemsep=
0pt
25 \twocolitem{\windowstyle{wxSL
\_HORIZONTAL}}{Displays the slider horizontally (this is the default).
}
26 \twocolitem{\windowstyle{wxSL
\_VERTICAL}}{Displays the slider vertically.
}
27 \twocolitem{\windowstyle{wxSL
\_AUTOTICKS}}{Displays tick marks.
}
28 \twocolitem{\windowstyle{wxSL
\_LABELS}}{Displays minimum, maximum and value labels.
}
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).
}
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.
}
37 See also
\helpref{window styles overview
}{windowstyles
}.
43 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxScrollBar
}{wxscrollbar
}
45 \latexignore{\rtfignore{\wxheading{Members
}}}
47 \membersection{wxSlider::wxSlider
}\label{wxsliderctor
}
49 \func{}{wxSlider
}{\void}
53 \func{}{wxSlider
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
54 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
55 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
56 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
57 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
58 \param{const wxString\&
}{name = ``slider"
}}
60 Constructor, creating and showing a slider.
62 \wxheading{Parameters
}
64 \docparam{parent
}{Parent window. Must not be NULL.
}
66 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
68 \docparam{value
}{Initial position for the slider.
}
70 \docparam{minValue
}{Minimum slider position.
}
72 \docparam{maxValue
}{Maximum slider position.
}
74 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
76 \docparam{style
}{Window style. See
\helpref{wxSlider
}{wxslider
}.
}
78 \docparam{validator
}{Window validator.
}
80 \docparam{name
}{Window name.
}
84 \helpref{wxSlider::Create
}{wxslidercreate
},
\helpref{wxValidator
}{wxvalidator
}
86 \membersection{wxSlider::
\destruct{wxSlider
}}\label{wxsliderdtor
}
88 \func{void
}{\destruct{wxSlider
}}{\void}
90 Destructor, destroying the slider.
92 \membersection{wxSlider::ClearSel
}\label{wxsliderclearsel
}
94 \func{void
}{ClearSel
}{\void}
96 Clears the selection, for a slider with the
{\bf wxSL
\_SELRANGE} style.
102 \membersection{wxSlider::ClearTicks
}\label{wxsliderclearticks
}
104 \func{void
}{ClearTicks
}{\void}
112 \membersection{wxSlider::Create
}\label{wxslidercreate
}
114 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
115 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
116 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
117 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
118 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
119 \param{const wxString\&
}{name = ``slider"
}}
121 Used for two-step slider construction. See
\helpref{wxSlider::wxSlider
}{wxsliderctor
}\rtfsp
124 \membersection{wxSlider::GetLineSize
}\label{wxslidergetlinesize
}
126 \constfunc{int
}{GetLineSize
}{\void}
128 Returns the line size.
132 \helpref{wxSlider::SetLineSize
}{wxslidersetlinesize
}
134 \membersection{wxSlider::GetMax
}\label{wxslidergetmax
}
136 \constfunc{int
}{GetMax
}{\void}
138 Gets the maximum slider value.
142 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
144 \membersection{wxSlider::GetMin
}\label{wxslidergetmin
}
146 \constfunc{int
}{GetMin
}{\void}
148 Gets the minimum slider value.
152 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
154 \membersection{wxSlider::GetPageSize
}\label{wxslidergetpagesize
}
156 \constfunc{int
}{GetPageSize
}{\void}
158 Returns the page size.
162 \helpref{wxSlider::SetPageSize
}{wxslidersetpagesize
}
164 \membersection{wxSlider::GetSelEnd
}\label{wxslidergetselend
}
166 \constfunc{int
}{GetSelEnd
}{\void}
168 Returns the selection end point.
176 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
178 \membersection{wxSlider::GetSelStart
}\label{wxslidergetselstart
}
180 \constfunc{int
}{GetSelStart
}{\void}
182 Returns the selection start point.
190 \helpref{wxSlider::GetSelEnd
}{wxslidergetselend
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
192 \membersection{wxSlider::GetThumbLength
}\label{wxslidergetthumblength
}
194 \constfunc{int
}{GetThumbLength
}{\void}
196 Returns the thumb length.
204 \helpref{wxSlider::SetThumbLength
}{wxslidersetthumblength
}
206 \membersection{wxSlider::GetTickFreq
}\label{wxslidergettickfreq
}
208 \constfunc{int
}{GetTickFreq
}{\void}
210 Returns the tick frequency.
218 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
220 \membersection{wxSlider::GetValue
}\label{wxslidergetvalue
}
222 \constfunc{int
}{GetValue
}{\void}
224 Gets the current slider value.
228 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
},
\rtfsp
229 \helpref{wxSlider::SetValue
}{wxslidersetvalue
}
231 \membersection{wxSlider::SetLineSize
}\label{wxslidersetlinesize
}
233 \func{void
}{SetLineSize
}{\param{int
}{lineSize
}}
235 Sets the line size for the slider.
237 \wxheading{Parameters
}
239 \docparam{lineSize
}{The number of steps the slider moves when the user moves it up or down a line.
}
243 \helpref{wxSlider::GetLineSize
}{wxslidergetlinesize
}
245 \membersection{wxSlider::SetPageSize
}\label{wxslidersetpagesize
}
247 \func{void
}{SetPageSize
}{\param{int
}{pageSize
}}
249 Sets the page size for the slider.
251 \wxheading{Parameters
}
253 \docparam{pageSize
}{The number of steps the slider moves when the user pages up or down.
}
257 \helpref{wxSlider::GetPageSize
}{wxslidergetpagesize
}
259 \membersection{wxSlider::SetRange
}\label{wxslidersetrange
}
261 \func{void
}{SetRange
}{\param{int
}{ minValue
},
\param{int
}{ maxValue
}}
263 Sets the minimum and maximum slider values.
267 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
}
269 \membersection{wxSlider::SetSelection
}\label{wxslidersetselection
}
271 \func{void
}{SetSelection
}{\param{int
}{startPos
},
\param{int
}{endPos
}}
275 \wxheading{Parameters
}
277 \docparam{startPos
}{The selection start position.
}
279 \docparam{endPos
}{The selection end position.
}
287 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::GetSelEnd
}{wxslidergetselend
}
289 \membersection{wxSlider::SetThumbLength
}\label{wxslidersetthumblength
}
291 \func{void
}{SetThumbLength
}{\param{int
}{len
}}
293 Sets the slider thumb length.
295 \wxheading{Parameters
}
297 \docparam{len
}{The thumb length.
}
305 \helpref{wxSlider::GetThumbLength
}{wxslidergetthumblength
}
307 \membersection{wxSlider::SetTick
}\label{wxslidersettick
}
309 \func{void
}{SetTick
}{\param{int
}{ tickPos
}}
311 Sets a tick position.
313 \wxheading{Parameters
}
315 \docparam{tickPos
}{The tick position.
}
323 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
325 \membersection{wxSlider::SetTickFreq
}\label{wxslidersettickfreq
}
327 \func{void
}{SetTickFreq
}{\param{int
}{n
},
\param{int
}{pos
}}
329 Sets the tick mark frequency and position.
331 \wxheading{Parameters
}
333 \docparam{n
}{Frequency. For example, if the frequency is set to two, a tick mark is displayed for
334 every other increment in the slider's range.
}
336 \docparam{pos
}{Position. Must be greater than zero. TODO: what is this for?
}
344 \helpref{wxSlider::GetTickFreq
}{wxslidergettickfreq
}
346 \membersection{wxSlider::SetValue
}\label{wxslidersetvalue
}
348 \func{void
}{SetValue
}{\param{int
}{ value
}}
350 Sets the slider position.
352 \wxheading{Parameters
}
354 \docparam{value
}{The slider position.
}
358 \helpref{wxSlider::GetValue
}{wxslidergetvalue
}