Class: Wx::CommandEvent

Inherits:
Event show all
Defined in:
lib/wx/doc/gen/event.rb,
lib/wx/doc/event.rb

Overview

This event class contains information about command events, which originate from a variety of simple controls.

Note that CommandEvents and CommandEvent-derived event classes by default and unlike other Event-derived classes propagate upward from the source window (the window which emits the event) up to the first parent which processes the event. Be sure to read How Events Propagate Upwards. More complex controls, such as TreeCtrl, have separate command event classes.

Events using this class

The following event-handler methods redirect the events to member method or handler blocks for CommandEvent events. Event handler methods:

Category: Events

Instance Method Summary collapse

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(commandEventType = Wx::EVT_NULL, id = 0) ⇒ Wx::CommandEvent

Constructor.

Parameters:

  • commandEventType (Wx::GenericCollapsiblePane::EventType) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)


884
# File 'lib/wx/doc/gen/event.rb', line 884

def initialize(commandEventType=Wx::EVT_NULL, id=0) end

Instance Method Details

#client_dataObject



38
# File 'lib/wx/doc/event.rb', line 38

alias :client_data :get_client_object

#client_data=Object



34
# File 'lib/wx/doc/event.rb', line 34

alias :client_data= :set_client_object

#get_client_dataObject



36
# File 'lib/wx/doc/event.rb', line 36

alias :get_client_data :get_client_object

#get_client_objectObject Also known as: client_object

Returns client object pointer for a listbox or choice selection event (not valid for a deselection).

Returns:



888
# File 'lib/wx/doc/gen/event.rb', line 888

def get_client_object; end

#get_intInteger Also known as: int

Returns the integer identifier corresponding to a listbox, choice or radiobox selection (only if the event was a selection, not a deselection), or a boolean value representing the value of a checkbox.

For a menu item, this method returns -1 if the item is not checkable or a boolean value (true or false) for checkable items indicating the new state of the item.

Returns:

  • (Integer)


895
# File 'lib/wx/doc/gen/event.rb', line 895

def get_int; end

#get_selectionInteger Also known as: selection

Returns item index for a listbox or choice selection event (not valid for a deselection).

Returns:

  • (Integer)


900
# File 'lib/wx/doc/gen/event.rb', line 900

def get_selection; end

#get_stringString Also known as: string

Returns item string for a listbox or choice selection event.

If one or several items have been deselected, returns the index of the first deselected item. If some items have been selected and others deselected at the same time, it will return the index of the first selected item.

Returns:

  • (String)


907
# File 'lib/wx/doc/gen/event.rb', line 907

def get_string; end

#is_checkedBoolean Also known as: checked?

This method can be used with checkbox and menu events: for the checkboxes, the method returns true for a selection event and false for a deselection one.

For the menu events, this method indicates if the menu item just has become checked or unchecked (and thus only makes sense for checkable menu items). Notice that this method cannot be used with Wx::CheckListBox currently.

Returns:

  • (Boolean)


915
# File 'lib/wx/doc/gen/event.rb', line 915

def is_checked; end

#is_selectionBoolean Also known as: selection?

For a listbox or similar event, returns true if it is a selection, false if it is a deselection.

If some items have been selected and others deselected at the same time, it will return true.

Returns:

  • (Boolean)


922
# File 'lib/wx/doc/gen/event.rb', line 922

def is_selection; end

#set_client_dataObject



32
# File 'lib/wx/doc/event.rb', line 32

alias :set_client_data :set_client_object

#set_client_object(clientObject) ⇒ void

This method returns an undefined value.

Sets the client object for this event.

The client object is not owned by the event object and the event object will not delete the client object in its destructor. The client object must be owned and deleted by another object (e.g. a control) that has longer life time than the event object.

Parameters:



931
# File 'lib/wx/doc/gen/event.rb', line 931

def set_client_object(clientObject) end

#set_extra_long(extraLong) ⇒ void Also known as: extra_long=

This method returns an undefined value.

Sets the m_extraLong member.

Parameters:

  • extraLong (Integer)


936
# File 'lib/wx/doc/gen/event.rb', line 936

def set_extra_long(extraLong) end

#set_int(intCommand) ⇒ void Also known as: int=

This method returns an undefined value.

Sets the m_commandInt member.

Parameters:

  • intCommand (Integer)


942
# File 'lib/wx/doc/gen/event.rb', line 942

def set_int(intCommand) end

#set_string(string) ⇒ void Also known as: string=

This method returns an undefined value.

Sets the m_commandString member.

Parameters:

  • string (String)


948
# File 'lib/wx/doc/gen/event.rb', line 948

def set_string(string) end