]> git.saurik.com Git - wxWidgets.git/blame - interface/slider.h
latex include not properly working for links and titlepage
[wxWidgets.git] / interface / slider.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: slider.h
3// Purpose: documentation for wxSlider class
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxSlider
11 @wxheader{slider.h}
7c913512 12
23324ae1
FM
13 A slider is a control with a handle which can be pulled
14 back and forth to change the value.
7c913512 15
23324ae1 16 On Windows, the track bar control is used.
7c913512 17
23324ae1 18 Slider events are handled in the same way as a scrollbar.
7c913512 19
23324ae1
FM
20 @beginStyleTable
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}:
26 Displays tick marks.
27 @style{wxSL_LABELS}:
28 Displays minimum, maximum and value labels.
29 @style{wxSL_LEFT}:
30 Displays ticks on the left and forces the slider to be vertical.
31 @style{wxSL_RIGHT}:
32 Displays ticks on the right and forces the slider to be vertical.
33 @style{wxSL_TOP}:
34 Displays ticks on the top.
35 @style{wxSL_BOTTOM}:
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.
39 @style{wxSL_INVERSE}:
40 Inverses the mininum and maximum endpoints on the slider. Not
41 compatible with wxSL_SELRANGE.
42 @endStyleTable
7c913512 43
23324ae1
FM
44 @library{wxcore}
45 @category{ctrl}
46 @appearance{slider.png}
7c913512 47
23324ae1
FM
48 @seealso
49 @ref overview_eventhandlingoverview "Event handling overview", wxScrollBar
50*/
51class wxSlider : public wxControl
52{
53public:
54 //@{
55 /**
56 Constructor, creating and showing a slider.
57
7c913512 58 @param parent
23324ae1
FM
59 Parent window. Must not be @NULL.
60
7c913512 61 @param id
23324ae1
FM
62 Window identifier. The value wxID_ANY indicates a default value.
63
7c913512 64 @param value
23324ae1
FM
65 Initial position for the slider.
66
7c913512 67 @param minValue
23324ae1
FM
68 Minimum slider position.
69
7c913512 70 @param maxValue
23324ae1
FM
71 Maximum slider position.
72
7c913512 73 @param size
23324ae1
FM
74 Window size. If wxDefaultSize is specified then a default size is
75 chosen.
76
7c913512 77 @param style
23324ae1
FM
78 Window style. See wxSlider.
79
7c913512 80 @param validator
23324ae1
FM
81 Window validator.
82
7c913512 83 @param name
23324ae1
FM
84 Window name.
85
86 @sa Create(), wxValidator
87 */
88 wxSlider();
7c913512
FM
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");
23324ae1
FM
96 //@}
97
98 /**
99 Destructor, destroying the slider.
100 */
101 ~wxSlider();
102
103 /**
104 Clears the selection, for a slider with the @b wxSL_SELRANGE style.
105
106 @remarks Windows 95 only.
107 */
108 void ClearSel();
109
110 /**
111 Clears the ticks.
112
113 @remarks Windows 95 only.
114 */
115 void ClearTicks();
116
117 /**
118 Used for two-step slider construction. See wxSlider()
119 for further details.
120 */
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");
128
129 /**
130 Returns the line size.
131
132 @sa SetLineSize()
133 */
134 int GetLineSize();
135
136 /**
137 Gets the maximum slider value.
138
139 @sa GetMin(), SetRange()
140 */
141 int GetMax();
142
143 /**
144 Gets the minimum slider value.
145
146 @sa GetMin(), SetRange()
147 */
148 int GetMin();
149
150 /**
151 Returns the page size.
152
153 @sa SetPageSize()
154 */
155 int GetPageSize();
156
157 /**
158 Returns the selection end point.
159
160 @remarks Windows 95 only.
161
162 @sa GetSelStart(), SetSelection()
163 */
164 int GetSelEnd();
165
166 /**
167 Returns the selection start point.
168
169 @remarks Windows 95 only.
170
171 @sa GetSelEnd(), SetSelection()
172 */
173 int GetSelStart();
174
175 /**
176 Returns the thumb length.
177
178 @remarks Windows 95 only.
179
180 @sa SetThumbLength()
181 */
182 int GetThumbLength();
183
184 /**
185 Returns the tick frequency.
186
187 @remarks Windows 95 only.
188
189 @sa SetTickFreq()
190 */
191 int GetTickFreq();
192
193 /**
194 Gets the current slider value.
195
196 @sa GetMin(), GetMax(), SetValue()
197 */
198 int GetValue();
199
200 /**
201 Sets the line size for the slider.
202
7c913512 203 @param lineSize
23324ae1
FM
204 The number of steps the slider moves when the user moves it up or down a line.
205
206 @sa GetLineSize()
207 */
208 void SetLineSize(int lineSize);
209
210 /**
211 Sets the page size for the slider.
212
7c913512 213 @param pageSize
23324ae1
FM
214 The number of steps the slider moves when the user pages up or down.
215
216 @sa GetPageSize()
217 */
218 void SetPageSize(int pageSize);
219
220 /**
221 Sets the minimum and maximum slider values.
222
223 @sa GetMin(), GetMax()
224 */
225 void SetRange(int minValue, int maxValue);
226
227 /**
228 Sets the selection.
229
7c913512 230 @param startPos
23324ae1
FM
231 The selection start position.
232
7c913512 233 @param endPos
23324ae1
FM
234 The selection end position.
235
236 @remarks Windows 95 only.
237
238 @sa GetSelStart(), GetSelEnd()
239 */
240 void SetSelection(int startPos, int endPos);
241
242 /**
243 Sets the slider thumb length.
244
7c913512 245 @param len
23324ae1
FM
246 The thumb length.
247
248 @remarks Windows 95 only.
249
250 @sa GetThumbLength()
251 */
252 void SetThumbLength(int len);
253
254 /**
255 Sets a tick position.
256
7c913512 257 @param tickPos
23324ae1
FM
258 The tick position.
259
260 @remarks Windows 95 only.
261
262 @sa SetTickFreq()
263 */
264 void SetTick(int tickPos);
265
266 /**
267 Sets the tick mark frequency and position.
268
7c913512 269 @param n
23324ae1
FM
270 Frequency. For example, if the frequency is set to two, a tick mark is
271 displayed for
272 every other increment in the slider's range.
273
7c913512 274 @param pos
23324ae1
FM
275 Position. Must be greater than zero. TODO: what is this for?
276
277 @remarks Windows 95 only.
278
279 @sa GetTickFreq()
280 */
281 void SetTickFreq(int n, int pos);
282
283 /**
284 Sets the slider position.
285
7c913512 286 @param value
23324ae1
FM
287 The slider position.
288 */
289 void SetValue(int value);
290};