]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/slider.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxSlider
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 A slider is a control with a handle which can be pulled
13 back and forth to change the value.
15 On Windows, the track bar control is used.
17 Slider events are handled in the same way as a scrollbar.
20 @style{wxSL_HORIZONTAL}
21 Displays the slider horizontally (this is the default).
23 Displays the slider vertically.
24 @style{wxSL_AUTOTICKS}
27 Displays minimum, maximum and value labels.
29 Displays ticks on the left and forces the slider to be vertical.
31 Displays ticks on the right and forces the slider to be vertical.
33 Displays ticks on the top.
35 Displays ticks on the bottom (this is the default).
37 Allows the user to select a range on the slider. Windows only.
39 Inverses the mininum and maximum endpoints on the slider. Not
40 compatible with wxSL_SELRANGE.
45 <!-- @appearance{slider.png} -->
47 @see @ref overview_eventhandlingoverview, wxScrollBar
49 class wxSlider
: public wxControl
58 Constructor, creating and showing a slider.
61 Parent window. Must not be @NULL.
63 Window identifier. The value wxID_ANY indicates a default value.
65 Initial position for the slider.
67 Minimum slider position.
69 Maximum slider position.
71 Window size. If wxDefaultSize is specified then a default size
74 Window style. See wxSlider.
80 @see Create(), wxValidator
82 wxSlider(wxWindow
* parent
, wxWindowID id
, int value
,
83 int minValue
, int maxValue
,
84 const wxPoint
& point
= wxDefaultPosition
,
85 const wxSize
& size
= wxDefaultSize
,
86 long style
= wxSL_HORIZONTAL
,
87 const wxValidator
& validator
= wxDefaultValidator
,
88 const wxString
& name
= "slider");
91 Destructor, destroying the slider.
96 Clears the selection, for a slider with the @b wxSL_SELRANGE style.
98 @remarks Windows 95 only.
105 @remarks Windows 95 only.
110 Used for two-step slider construction. See wxSlider()
113 bool Create(wxWindow
* parent
, wxWindowID id
, int value
,
114 int minValue
, int maxValue
,
115 const wxPoint
& point
= wxDefaultPosition
,
116 const wxSize
& size
= wxDefaultSize
,
117 long style
= wxSL_HORIZONTAL
,
118 const wxValidator
& validator
= wxDefaultValidator
,
119 const wxString
& name
= "slider");
122 Returns the line size.
126 int GetLineSize() const;
129 Gets the maximum slider value.
131 @see GetMin(), SetRange()
136 Gets the minimum slider value.
138 @see GetMin(), SetRange()
143 Returns the page size.
147 int GetPageSize() const;
150 Returns the selection end point.
152 @remarks Windows 95 only.
154 @see GetSelStart(), SetSelection()
156 int GetSelEnd() const;
159 Returns the selection start point.
161 @remarks Windows 95 only.
163 @see GetSelEnd(), SetSelection()
165 int GetSelStart() const;
168 Returns the thumb length.
170 @remarks Windows 95 only.
172 @see SetThumbLength()
174 int GetThumbLength() const;
177 Returns the tick frequency.
179 @remarks Windows 95 only.
183 int GetTickFreq() const;
186 Gets the current slider value.
188 @see GetMin(), GetMax(), SetValue()
190 int GetValue() const;
193 Sets the line size for the slider.
196 The number of steps the slider moves when the user moves it up or down a
201 void SetLineSize(int lineSize
);
204 Sets the page size for the slider.
207 The number of steps the slider moves when the user pages up or down.
211 void SetPageSize(int pageSize
);
214 Sets the minimum and maximum slider values.
216 @see GetMin(), GetMax()
218 void SetRange(int minValue
, int maxValue
);
224 The selection start position.
226 The selection end position.
228 @remarks Windows 95 only.
230 @see GetSelStart(), GetSelEnd()
232 void SetSelection(int startPos
, int endPos
);
235 Sets the slider thumb length.
240 @remarks Windows 95 only.
242 @see GetThumbLength()
244 void SetThumbLength(int len
);
247 Sets a tick position.
252 @remarks Windows 95 only.
256 void SetTick(int tickPos
);
259 Sets the tick mark frequency and position.
262 Frequency. For example, if the frequency is set to two, a tick mark is
264 every other increment in the slider's range.
266 Position. Must be greater than zero. TODO: what is this for?
268 @remarks Windows 95 only.
272 void SetTickFreq(int n
, int pos
);
275 Sets the slider position.
280 void SetValue(int value
);