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 In Windows versions below Windows
95, a scrollbar is used to simulate the slider. In Windows
95,
7 the track bar control is used.
9 Slider events are handled in the same way as a scrollbar.
11 \wxheading{Derived from
}
13 \helpref{wxControl
}{wxcontrol
}\\
14 \helpref{wxWindow
}{wxwindow
}\\
15 \helpref{wxEvtHandler
}{wxevthandler
}\\
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Window styles
}
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.
}
32 See also
\helpref{window styles overview
}{windowstyles
}.
36 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxScrollBar
}{wxscrollbar
}
38 \latexignore{\rtfignore{\wxheading{Members
}}}
40 \membersection{wxSlider::wxSlider
}\label{wxsliderconstr
}
42 \func{}{wxSlider
}{\void}
46 \func{}{wxSlider
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
47 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
48 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
49 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
50 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
51 \param{const wxString\&
}{name = ``slider"
}}
53 Constructor, creating and showing a slider.
55 \wxheading{Parameters
}
57 \docparam{parent
}{Parent window. Must not be NULL.
}
59 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
61 \docparam{value
}{Initial position for the slider.
}
63 \docparam{minValue
}{Minimum slider position.
}
65 \docparam{maxValue
}{Maximum slider position.
}
67 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
69 \docparam{style
}{Window style. See
\helpref{wxSlider
}{wxslider
}.
}
71 \docparam{validator
}{Window validator.
}
73 \docparam{name
}{Window name.
}
77 \helpref{wxSlider::Create
}{wxslidercreate
},
\helpref{wxValidator
}{wxvalidator
}
79 \membersection{wxSlider::
\destruct{wxSlider
}}
81 \func{void
}{\destruct{wxSlider
}}{\void}
83 Destructor, destroying the slider.
85 \membersection{wxSlider::ClearSel
}\label{wxsliderclearsel
}
87 \func{void
}{ClearSel
}{\void}
89 Clears the selection, for a slider with the
{\bf wxSL
\_SELRANGE} style.
95 \membersection{wxSlider::ClearTicks
}\label{wxsliderclearticks
}
97 \func{void
}{ClearTicks
}{\void}
105 \membersection{wxSlider::Create
}\label{wxslidercreate
}
107 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{int
}{value
},
\rtfsp
108 \param{int
}{ minValue
},
\param{int
}{ maxValue
},
\rtfsp
109 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
110 \param{long
}{ style = wxSL
\_HORIZONTAL},
\rtfsp
111 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
112 \param{const wxString\&
}{name = ``slider"
}}
114 Used for two-step slider construction. See
\helpref{wxSlider::wxSlider
}{wxsliderconstr
}\rtfsp
117 \membersection{wxSlider::GetLineSize
}\label{wxslidergetlinesize
}
119 \constfunc{int
}{GetLineSize
}{\void}
121 Returns the line size.
125 \helpref{wxSlider::SetLineSize
}{wxslidersetlinesize
}
127 \membersection{wxSlider::GetMax
}\label{wxslidergetmax
}
129 \constfunc{int
}{GetMax
}{\void}
131 Gets the maximum slider value.
135 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
137 \membersection{wxSlider::GetMin
}\label{wxslidergetmin
}
139 \constfunc{int
}{GetMin
}{\void}
141 Gets the minimum slider value.
145 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::SetRange
}{wxslidersetrange
}
147 \membersection{wxSlider::GetPageSize
}\label{wxslidergetpagesize
}
149 \constfunc{int
}{GetPageSize
}{\void}
151 Returns the page size.
155 \helpref{wxSlider::SetPageSize
}{wxslidersetpagesize
}
157 \membersection{wxSlider::GetSelEnd
}\label{wxslidergetselend
}
159 \constfunc{int
}{GetSelEnd
}{\void}
161 Returns the selection end point.
169 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
171 \membersection{wxSlider::GetSelStart
}\label{wxslidergetselstart
}
173 \constfunc{int
}{GetSelStart
}{\void}
175 Returns the selection start point.
183 \helpref{wxSlider::GetSelEnd
}{wxslidergetselend
},
\helpref{wxSlider::SetSelection
}{wxslidersetselection
}
185 \membersection{wxSlider::GetThumbLength
}\label{wxslidergetthumblength
}
187 \constfunc{int
}{GetThumbLength
}{\void}
189 Returns the thumb length.
197 \helpref{wxSlider::SetThumbLength
}{wxslidersetthumblength
}
199 \membersection{wxSlider::GetTickFreq
}\label{wxslidergettickfreq
}
201 \constfunc{int
}{GetTickFreq
}{\void}
203 Returns the tick frequency.
211 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
213 \membersection{wxSlider::GetValue
}\label{wxslidergetvalue
}
215 \constfunc{int
}{GetValue
}{\void}
217 Gets the current slider value.
221 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
},
\rtfsp
222 \helpref{wxSlider::SetValue
}{wxslidersetvalue
}
224 \membersection{wxSlider::SetRange
}\label{wxslidersetrange
}
226 \func{void
}{SetRange
}{\param{int
}{ minValue
},
\param{int
}{ maxValue
}}
228 Sets the minimum and maximum slider values.
232 \helpref{wxSlider::GetMin
}{wxslidergetmin
},
\helpref{wxSlider::GetMax
}{wxslidergetmax
}
234 \membersection{wxSlider::SetTickFreq
}\label{wxslidersettickfreq
}
236 \func{void
}{SetTickFreq
}{\param{int
}{n
},
\param{int
}{pos
}}
238 Sets the tick mark frequency and position.
240 \wxheading{Parameters
}
242 \docparam{n
}{Frequency. For example, if the frequency is set to two, a tick mark is displayed for
243 every other increment in the slider's range.
}
245 \docparam{pos
}{Position. Must be greater than zero. TODO: what is this for?
}
253 \helpref{wxSlider::GetTickFreq
}{wxslidergettickfreq
}
255 \membersection{wxSlider::SetLineSize
}\label{wxslidersetlinesize
}
257 \func{void
}{SetLineSize
}{\param{int
}{lineSize
}}
259 Sets the line size for the slider.
261 \wxheading{Parameters
}
263 \docparam{lineSize
}{The number of steps the slider moves when the user moves it up or down a line.
}
267 \helpref{wxSlider::GetLineSize
}{wxslidergetlinesize
}
269 \membersection{wxSlider::SetPageSize
}\label{wxslidersetpagesize
}
271 \func{void
}{SetPageSize
}{\param{int
}{pageSize
}}
273 Sets the page size for the slider.
275 \wxheading{Parameters
}
277 \docparam{pageSize
}{The number of steps the slider moves when the user pages up or down.
}
281 \helpref{wxSlider::GetPageSize
}{wxslidergetpagesize
}
283 \membersection{wxSlider::SetSelection
}\label{wxslidersetselection
}
285 \func{void
}{SetSelection
}{\param{int
}{startPos
},
\param{int
}{endPos
}}
289 \wxheading{Parameters
}
291 \docparam{startPos
}{The selection start position.
}
293 \docparam{endPos
}{The selection end position.
}
301 \helpref{wxSlider::GetSelStart
}{wxslidergetselstart
},
\helpref{wxSlider::GetSelEnd
}{wxslidergetselend
}
303 \membersection{wxSlider::SetThumbLength
}\label{wxslidersetthumblength
}
305 \func{void
}{SetThumbLength
}{\param{int
}{len
}}
307 Sets the slider thumb length.
309 \wxheading{Parameters
}
311 \docparam{len
}{The thumb length.
}
319 \helpref{wxSlider::GetThumbLength
}{wxslidergetthumblength
}
321 \membersection{wxSlider::SetTick
}\label{wxslidersettick
}
323 \func{void
}{SetTick
}{\param{int
}{ tickPos
}}
325 Sets a tick position.
327 \wxheading{Parameters
}
329 \docparam{tickPos
}{The tick position.
}
337 \helpref{wxSlider::SetTickFreq
}{wxslidersettickfreq
}
339 \membersection{wxSlider::SetValue
}\label{wxslidersetvalue
}
341 \func{void
}{SetValue
}{\param{int
}{ value
}}
343 Sets the slider position.
345 \wxheading{Parameters
}
347 \docparam{value
}{The slider position.
}
351 \helpref{wxSlider::GetValue
}{wxslidergetvalue
}