Class: Wx::ScrollEvent
- Inherits:
-
CommandEvent
- Object
- Object
- Event
- CommandEvent
- Wx::ScrollEvent
- 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.
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.
-
EvtHandler#evt_scroll(meth = nil, &block): Process all scroll events.
-
EvtHandler#evt_scroll_top(meth = nil, &block): Process EVT_SCROLL_TOP scroll-to-top events (minimum position).
-
EvtHandler#evt_scroll_bottom(meth = nil, &block): Process EVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
-
EvtHandler#evt_scroll_lineup(meth = nil, &block): Process EVT_SCROLL_LINEUP line up events.
-
EvtHandler#evt_scroll_linedown(meth = nil, &block): Process EVT_SCROLL_LINEDOWN line down events.
-
EvtHandler#evt_scroll_pageup(meth = nil, &block): Process EVT_SCROLL_PAGEUP page up events.
-
EvtHandler#evt_scroll_pagedown(meth = nil, &block): Process EVT_SCROLL_PAGEDOWN page down events.
-
EvtHandler#evt_scroll_thumbtrack(meth = nil, &block): Process EVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack).
-
EvtHandler#evt_scroll_thumbrelease(meth = nil, &block): Process EVT_SCROLL_THUMBRELEASE thumb release events.
-
EvtHandler#evt_scroll_changed(meth = nil, &block): Process EVT_SCROLL_CHANGED end of scrolling events (MSW only).
-
EvtHandler#evt_command_scroll(id, meth = nil, &block): Process all scroll events.
-
EvtHandler#evt_command_scroll_top(id, meth = nil, &block): Process EVT_SCROLL_TOP scroll-to-top events (minimum position).
-
EvtHandler#evt_command_scroll_bottom(id, meth = nil, &block): Process EVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
-
EvtHandler#evt_command_scroll_lineup(id, meth = nil, &block): Process EVT_SCROLL_LINEUP line up events.
-
EvtHandler#evt_command_scroll_linedown(id, meth = nil, &block): Process EVT_SCROLL_LINEDOWN line down events.
-
EvtHandler#evt_command_scroll_pageup(id, meth = nil, &block): Process EVT_SCROLL_PAGEUP page up events.
-
EvtHandler#evt_command_scroll_pagedown(id, meth = nil, &block): Process EVT_SCROLL_PAGEDOWN page down events.
-
EvtHandler#evt_command_scroll_thumbtrack(id, meth = nil, &block): Process EVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the user drags the thumbtrack).
-
EvtHandler#evt_command_scroll_thumbrelease(meth = nil, &block): Process EVT_SCROLL_THUMBRELEASE thumb release events.
-
EvtHandler#evt_command_scroll_changed(meth = nil, &block): Process EVT_SCROLL_CHANGED end of scrolling events (MSW only).
Category: Events
Instance Method Summary collapse
-
#get_orientation ⇒ Integer
(also: #orientation)
Returns Orientation::HORIZONTAL or Orientation::VERTICAL, depending on the orientation of the scrollbar.
-
#get_position ⇒ Integer
(also: #position)
Returns the position of the scrollbar.
-
#initialize(commandType = Wx::EVT_NULL, id = 0, pos = 0, orientation = 0) ⇒ Wx::ScrollEvent
constructor
Constructor.
- #set_orientation(orient) ⇒ void (also: #orientation=)
- #set_position(pos) ⇒ void (also: #position=)
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.
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_orientation ⇒ Integer Also known as: orientation
Returns Orientation::HORIZONTAL or Orientation::VERTICAL, depending on the orientation of the scrollbar.
186 |
# File 'lib/wx/doc/gen/events.rb', line 186 def get_orientation; end |
#get_position ⇒ Integer Also known as: position
Returns the position of the scrollbar.
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.
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.
201 |
# File 'lib/wx/doc/gen/events.rb', line 201 def set_position(pos) end |