X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76e9224eb2edea8afe45faa6a1cd1b2894d245c2..4e621d24713f971d1a2d440f79ccc4593aede4b6:/interface/wx/slider.h diff --git a/interface/wx/slider.h b/interface/wx/slider.h index 18647f5a84..36554a629d 100644 --- a/interface/wx/slider.h +++ b/interface/wx/slider.h @@ -3,9 +3,26 @@ // Purpose: interface of wxSlider // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// + +#define wxSL_HORIZONTAL wxHORIZONTAL /* 0x0004 */ +#define wxSL_VERTICAL wxVERTICAL /* 0x0008 */ + +#define wxSL_TICKS 0x0010 +#define wxSL_AUTOTICKS wxSL_TICKS // we don't support manual ticks +#define wxSL_LEFT 0x0040 +#define wxSL_TOP 0x0080 +#define wxSL_RIGHT 0x0100 +#define wxSL_BOTTOM 0x0200 +#define wxSL_BOTH 0x0400 +#define wxSL_SELRANGE 0x0800 +#define wxSL_INVERSE 0x1000 +#define wxSL_MIN_MAX_LABELS 0x2000 +#define wxSL_VALUE_LABEL 0x4000 +#define wxSL_LABELS (wxSL_MIN_MAX_LABELS|wxSL_VALUE_LABEL) + /** @class wxSlider @@ -22,9 +39,14 @@ @style{wxSL_VERTICAL} Displays the slider vertically. @style{wxSL_AUTOTICKS} - Displays tick marks. + Displays tick marks. Windows only. + @style{wxSL_MIN_MAX_LABELS} + Displays minimum, maximum labels (new since wxWidgets 2.9.1). + @style{wxSL_VALUE_LABEL} + Displays value label (new since wxWidgets 2.9.1). @style{wxSL_LABELS} - Displays minimum, maximum and value labels. + Displays minimum, maximum and value labels (same as wxSL_VALUE_LABEL + and wxSL_MIN_MAX_LABELS together). @style{wxSL_LEFT} Displays ticks on the left and forces the slider to be vertical. @style{wxSL_RIGHT} @@ -36,11 +58,18 @@ @style{wxSL_SELRANGE} Allows the user to select a range on the slider. Windows only. @style{wxSL_INVERSE} - Inverses the mininum and maximum endpoints on the slider. Not + Inverses the minimum and maximum endpoints on the slider. Not compatible with wxSL_SELRANGE. @endStyleTable - @beginEventTable{wxScrollEvent} + Notice that @c wxSL_LEFT, @c wxSL_TOP, @c wxSL_RIGHT and @c wxSL_BOTTOM + specify the position of the slider ticks in MSW implementation and that the + slider labels, if any, are positioned on the opposite side. So, to have a + label on the left side of a vertical slider, @b wxSL_RIGHT must be used (or + none of these styles at all should be specified as left and top are default + positions for the vertical and horizontal sliders respectively). + + @beginEventEmissionTable{wxScrollEvent} 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, @@ -48,45 +77,48 @@ @event{EVT_SCROLL(func)} Process all scroll events. @event{EVT_SCROLL_TOP(func)} - Process wxEVT_SCROLL_TOP scroll-to-top events (minimum position). + Process @c wxEVT_SCROLL_TOP scroll-to-top events (minimum position). @event{EVT_SCROLL_BOTTOM(func)} - Process wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position). + Process @c wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position). @event{EVT_SCROLL_LINEUP(func)} - Process wxEVT_SCROLL_LINEUP line up events. + Process @c wxEVT_SCROLL_LINEUP line up events. @event{EVT_SCROLL_LINEDOWN(func)} - Process wxEVT_SCROLL_LINEDOWN line down events. + Process @c wxEVT_SCROLL_LINEDOWN line down events. @event{EVT_SCROLL_PAGEUP(func)} - Process wxEVT_SCROLL_PAGEUP page up events. + Process @c wxEVT_SCROLL_PAGEUP page up events. @event{EVT_SCROLL_PAGEDOWN(func)} - Process wxEVT_SCROLL_PAGEDOWN page down events. + Process @c wxEVT_SCROLL_PAGEDOWN page down events. @event{EVT_SCROLL_THUMBTRACK(func)} - Process wxEVT_SCROLL_THUMBTRACK thumbtrack events + Process @c wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack). @event{EVT_SCROLL_THUMBRELEASE(func)} - Process wxEVT_SCROLL_THUMBRELEASE thumb release events. + Process @c wxEVT_SCROLL_THUMBRELEASE thumb release events. @event{EVT_SCROLL_CHANGED(func)} - Process wxEVT_SCROLL_CHANGED end of scrolling events (MSW only). + Process @c wxEVT_SCROLL_CHANGED end of scrolling events (MSW only). @event{EVT_COMMAND_SCROLL(id, func)} Process all scroll events. @event{EVT_COMMAND_SCROLL_TOP(id, func)} - Process wxEVT_SCROLL_TOP scroll-to-top events (minimum position). + Process @c wxEVT_SCROLL_TOP scroll-to-top events (minimum position). @event{EVT_COMMAND_SCROLL_BOTTOM(id, func)} - Process wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position). + Process @c wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position). @event{EVT_COMMAND_SCROLL_LINEUP(id, func)} - Process wxEVT_SCROLL_LINEUP line up events. + Process @c wxEVT_SCROLL_LINEUP line up events. @event{EVT_COMMAND_SCROLL_LINEDOWN(id, func)} - Process wxEVT_SCROLL_LINEDOWN line down events. + Process @c wxEVT_SCROLL_LINEDOWN line down events. @event{EVT_COMMAND_SCROLL_PAGEUP(id, func)} - Process wxEVT_SCROLL_PAGEUP page up events. + Process @c wxEVT_SCROLL_PAGEUP page up events. @event{EVT_COMMAND_SCROLL_PAGEDOWN(id, func)} - Process wxEVT_SCROLL_PAGEDOWN page down events. + Process @c wxEVT_SCROLL_PAGEDOWN page down events. @event{EVT_COMMAND_SCROLL_THUMBTRACK(id, func)} - Process wxEVT_SCROLL_THUMBTRACK thumbtrack events + Process @c wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack). @event{EVT_COMMAND_SCROLL_THUMBRELEASE(func)} - Process wxEVT_SCROLL_THUMBRELEASE thumb release events. + Process @c wxEVT_SCROLL_THUMBRELEASE thumb release events. @event{EVT_COMMAND_SCROLL_CHANGED(func)} - Process wxEVT_SCROLL_CHANGED end of scrolling events (MSW only). + Process @c wxEVT_SCROLL_CHANGED end of scrolling events (MSW only). + @event{EVT_SLIDER(id, func)} + Process @c wxEVT_COMMAND_SLIDER_UPDATED which is generated after any + change of wxSlider position in addition to one of the events above. @endEventTable @section slider_diff The difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED @@ -103,13 +135,11 @@ Please see the widgets sample ("Slider" page) to see the difference between EVT_SCROLL_THUMBRELEASE and EVT_SCROLL_CHANGED in action. - @todo are all strings "Windows 95 only" really up2date? - @library{wxcore} @category{ctrl} - + @appearance{slider.png} - @see @ref overview_eventhandling, wxScrollBar + @see @ref overview_events, wxScrollBar */ class wxSlider : public wxControl { @@ -132,8 +162,12 @@ public: Minimum slider position. @param maxValue Maximum slider position. + @param pos + Window position. + If ::wxDefaultPosition is specified then a default position is chosen. @param size - Window size. If wxDefaultSize is specified then a default size is chosen. + Window size. + If ::wxDefaultSize is specified then a default size is chosen. @param style Window style. See wxSlider. @param validator @@ -145,11 +179,11 @@ public: */ wxSlider(wxWindow* parent, wxWindowID id, int value, int minValue, int maxValue, - const wxPoint& point = wxDefaultPosition, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "slider"); + const wxString& name = wxSliderNameStr); /** Destructor, destroying the slider. @@ -159,14 +193,14 @@ public: /** Clears the selection, for a slider with the @b wxSL_SELRANGE style. - @remarks Windows 95 only. + @onlyfor{wxmsw} */ virtual void ClearSel(); /** Clears the ticks. - @remarks Windows 95 only. + @onlyfor{wxmsw} */ virtual void ClearTicks(); @@ -174,13 +208,11 @@ public: Used for two-step slider construction. See wxSlider() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, int value, - int minValue, int maxValue, - const wxPoint& point = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxSL_HORIZONTAL, + bool 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"); + const wxString& name = wxSliderNameStr); /** Returns the line size. @@ -213,7 +245,7 @@ public: /** Returns the selection end point. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see GetSelStart(), SetSelection() */ @@ -222,7 +254,7 @@ public: /** Returns the selection start point. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see GetSelEnd(), SetSelection() */ @@ -231,7 +263,7 @@ public: /** Returns the thumb length. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see SetThumbLength() */ @@ -240,7 +272,7 @@ public: /** Returns the tick frequency. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see SetTickFreq() */ @@ -289,7 +321,7 @@ public: @param endPos The selection end position. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see GetSelStart(), GetSelEnd() */ @@ -301,7 +333,7 @@ public: @param len The thumb length. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see GetThumbLength() */ @@ -313,7 +345,7 @@ public: @param tickPos The tick position. - @remarks Windows 95 only. + @onlyfor{wxmsw} @see SetTickFreq() */ @@ -325,14 +357,12 @@ public: @param n Frequency. For example, if the frequency is set to two, a tick mark is displayed for every other increment in the slider's range. - @param pos - Position. Must be greater than zero. @todo: what is this for? - @remarks Windows 95 only. + @onlyfor{wxmsw} @see GetTickFreq() */ - virtual void SetTickFreq(int n, int pos); + virtual void SetTickFreq(int n); /** Sets the slider position.