Class: Wx::BookCtrlEvent
- Inherits:
-
NotifyEvent
- Object
- Object
- Event
- CommandEvent
- NotifyEvent
- Wx::BookCtrlEvent
- Defined in:
- lib/wx/doc/gen/book_ctrl_event.rb
Overview
This class represents the events generated by book controls (Notebook, Listbook, Choicebook, Treebook, AUI::AuiNotebook).
The page CHANGING events are sent before the current page is changed. It allows the program to examine the current page (which can be retrieved with #get_old_selection) and to veto the page change by calling NotifyEvent#veto if, for example, the current values in the controls of the old page are invalid. However the handler for this event does not have access to the new page being selected as this information is not always provided by the underlying native control. The page CHANGED events are sent after the page has been changed and the program cannot veto it any more, it just informs it about the page change. However the handler for this event has access to the newly selected page. To summarize, if the program is interested in validating the page values before allowing the user to change it, it should process the page changing event. If it just needs to react to the page change after it happened, handling page changed events is enough. It is also perfectly possible to handle both of these events, for different purposes.
Category: Events, Book Controls
Direct Known Subclasses
Instance Method Summary collapse
-
#get_old_selection ⇒ Integer
(also: #old_selection)
Returns the page that was selected before the change, NOT_FOUND if none was selected.
-
#get_selection ⇒ Integer
(also: #selection)
Returns the currently selected page, or NOT_FOUND if none was selected.
-
#initialize(eventType = Wx::EVT_NULL, id = 0, sel = Wx::NOT_FOUND, oldSel = Wx::NOT_FOUND) ⇒ Wx::BookCtrlEvent
constructor
Constructor (used internally by wxWidgets only).
-
#set_old_selection(page) ⇒ void
(also: #old_selection=)
Sets the id of the page selected before the change.
-
#set_selection(page) ⇒ void
(also: #selection=)
Sets the selection member variable.
Methods inherited from NotifyEvent
Methods inherited from CommandEvent
#client_data, #client_data=, #get_client_data, #get_client_object, #get_int, #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(eventType = Wx::EVT_NULL, id = 0, sel = Wx::NOT_FOUND, oldSel = Wx::NOT_FOUND) ⇒ Wx::BookCtrlEvent
Constructor (used internally by wxWidgets only).
33 |
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 33 def initialize(eventType=Wx::EVT_NULL, id=0, sel=Wx::NOT_FOUND, oldSel=Wx::NOT_FOUND) end |
Instance Method Details
#get_old_selection ⇒ Integer Also known as: old_selection
Returns the page that was selected before the change, NOT_FOUND if none was selected.
37 |
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 37 def get_old_selection; end |
#get_selection ⇒ Integer Also known as: selection
Returns the currently selected page, or NOT_FOUND if none was selected.
under Windows, #get_selection will return the same value as #get_old_selection when called from the EVT_BOOKCTRL_PAGE_CHANGING handler and not the page which is going to be selected.
48 |
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 48 def get_selection; end |
#set_old_selection(page) ⇒ void Also known as: old_selection=
This method returns an undefined value.
Sets the id of the page selected before the change.
54 |
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 54 def set_old_selection(page) end |
#set_selection(page) ⇒ void Also known as: selection=
This method returns an undefined value.
Sets the selection member variable.
60 |
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 60 def set_selection(page) end |