Class: Wx::ScrollEvent

Inherits:
CommandEvent show all
Defined in:
lib/wx/doc/gen/events.rb

Overview

A scroll event holds information about events sent from stand-alone scrollbars (see ScrollBar) and sliders (see Slider).

Note that scrolled windows send the ScrollWinEvent which does not derive from CommandEvent, but from Event directly - don’t confuse these two kinds of events and use the event table macros mentioned below only for the scrollbar-like controls.

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.

Remark:

Note that unless specifying a scroll control identifier, you will need to test for scrollbar orientation with #get_orientation, since horizontal and vertical scroll events are processed using the same event handler.

Events using this class

The following event-handler methods redirect the events to member method or handler blocks for ScrollEvent events. Event handler methods: except for this, the macros behave exactly the same.

Category: Events

See Also:

Instance Method Summary collapse

Methods inherited from CommandEvent

#client_data, #client_data=, #get_client_data, #get_client_object, #get_int, #get_selection, #get_string, #is_checked, #is_selection, #set_client_data, #set_client_object, #set_extra_long, #set_int, #set_string

Methods inherited from Event

#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(commandType = Wx::EVT_NULL, id = 0, pos = 0, orientation = 0) ⇒ Wx::ScrollEvent

Constructor.

Parameters:

  • commandType (Wx::GenericCollapsiblePane::EventType) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)
  • pos (Integer) (defaults to: 0)
  • orientation (Integer) (defaults to: 0)


182
# File 'lib/wx/doc/gen/events.rb', line 182

def initialize(commandType=Wx::EVT_NULL, id=0, pos=0, orientation=0) end

Instance Method Details

#get_orientationInteger Also known as: orientation

Returns Orientation::HORIZONTAL or Orientation::VERTICAL, depending on the orientation of the scrollbar.

Returns:

  • (Integer)


186
# File 'lib/wx/doc/gen/events.rb', line 186

def get_orientation; end

#get_positionInteger Also known as: position

Returns the position of the scrollbar.

Returns:

  • (Integer)


191
# File 'lib/wx/doc/gen/events.rb', line 191

def get_position; end

#set_orientation(orient) ⇒ void Also known as: orientation=

This method returns an undefined value.

Parameters:

  • orient (Integer)


196
# File 'lib/wx/doc/gen/events.rb', line 196

def set_orientation(orient) end

#set_position(pos) ⇒ void Also known as: position=

This method returns an undefined value.

Parameters:

  • pos (Integer)


201
# File 'lib/wx/doc/gen/events.rb', line 201

def set_position(pos) end