]>
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
55 Constructor, creating and showing a slider.
58 Parent window. Must not be @NULL.
60 Window identifier. The value wxID_ANY indicates a default value.
62 Initial position for the slider.
64 Minimum slider position.
66 Maximum slider position.
68 Window size. If wxDefaultSize is specified then a default size
71 Window style. See wxSlider.
77 @see Create(), wxValidator
80 wxSlider(wxWindow
* parent
, wxWindowID id
, int value
,
81 int minValue
, int maxValue
,
82 const wxPoint
& point
= wxDefaultPosition
,
83 const wxSize
& size
= wxDefaultSize
,
84 long style
= wxSL_HORIZONTAL
,
85 const wxValidator
& validator
= wxDefaultValidator
,
86 const wxString
& name
= "slider");
90 Destructor, destroying the slider.
95 Clears the selection, for a slider with the @b wxSL_SELRANGE style.
97 @remarks Windows 95 only.
104 @remarks Windows 95 only.
109 Used for two-step slider construction. See wxSlider()
112 bool Create(wxWindow
* parent
, wxWindowID id
, int value
,
113 int minValue
, int maxValue
,
114 const wxPoint
& point
= wxDefaultPosition
,
115 const wxSize
& size
= wxDefaultSize
,
116 long style
= wxSL_HORIZONTAL
,
117 const wxValidator
& validator
= wxDefaultValidator
,
118 const wxString
& name
= "slider");
121 Returns the line size.
125 int GetLineSize() const;
128 Gets the maximum slider value.
130 @see GetMin(), SetRange()
135 Gets the minimum slider value.
137 @see GetMin(), SetRange()
142 Returns the page size.
146 int GetPageSize() const;
149 Returns the selection end point.
151 @remarks Windows 95 only.
153 @see GetSelStart(), SetSelection()
155 int GetSelEnd() const;
158 Returns the selection start point.
160 @remarks Windows 95 only.
162 @see GetSelEnd(), SetSelection()
164 int GetSelStart() const;
167 Returns the thumb length.
169 @remarks Windows 95 only.
171 @see SetThumbLength()
173 int GetThumbLength() const;
176 Returns the tick frequency.
178 @remarks Windows 95 only.
182 int GetTickFreq() const;
185 Gets the current slider value.
187 @see GetMin(), GetMax(), SetValue()
189 int GetValue() const;
192 Sets the line size for the slider.
195 The number of steps the slider moves when the user moves it up or down a
200 void SetLineSize(int lineSize
);
203 Sets the page size for the slider.
206 The number of steps the slider moves when the user pages up or down.
210 void SetPageSize(int pageSize
);
213 Sets the minimum and maximum slider values.
215 @see GetMin(), GetMax()
217 void SetRange(int minValue
, int maxValue
);
223 The selection start position.
225 The selection end position.
227 @remarks Windows 95 only.
229 @see GetSelStart(), GetSelEnd()
231 void SetSelection(int startPos
, int endPos
);
234 Sets the slider thumb length.
239 @remarks Windows 95 only.
241 @see GetThumbLength()
243 void SetThumbLength(int len
);
246 Sets a tick position.
251 @remarks Windows 95 only.
255 void SetTick(int tickPos
);
258 Sets the tick mark frequency and position.
261 Frequency. For example, if the frequency is set to two, a tick mark is
263 every other increment in the slider's range.
265 Position. Must be greater than zero. TODO: what is this for?
267 @remarks Windows 95 only.
271 void SetTickFreq(int n
, int pos
);
274 Sets the slider position.
279 void SetValue(int value
);