wxSliderA slider is a control with a handle which can be pulled back and forth to change the value. On Windows, the track bar control is used. Slider events are handled in the same way as a scrollbar. Derived from
wxControl Include files <wx/slider.h> Window styles
See also window styles overview. Event table macros To process a scroll event, use these event handler macros to direct input to member functions that take a wxScrollEvent argument. You can use EVT_COMMAND_SCROLL... macros with window IDs for when intercepting scroll events from controls, or EVT_SCROLL... macros without window IDs for intercepting scroll events from the receiving window -- except for this, the macros behave exactly the same.
The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED The EVT_SCROLL_THUMBRELEASE event is only emitted when actually dragging the thumb using the mouse and releasing it (This EVT_SCROLL_THUMBRELEASE event is also followed by an EVT_SCROLL_CHANGED event). The EVT_SCROLL_CHANGED event also occurs when using the keyboard to change the thumb position, and when clicking next to the thumb (In all these cases the EVT_SCROLL_THUMBRELEASE event does not happen). In short, the EVT_SCROLL_CHANGED event is triggered when scrolling/ moving has finished independently of the way it had started. Please see the widgets sample ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action. See also Event handling overview, wxScrollBar Members
wxSlider::wxSlider
wxSlider::wxSliderwxSlider() Default slider. wxSlider(wxWindow* parent, wxWindowID id, int value , int minValue, int maxValue, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "slider") Constructor, creating and showing a slider. Parameters parent
id
value
minValue
maxValue
size
style
validator
name
See also
wxSlider::~wxSlidervoid ~wxSlider() Destructor, destroying the slider.
wxSlider::ClearSelvoid ClearSel() Clears the selection, for a slider with the wxSL_SELRANGE style. Remarks Windows 95 only.
wxSlider::ClearTicksvoid ClearTicks() Clears the ticks. Remarks Windows 95 only.
wxSlider::Createbool Create(wxWindow* parent, wxWindowID id, int value , int minValue, int maxValue, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = "slider") Used for two-step slider construction. See wxSlider::wxSlider for further details.
wxSlider::GetLineSizeint GetLineSize() const Returns the line size. See also
wxSlider::GetMaxint GetMax() const Gets the maximum slider value. See also wxSlider::GetMin, wxSlider::SetRange
wxSlider::GetMinint GetMin() const Gets the minimum slider value. See also wxSlider::GetMin, wxSlider::SetRange
wxSlider::GetPageSizeint GetPageSize() const Returns the page size. See also
wxSlider::GetSelEndint GetSelEnd() const Returns the selection end point. Remarks Windows 95 only. See also wxSlider::GetSelStart, wxSlider::SetSelection
wxSlider::GetSelStartint GetSelStart() const Returns the selection start point. Remarks Windows 95 only. See also wxSlider::GetSelEnd, wxSlider::SetSelection
wxSlider::GetThumbLengthint GetThumbLength() const Returns the thumb length. Remarks Windows 95 only. See also
wxSlider::GetTickFreqint GetTickFreq() const Returns the tick frequency. Remarks Windows 95 only. See also
wxSlider::GetValueint GetValue() const Gets the current slider value. See also wxSlider::GetMin, wxSlider::GetMax, wxSlider::SetValue
wxSlider::SetLineSizevoid SetLineSize(int lineSize) Sets the line size for the slider. Parameters lineSize
See also
wxSlider::SetPageSizevoid SetPageSize(int pageSize) Sets the page size for the slider. Parameters pageSize
See also
wxSlider::SetRangevoid SetRange(int minValue, int maxValue) Sets the minimum and maximum slider values. See also wxSlider::GetMin, wxSlider::GetMax
wxSlider::SetSelectionvoid SetSelection(int startPos, int endPos) Sets the selection. Parameters startPos
endPos
Remarks Windows 95 only. See also wxSlider::GetSelStart, wxSlider::GetSelEnd
wxSlider::SetThumbLengthvoid SetThumbLength(int len) Sets the slider thumb length. Parameters len
Remarks Windows 95 only. See also
wxSlider::SetTickvoid SetTick(int tickPos) Sets a tick position. Parameters tickPos
Remarks Windows 95 only. See also
wxSlider::SetTickFreqvoid SetTickFreq(int n, int pos) Sets the tick mark frequency and position. Parameters n
pos
Remarks Windows 95 only. See also
wxSlider::SetValuevoid SetValue(int value) Sets the slider position. Parameters value
See also
|