Class: Wx::BookCtrlEvent

Inherits:
NotifyEvent show all
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. 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. 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, otherwise PAGE_CHANGED is probably enough. In any case, it is probably unnecessary to process both events at once.

Category: Events, Book Controls

See Also:

Requires:

  • USE_AUI or USE_NOTEBOOK or USE_LISTBOOK or USE_CHOICEBOOK or USE_TOOLBOOK or USE_TREEBOOK

Direct Known Subclasses

AUI::AuiNotebookEvent

Instance Method Summary collapse

Methods inherited from NotifyEvent

#allow, #is_allowed, #veto

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).

Parameters:

  • eventType (Wx::GenericCollapsiblePane::EventType) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)
  • sel (Integer) (defaults to: Wx::NOT_FOUND)
  • oldSel (Integer) (defaults to: Wx::NOT_FOUND)


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_selectionInteger Also known as: old_selection

Returns the page that was selected before the change, NOT_FOUND if none was selected.

Returns:

  • (Integer)


37
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 37

def get_old_selection; end

#get_selectionInteger Also known as: selection

Returns the currently selected page, or NOT_FOUND if none was selected.

Note:

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.

Returns:

  • (Integer)


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.

Parameters:

  • page (Integer)


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.

Parameters:

  • page (Integer)


60
# File 'lib/wx/doc/gen/book_ctrl_event.rb', line 60

def set_selection(page) end