wxSlider
generated from ../src/mod_gui/control/slider.cppA slider is a control with a handle which can be pulled back and forth to change the value. In Windows versions below Windows 95, a scrollbar is used to simulate the slider. In Windows 95, the track bar control is used. See also wxScrollEvent.
Constants
Styles
| Name | Description |
|---|---|
| HORIZONTAL | Displays the slider horizontally. |
| VERTICAL | Displays the slider vertically. |
| AUTOTICKS | Displays tick marks. |
| LABELS | Displays minimum, maximum and value labels. (NB: only displays the current value label under wxGTK) |
| LEFT | Displays ticks on the left, if a vertical slider. |
| RIGHT | Displays ticks on the right, if a vertical slider. |
| TOP | Displays ticks on the top, if a horizontal slider. |
| SELRANGE | Allows the user to select a range on the slider. Windows 95 only. |
Constructor
wxSlider
wxSlider()
wxSlider(Parent,
Id,
Value,
Min,
Max,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Style = wxSlider.HORIZONTAL,
Validator = null)
| Name | Type | Default | Description |
|---|---|---|---|
| Parent | wxWindow | The parent of wxSlider. | |
| Id | Integer | An window identifier. Use -1 when you don't need it. | |
| Value | Integer | Initial position of the slider | |
| Min | Integer | Minimum slider position. | |
| Max | Integer | Maximum slider position. | |
| Position | wxPoint | wxDefaultPosition | The position of the Slider control on the given parent. |
| Size | wxSize | wxDefaultSize | The size of the Slider control. |
| Style | Integer | wxSlider.HORIZONTAL | The wxSlider style. |
| Validator | wxValidator | null |
Constructs a new wxSlider object.
Properties
Methods
clearSel
clearSel()
Clears the selection, for a slider with the SELRANGE style.
clearTicks
clearTicks()
Clears the ticks.
create
create(Parent,
Id,
Value,
Min,
Max,
Position = wxDefaultPosition,
Size = wxDefaultSize,
Style = wxSlider.HORIZONTAL,
Validator = null)
| Name | Type | Default | Description |
|---|---|---|---|
| Parent | wxWindow | The parent of wxSlider. | |
| Id | Integer | An window identifier. Use -1 when you don't need it. | |
| Value | Integer | Initial position of the slider | |
| Min | Integer | Minimum slider position. | |
| Max | Integer | Maximum slider position. | |
| Position | wxPoint | wxDefaultPosition | The position of the Slider control on the given parent. |
| Size | wxSize | wxDefaultSize | The size of the Slider control. |
| Style | Integer | wxSlider.HORIZONTAL | The wxSlider style. |
| Validator | wxValidator | null |
Constructs a new wxSlider object.
setRange
setRange(Min,
Max)
| Name | Type | Default | Description |
|---|---|---|---|
| Min | Integer | The minimum value | |
| Max | Integer | The maximum value |
Sets the minimum and maximum slider values.
setSelection
setSelection(Start,
End)
| Name | Type | Default | Description |
|---|---|---|---|
| Start | Integer | The selection start position | |
| End | Integer | The selection end position |
Sets the selection
setTickFreq
setTickFreq(Freq,
Pos)
| Name | Type | Default | Description |
|---|---|---|---|
| Freq | Integer | Frequency | |
| Pos | Integer | Position |
Sets the tick mark frequency and position.
Events
| onScrollChanged | Event is triggered when scrolling/ moving has finished independently of the way it had started. The argument of the function is a wxScrollEvent. |
| onScrollTop | Catch a command to put the scroll thumb at the maximum position. The argument of the function is a wxScrollEvent. |
| onScrollBottom | Catch a command to put the scroll thumb at the maximum position. The argument of the function is a wxScrollEvent. |
| onScrollLineUp | Catch a line up command. The argument of the function is a wxScrollEvent. |
| onScrollLineDown | Catch a line down command. The argument of the function is a wxScrollEvent. |
| onScrollPageUp | Catch a page up command. The argument of the function is a wxScrollEvent. |
| onScrollPageDown | Catch a page down command. The argument of the function is a wxScrollEvent. |
| onScrollThumbTrack | Catch a thumbtrack command (continuous movement of the scroll thumb). The argument of the function is a wxScrollEvent. |
| onScrollThumbRelease | Catch a thumbtrack release command. The argument of the function is a wxScrollEvent. |

© 2002 - 2007 Franky Braem.