# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # SL_HORIZONTAL = 4 # SL_VERTICAL = 8 # SL_TICKS = 16 # SL_AUTOTICKS = 16 # SL_LEFT = 64 # SL_TOP = 128 # SL_RIGHT = 256 # SL_BOTTOM = 512 # SL_BOTH = 1024 # SL_SELRANGE = 2048 # SL_INVERSE = 4096 # SL_MIN_MAX_LABELS = 8192 # SL_VALUE_LABEL = 16384 # SL_LABELS = 24576 # A 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. # On GTK+, tick marks are only available for version 2.16 and later. # Slider generates the same events as {Wx::ScrollBar} but in practice the most convenient way to process {Wx::Slider} updates is by handling the slider-specific {Wx::EVT_SLIDER} event which carries {Wx::CommandEvent} containing just the latest slider position. # ### Styles # # This class supports the following styles: # # - {Wx::SL_HORIZONTAL}: Displays the slider horizontally (this is the default). # # - {Wx::SL_VERTICAL}: Displays the slider vertically. # # - {Wx::SL_AUTOTICKS}: Displays tick marks (Windows, GTK+ 2.16 and later). # # - {Wx::SL_MIN_MAX_LABELS}: Displays minimum, maximum labels (new since wxWidgets 2.9.1). # # - {Wx::SL_VALUE_LABEL}: Displays value label (new since wxWidgets 2.9.1). # # - {Wx::SL_LABELS}: Displays minimum, maximum and value labels (same as {Wx::SL_VALUE_LABEL} and {Wx::SL_MIN_MAX_LABELS} together). # # - {Wx::SL_LEFT}: Displays ticks on the left and forces the slider to be vertical (Windows and GTK+ 3 only). # # - {Wx::SL_RIGHT}: Displays ticks on the right and forces the slider to be vertical. # # - {Wx::SL_TOP}: Displays ticks on the top (Windows and GTK+ 3 only). # # - {Wx::SL_BOTTOM}: Displays ticks on the bottom (this is the default). # # - {Wx::SL_BOTH}: Displays ticks on both sides of the slider. Windows only. # # - {Wx::SL_SELRANGE}: Displays a highlighted selection range. Windows only. # # - {Wx::SL_INVERSE}: Inverses the minimum and maximum endpoints on the slider. Not compatible with {Wx::SL_SELRANGE}. # # Notice that {Wx::SL_LEFT}, {Wx::SL_TOP}, {Wx::SL_RIGHT} and {Wx::SL_BOTTOM} specify the position of the slider ticks 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, {Wx::SL_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). # ### Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::ScrollEvent} events. # Event handler methods for events emitted by this class: except for this, the macros behave exactly the same. # # - {Wx::EvtHandler#evt_scroll}(meth = nil, &block): Process all scroll events. # # - {Wx::EvtHandler#evt_scroll_top}(meth = nil, &block): Process {Wx::EVT_SCROLL_TOP} scroll-to-top events (minimum position). # # - {Wx::EvtHandler#evt_scroll_bottom}(meth = nil, &block): Process {Wx::EVT_SCROLL_BOTTOM} scroll-to-bottom events (maximum position). # # - {Wx::EvtHandler#evt_scroll_lineup}(meth = nil, &block): Process {Wx::EVT_SCROLL_LINEUP} line up events. # # - {Wx::EvtHandler#evt_scroll_linedown}(meth = nil, &block): Process {Wx::EVT_SCROLL_LINEDOWN} line down events. # # - {Wx::EvtHandler#evt_scroll_pageup}(meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEUP} page up events. # # - {Wx::EvtHandler#evt_scroll_pagedown}(meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEDOWN} page down events. # # - {Wx::EvtHandler#evt_scroll_thumbtrack}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBTRACK} thumbtrack events (frequent events sent as the user drags the thumbtrack). # # - {Wx::EvtHandler#evt_scroll_thumbrelease}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBRELEASE} thumb release events. # # - {Wx::EvtHandler#evt_scroll_changed}(meth = nil, &block): Process {Wx::EVT_SCROLL_CHANGED} end of scrolling events (MSW only). # # - {Wx::EvtHandler#evt_command_scroll}(id, meth = nil, &block): Process all scroll events. # # - {Wx::EvtHandler#evt_command_scroll_top}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_TOP} scroll-to-top events (minimum position). # # - {Wx::EvtHandler#evt_command_scroll_bottom}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_BOTTOM} scroll-to-bottom events (maximum position). # # - {Wx::EvtHandler#evt_command_scroll_lineup}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_LINEUP} line up events. # # - {Wx::EvtHandler#evt_command_scroll_linedown}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_LINEDOWN} line down events. # # - {Wx::EvtHandler#evt_command_scroll_pageup}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEUP} page up events. # # - {Wx::EvtHandler#evt_command_scroll_pagedown}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_PAGEDOWN} page down events. # # - {Wx::EvtHandler#evt_command_scroll_thumbtrack}(id, meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBTRACK} thumbtrack events (frequent events sent as the user drags the thumbtrack). # # - {Wx::EvtHandler#evt_command_scroll_thumbrelease}(meth = nil, &block): Process {Wx::EVT_SCROLL_THUMBRELEASE} thumb release events. # # - {Wx::EvtHandler#evt_command_scroll_changed}(meth = nil, &block): Process {Wx::EVT_SCROLL_CHANGED} end of scrolling events (MSW only). # # - {Wx::EvtHandler#evt_slider}(id, meth = nil, &block): Process {Wx::EVT_SLIDER} which is generated after any change of {Wx::Slider} position in addition to one of the events above. Notice that the handler of this event receives a {Wx::CommandEvent} as argument and not {Wx::ScrollEvent}, as all the other handlers. # # ## 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. # # Category: {Wx::Controls}
Appearance:
WXMSW Appearance # WXGTK Appearance # WXOSX Appearance #
# @see Events and Event Handling # @see Wx::ScrollBar # # # @wxrb_require USE_SLIDER class Slider < Control # @overload initialize() # Default constructor. # @return [Wx::Slider] # @overload initialize(parent, id, value, minValue, maxValue, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::SL_HORIZONTAL, validator=Wx::DEFAULT_VALIDATOR, name=Wx::SLIDER_NAME_STR) # Constructor, creating and showing a slider. # # # @see Wx::Slider#create # @see Wx::Validator # @param parent [Wx::Window] Parent window. Must not be NULL. # @param id [Integer] Window identifier. The value {Wx::StandardID::ID_ANY} indicates a default value. # @param value [Integer] Initial position for the slider. # @param minValue [Integer] Minimum slider position. # @param maxValue [Integer] Maximum slider position. # @param pos [Array(Integer, Integer), Wx::Point] Window position. If {Wx::DEFAULT_POSITION} is specified then a default position is chosen. # @param size [Array(Integer, Integer), Wx::Size] Window size. If {Wx::DEFAULT_SIZE} is specified then a default size is chosen, which is typically appropriate in the transverse slider direction, but is just fixed 100 (DPI-independent) pixels in the primary direction (i.e. vertical for {Wx::SL_VERTICAL} sliders or horizontal for {Wx::SL_HORIZONTAL} ones), so it may be preferable to specify it explicitly. Conversely, when using non-default size, it's usually best to use -1 for the transverse size component, meaning that the default should be used, as the appropriate value depends on the platform and theme. # @param style [Integer] Window style. See {Wx::Slider}. # @param validator [Wx::Validator] Window validator. # @param name [String] Window name. # @return [Wx::Slider] def initialize(*args) end # Clears the selection, for a slider with the {Wx::SL_SELRANGE} style. # # Availability: only available for the WXMSW port. # @return [void] # @wxrb_require WXMSW def clear_sel; end # Clears the ticks. # # Availability: only available for the WXMSW, WXGTK ports. # @return [void] # @wxrb_require WXMSW|WXGTK def clear_ticks; end # Used for two-step slider construction. # # See {Wx::Slider#initialize} for further details. # @param parent [Wx::Window] # @param id [Integer] # @param value [Integer] # @param minValue [Integer] # @param maxValue [Integer] # @param point [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [Boolean] def create(parent, id, value, minValue, maxValue, point=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::SL_HORIZONTAL, validator=Wx::DEFAULT_VALIDATOR, name=Wx::SLIDER_NAME_STR) end # Returns the line size. # # # @see Wx::Slider#set_line_size # @return [Integer] def get_line_size; end alias_method :line_size, :get_line_size # Gets the maximum slider value. # # # @see Wx::Slider#get_min # @see Wx::Slider#set_range # @return [Integer] def get_max; end alias_method :max, :get_max # Gets the minimum slider value. # # # @see Wx::Slider#get_min # @see Wx::Slider#set_range # @return [Integer] def get_min; end alias_method :min, :get_min # Returns the page size. # # # @see Wx::Slider#set_page_size # @return [Integer] def get_page_size; end alias_method :page_size, :get_page_size # Returns the selection end point. # # Availability: only available for the WXMSW port. # @see Wx::Slider#get_sel_start # @see Wx::Slider#set_selection # @return [Integer] # @wxrb_require WXMSW def get_sel_end; end alias_method :sel_end, :get_sel_end # Returns the selection start point. # # Availability: only available for the WXMSW port. # @see Wx::Slider#get_sel_end # @see Wx::Slider#set_selection # @return [Integer] # @wxrb_require WXMSW def get_sel_start; end alias_method :sel_start, :get_sel_start # Returns the thumb length. # # Availability: only available for the WXMSW port. # @see Wx::Slider#set_thumb_length # @return [Integer] # @wxrb_require WXMSW def get_thumb_length; end alias_method :thumb_length, :get_thumb_length # Returns the tick frequency. # # Availability: only available for the WXMSW, WXGTK ports. # @see Wx::Slider#set_tick_freq # @return [Integer] # @wxrb_require WXMSW|WXGTK def get_tick_freq; end alias_method :tick_freq, :get_tick_freq # Gets the current slider value. # # # @see Wx::Slider#get_min # @see Wx::Slider#get_max # @see Wx::Slider#set_value # @return [Integer] def get_value; end alias_method :value, :get_value # Sets the line size for the slider. # # # @see Wx::Slider#get_line_size # @param lineSize [Integer] The number of steps the slider moves when the user moves it up or down a line. # @return [void] def set_line_size(lineSize) end alias_method :line_size=, :set_line_size # Sets the minimum slider value. # # # @see Wx::Slider#get_min # @see Wx::Slider#set_range # @param minValue [Integer] The new bottom end of the slider range. # @return [void] def set_min(minValue) end alias_method :min=, :set_min # Sets the maximum slider value. # # # @see Wx::Slider#get_max # @see Wx::Slider#set_range # @param maxValue [Integer] The new top end of the slider range. # @return [void] def set_max(maxValue) end alias_method :max=, :set_max # Sets the page size for the slider. # # # @see Wx::Slider#get_page_size # @param pageSize [Integer] The number of steps the slider moves when the user pages up or down. # @return [void] def set_page_size(pageSize) end alias_method :page_size=, :set_page_size # Sets the minimum and maximum slider values. # # # @see Wx::Slider#get_min # @see Wx::Slider#get_max # @param minValue [Integer] # @param maxValue [Integer] # @return [void] def set_range(minValue, maxValue) end # Sets the selection. # # Availability: only available for the WXMSW port. # @see Wx::Slider#get_sel_start # @see Wx::Slider#get_sel_end # @param startPos [Integer] The selection start position. # @param endPos [Integer] The selection end position. # @return [void] # @wxrb_require WXMSW def set_selection(startPos, endPos) end # Sets the slider thumb length. # # Availability: only available for the WXMSW port. # @see Wx::Slider#get_thumb_length # @param len [Integer] The thumb length. # @return [void] # @wxrb_require WXMSW def set_thumb_length(len) end alias_method :thumb_length=, :set_thumb_length # Sets a tick position. # # Availability: only available for the WXMSW, WXGTK ports. # @see Wx::Slider#set_tick_freq # @param tickPos [Integer] The tick position. # @return [void] # @wxrb_require WXMSW|WXGTK def set_tick(tickPos) end alias_method :tick=, :set_tick # Sets the tick mark frequency and position. # # Availability: only available for the WXMSW, WXGTK ports. # @see Wx::Slider#get_tick_freq # @param freq [Integer] Frequency. For example, if the frequency is set to two, a tick mark is displayed for every other increment in the slider's range. # @return [void] # @wxrb_require WXMSW|WXGTK def set_tick_freq(freq) end alias_method :tick_freq=, :set_tick_freq # Sets the slider position. # @param value [Integer] The slider position. # @return [void] def set_value(value) end alias_method :value=, :set_value end # Slider end