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.
}
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 (NB: only displays the current value label under wxGTK)
}
30 \twocolitem{\windowstyle{wxSL
\_LEFT}}{Displays ticks on the left, if a vertical slider.
}
31 \twocolitem{\windowstyle{wxSL
\_RIGHT}}{Displays ticks on the right, if a vertical slider.
}
32 \twocolitem{\windowstyle{wxSL
\_TOP}}{Displays ticks on the top, if a horizontal slider.
}
33 \twocolitem{\windowstyle{wxSL
\_SELRANGE}}{Allows the user to select a range on the slider. Windows
95 only.
}
34 \twocolitem{\windowstyle{wxSL
\_INVERSE}}{Inverses the mininum and maximum endpoints on the slider. Not compatible with wxSL
\_SELRANGE.
}\end{twocollist
}
36 See also
\helpref{window styles overview
}{windowstyles
}.
42 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxScrollBar
}{wxscrollbar
}
44 \latexignore{\rtfignore{\wxheading{Members
}}}
46 \membersection{wxSlider::wxSlider
}\label{wxsliderctor
}
48 \func{}{wxSlider
}{\void}
52 \func{}{wxSlider
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
53 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
54 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
55 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
56 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
57 \param{const wxString\&
}{name = ``slider"
}}
59 Constructor, creating and showing a slider.
61 \wxheading{Parameters
}
63 \docparam{parent
}{Parent window. Must not be NULL.
}
65 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
67 \docparam{value
}{Initial position for the slider.
}
69 \docparam{minValue
}{Minimum slider position.
}
71 \docparam{maxValue
}{Maximum slider position.
}
73 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
75 \docparam{style
}{Window style. See
\helpref{wxSlider
}{wxslider
}.
}
77 \docparam{validator
}{Window validator.
}
79 \docparam{name
}{Window name.
}
83 \helpref{wxSlider::Create
}{wxslidercreate
},
\helpref{wxValidator
}{wxvalidator
}
85 \membersection{wxSlider::
\destruct{wxSlider
}}\label{wxsliderdtor
}
87 \func{void
}{\destruct{wxSlider
}}{\void}
89 Destructor, destroying the slider.
91 \membersection{wxSlider::ClearSel
}\label{wxsliderclearsel
}
93 \func{void
}{ClearSel
}{\void}
95 Clears the selection, for a slider with the
{\bf wxSL
\_SELRANGE} style.
101 \membersection{wxSlider::ClearTicks
}\label{wxsliderclearticks
}
103 \func{void
}{ClearTicks
}{\void}
111 \membersection{wxSlider::Create
}\label{wxslidercreate
}
113 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
114 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
115 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
116 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
117 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
118 \param{const wxString\&
}{name = ``slider"
}}
120 Used for two-step slider construction. See
\helpref{wxSlider::wxSlider
}{wxsliderctor
}\rtfsp
123 \membersection{wxSlider::GetLineSize
}\label{wxslidergetlinesize
}
125 \constfunc{int
}{GetLineSize
}{\void}
127 Returns the line size.
131 \helpref{wxSlider::SetLineSize
}{wxslidersetlinesize
}
133 \membersection{wxSlider::GetMax
}\label{wxslidergetmax
}
135 \constfunc{int
}{GetMax
}{\void}
137 Gets the maximum slider value.
141 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
143 \membersection{wxSlider::GetMin
}\label{wxslidergetmin
}
145 \constfunc{int
}{GetMin
}{\void}
147 Gets the minimum slider value.
151 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
153 \membersection{wxSlider::GetPageSize
}\label{wxslidergetpagesize
}
155 \constfunc{int
}{GetPageSize
}{\void}
157 Returns the page size.
161 \helpref{wxSlider::SetPageSize
}{wxslidersetpagesize
}
163 \membersection{wxSlider::GetSelEnd
}\label{wxslidergetselend
}
165 \constfunc{int
}{GetSelEnd
}{\void}
167 Returns the selection end point.
175 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
177 \membersection{wxSlider::GetSelStart
}\label{wxslidergetselstart
}
179 \constfunc{int
}{GetSelStart
}{\void}
181 Returns the selection start point.
189 \helpref{wxSlider::GetSelEnd
}{wxslidergetselend
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
191 \membersection{wxSlider::GetThumbLength
}\label{wxslidergetthumblength
}
193 \constfunc{int
}{GetThumbLength
}{\void}
195 Returns the thumb length.
203 \helpref{wxSlider::SetThumbLength
}{wxslidersetthumblength
}
205 \membersection{wxSlider::GetTickFreq
}\label{wxslidergettickfreq
}
207 \constfunc{int
}{GetTickFreq
}{\void}
209 Returns the tick frequency.
217 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
219 \membersection{wxSlider::GetValue
}\label{wxslidergetvalue
}
221 \constfunc{int
}{GetValue
}{\void}
223 Gets the current slider value.
227 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
},
\rtfsp
228 \helpref{wxSlider::SetValue
}{wxslidersetvalue
}
230 \membersection{wxSlider::SetRange
}\label{wxslidersetrange
}
232 \func{void
}{SetRange
}{\param{int
}{ minValue
},
\param{int
}{ maxValue
}}
234 Sets the minimum and maximum slider values.
238 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
}
240 \membersection{wxSlider::SetTickFreq
}\label{wxslidersettickfreq
}
242 \func{void
}{SetTickFreq
}{\param{int
}{n
},
\param{int
}{pos
}}
244 Sets the tick mark frequency and position.
246 \wxheading{Parameters
}
248 \docparam{n
}{Frequency. For example, if the frequency is set to two, a tick mark is displayed for
249 every other increment in the slider's range.
}
251 \docparam{pos
}{Position. Must be greater than zero. TODO: what is this for?
}
259 \helpref{wxSlider::GetTickFreq
}{wxslidergettickfreq
}
261 \membersection{wxSlider::SetLineSize
}\label{wxslidersetlinesize
}
263 \func{void
}{SetLineSize
}{\param{int
}{lineSize
}}
265 Sets the line size for the slider.
267 \wxheading{Parameters
}
269 \docparam{lineSize
}{The number of steps the slider moves when the user moves it up or down a line.
}
273 \helpref{wxSlider::GetLineSize
}{wxslidergetlinesize
}
275 \membersection{wxSlider::SetPageSize
}\label{wxslidersetpagesize
}
277 \func{void
}{SetPageSize
}{\param{int
}{pageSize
}}
279 Sets the page size for the slider.
281 \wxheading{Parameters
}
283 \docparam{pageSize
}{The number of steps the slider moves when the user pages up or down.
}
287 \helpref{wxSlider::GetPageSize
}{wxslidergetpagesize
}
289 \membersection{wxSlider::SetSelection
}\label{wxslidersetselection
}
291 \func{void
}{SetSelection
}{\param{int
}{startPos
},
\param{int
}{endPos
}}
295 \wxheading{Parameters
}
297 \docparam{startPos
}{The selection start position.
}
299 \docparam{endPos
}{The selection end position.
}
307 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::GetSelEnd
}{wxslidergetselend
}
309 \membersection{wxSlider::SetThumbLength
}\label{wxslidersetthumblength
}
311 \func{void
}{SetThumbLength
}{\param{int
}{len
}}
313 Sets the slider thumb length.
315 \wxheading{Parameters
}
317 \docparam{len
}{The thumb length.
}
325 \helpref{wxSlider::GetThumbLength
}{wxslidergetthumblength
}
327 \membersection{wxSlider::SetTick
}\label{wxslidersettick
}
329 \func{void
}{SetTick
}{\param{int
}{ tickPos
}}
331 Sets a tick position.
333 \wxheading{Parameters
}
335 \docparam{tickPos
}{The tick position.
}
343 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
345 \membersection{wxSlider::SetValue
}\label{wxslidersetvalue
}
347 \func{void
}{SetValue
}{\param{int
}{ value
}}
349 Sets the slider position.
351 \wxheading{Parameters
}
353 \docparam{value
}{The slider position.
}
357 \helpref{wxSlider::GetValue
}{wxslidergetvalue
}