]>
git.saurik.com Git - wxWidgets.git/blob - interface/slider.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSlider
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A slider is a control with a handle which can be pulled
14 back and forth to change the value.
16 On Windows, the track bar control is used.
18 Slider events are handled in the same way as a scrollbar.
21 @style{wxSL_HORIZONTAL}
22 Displays the slider horizontally (this is the default).
24 Displays the slider vertically.
25 @style{wxSL_AUTOTICKS}
28 Displays minimum, maximum and value labels.
30 Displays ticks on the left and forces the slider to be vertical.
32 Displays ticks on the right and forces the slider to be vertical.
34 Displays ticks on the top.
36 Displays ticks on the bottom (this is the default).
38 Allows the user to select a range on the slider. Windows only.
40 Inverses the mininum and maximum endpoints on the slider. Not
41 compatible with wxSL_SELRANGE.
46 <!-- @appearance{slider.png} -->
48 @see @ref overview_eventhandlingoverview, wxScrollBar
50 class wxSlider
: public wxControl
59 Constructor, creating and showing a slider.
62 Parent window. Must not be @NULL.
64 Window identifier. The value wxID_ANY indicates a default value.
66 Initial position for the slider.
68 Minimum slider position.
70 Maximum slider position.
72 Window size. If wxDefaultSize is specified then a default size
75 Window style. See wxSlider.
81 @see Create(), wxValidator
83 wxSlider(wxWindow
* parent
, wxWindowID id
, int value
,
84 int minValue
, int maxValue
,
85 const wxPoint
& point
= wxDefaultPosition
,
86 const wxSize
& size
= wxDefaultSize
,
87 long style
= wxSL_HORIZONTAL
,
88 const wxValidator
& validator
= wxDefaultValidator
,
89 const wxString
& name
= "slider");
92 Destructor, destroying the slider.
97 Clears the selection, for a slider with the @b wxSL_SELRANGE style.
99 @remarks Windows 95 only.
106 @remarks Windows 95 only.
111 Used for two-step slider construction. See wxSlider()
114 bool Create(wxWindow
* parent
, wxWindowID id
, int value
,
115 int minValue
, int maxValue
,
116 const wxPoint
& point
= wxDefaultPosition
,
117 const wxSize
& size
= wxDefaultSize
,
118 long style
= wxSL_HORIZONTAL
,
119 const wxValidator
& validator
= wxDefaultValidator
,
120 const wxString
& name
= "slider");
123 Returns the line size.
127 int GetLineSize() const;
130 Gets the maximum slider value.
132 @see GetMin(), SetRange()
137 Gets the minimum slider value.
139 @see GetMin(), SetRange()
144 Returns the page size.
148 int GetPageSize() const;
151 Returns the selection end point.
153 @remarks Windows 95 only.
155 @see GetSelStart(), SetSelection()
157 int GetSelEnd() const;
160 Returns the selection start point.
162 @remarks Windows 95 only.
164 @see GetSelEnd(), SetSelection()
166 int GetSelStart() const;
169 Returns the thumb length.
171 @remarks Windows 95 only.
173 @see SetThumbLength()
175 int GetThumbLength() const;
178 Returns the tick frequency.
180 @remarks Windows 95 only.
184 int GetTickFreq() const;
187 Gets the current slider value.
189 @see GetMin(), GetMax(), SetValue()
191 int GetValue() const;
194 Sets the line size for the slider.
197 The number of steps the slider moves when the user moves it up or down a
202 void SetLineSize(int lineSize
);
205 Sets the page size for the slider.
208 The number of steps the slider moves when the user pages up or down.
212 void SetPageSize(int pageSize
);
215 Sets the minimum and maximum slider values.
217 @see GetMin(), GetMax()
219 void SetRange(int minValue
, int maxValue
);
225 The selection start position.
227 The selection end position.
229 @remarks Windows 95 only.
231 @see GetSelStart(), GetSelEnd()
233 void SetSelection(int startPos
, int endPos
);
236 Sets the slider thumb length.
241 @remarks Windows 95 only.
243 @see GetThumbLength()
245 void SetThumbLength(int len
);
248 Sets a tick position.
253 @remarks Windows 95 only.
257 void SetTick(int tickPos
);
260 Sets the tick mark frequency and position.
263 Frequency. For example, if the frequency is set to two, a tick mark is
265 every other increment in the slider's range.
267 Position. Must be greater than zero. TODO: what is this for?
269 @remarks Windows 95 only.
273 void SetTickFreq(int n
, int pos
);
276 Sets the slider position.
281 void SetValue(int value
);