]>
git.saurik.com Git - wxWidgets.git/blob - interface/slider.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxSlider class
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).
23 @style{wxSL_VERTICAL}:
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).
37 @style{wxSL_SELRANGE}:
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}
49 @ref overview_eventhandlingoverview "Event handling overview", wxScrollBar
51 class wxSlider
: public wxControl
56 Constructor, creating and showing a slider.
59 Parent window. Must not be @NULL.
62 Window identifier. The value wxID_ANY indicates a default value.
65 Initial position for the slider.
68 Minimum slider position.
71 Maximum slider position.
74 Window size. If wxDefaultSize is specified then a default size is
78 Window style. See wxSlider.
86 @sa Create(), wxValidator
89 wxSlider(wxWindow
* parent
, wxWindowID id
, int value
,
90 int minValue
, int maxValue
,
91 const wxPoint
& point
= wxDefaultPosition
,
92 const wxSize
& size
= wxDefaultSize
,
93 long style
= wxSL_HORIZONTAL
,
94 const wxValidator
& validator
= wxDefaultValidator
,
95 const wxString
& name
= "slider");
99 Destructor, destroying the slider.
104 Clears the selection, for a slider with the @b wxSL_SELRANGE style.
106 @remarks Windows 95 only.
113 @remarks Windows 95 only.
118 Used for two-step slider construction. See wxSlider()
121 bool Create(wxWindow
* parent
, wxWindowID id
, int value
,
122 int minValue
, int maxValue
,
123 const wxPoint
& point
= wxDefaultPosition
,
124 const wxSize
& size
= wxDefaultSize
,
125 long style
= wxSL_HORIZONTAL
,
126 const wxValidator
& validator
= wxDefaultValidator
,
127 const wxString
& name
= "slider");
130 Returns the line size.
137 Gets the maximum slider value.
139 @sa GetMin(), SetRange()
144 Gets the minimum slider value.
146 @sa GetMin(), SetRange()
151 Returns the page size.
158 Returns the selection end point.
160 @remarks Windows 95 only.
162 @sa GetSelStart(), SetSelection()
167 Returns the selection start point.
169 @remarks Windows 95 only.
171 @sa GetSelEnd(), SetSelection()
176 Returns the thumb length.
178 @remarks Windows 95 only.
182 int GetThumbLength();
185 Returns the tick frequency.
187 @remarks Windows 95 only.
194 Gets the current slider value.
196 @sa GetMin(), GetMax(), SetValue()
201 Sets the line size for the slider.
204 The number of steps the slider moves when the user moves it up or down a line.
208 void SetLineSize(int lineSize
);
211 Sets the page size for the slider.
214 The number of steps the slider moves when the user pages up or down.
218 void SetPageSize(int pageSize
);
221 Sets the minimum and maximum slider values.
223 @sa GetMin(), GetMax()
225 void SetRange(int minValue
, int maxValue
);
231 The selection start position.
234 The selection end position.
236 @remarks Windows 95 only.
238 @sa GetSelStart(), GetSelEnd()
240 void SetSelection(int startPos
, int endPos
);
243 Sets the slider thumb length.
248 @remarks Windows 95 only.
252 void SetThumbLength(int len
);
255 Sets a tick position.
260 @remarks Windows 95 only.
264 void SetTick(int tickPos
);
267 Sets the tick mark frequency and position.
270 Frequency. For example, if the frequency is set to two, a tick mark is
272 every other increment in the slider's range.
275 Position. Must be greater than zero. TODO: what is this for?
277 @remarks Windows 95 only.
281 void SetTickFreq(int n
, int pos
);
284 Sets the slider position.
289 void SetValue(int value
);