Class: Wx::Event

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

Overview

An event is a structure holding information about an event passed to a callback or member function.

Event used to be a multipurpose event object, and is an abstract base class for other event classes (see below). For more information about events, see the Events and Event Handling overview.

Category: Events

Instance Method Summary collapse

Methods inherited from Object

#dup, #is_same_as, #un_share

Constructor Details

#initialize(evt_type = Wx::EVT_NULL, id = 0, prop_level = Wx::EVENT_PROPAGATE_NONE) ⇒ Event

Constructor

Parameters:

  • evt_type (Integer) (defaults to: Wx::EVT_NULL)
  • id (Integer) (defaults to: 0)
  • prop_level (Wx::EventPropagation) (defaults to: Wx::EVENT_PROPAGATE_NONE)


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

def initialize(evt_type = Wx::EVT_NULL, id = 0, prop_level = Wx::EVENT_PROPAGATE_NONE) end

Instance Method Details

#cloneWx::Event

Returns a copy of the event. Any event that is posted to the wxRuby event system for later action (via Wx::EvtHandler#add_pending_event, Wx::EvtHandler#queue_event or Wx::EvtHandler#post_event) must implement this method. All standard wxRuby events fully implement this method and wxRuby has taken care of correctly handling this for any user defined event classes derived from either Wx::Event or Wx::CommandEvent. Creating user defined event classes derived for other classes than Wx::Event or Wx::CommandEvent is currently not supported in wxRuby.

Returns:



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

def clone; end

#get_event_categoryWx::EventCategory Also known as: event_category

Returns a generic category for this event.

Wx::Event implementation returns Wx::EventCategory::EVT_CATEGORY_UI by default. This function is used to selectively process events in Wx::EventLoopBase::YieldFor.

Returns:



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

def get_event_category; end

#get_event_objectWx::Object Also known as: event_object

Returns the object (usually a window) associated with the event, if any.

Returns:



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

def get_event_object; end

#get_event_typeWx::GenericCollapsiblePane::EventType Also known as: event_type

Returns the identifier of the given event type, such as Wx::EVT_BUTTON.

Returns:

  • (Wx::GenericCollapsiblePane::EventType)


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

def get_event_type; end

#get_idInteger Also known as: id

Returns the identifier associated with this event, such as a button command id.

Returns:

  • (Integer)


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

def get_id; end

#get_skippedBoolean Also known as: skipped

Returns true if the event handler should be skipped, false otherwise.

Returns:

  • (Boolean)


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

def get_skipped; end

#get_timestampInteger Also known as: timestamp

Gets the timestamp for the event.

The timestamp is the time in milliseconds since some fixed moment (not necessarily the standard Unix Epoch, so only differences between the timestamps and not their absolute values usually make sense). wxWidgets returns a non-NULL timestamp only for mouse and key events (see MouseEvent and KeyEvent).

Returns:

  • (Integer)


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

def get_timestamp; end

#is_command_eventBoolean Also known as: command_event?

Returns true if the event is or is derived from CommandEvent else it returns false.

Note:

exists only for optimization purposes.

Returns:

  • (Boolean)


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

def is_command_event; end

#resume_propagation(propagationLevel) ⇒ void

This method returns an undefined value.

Sets the propagation level to the given value (for example returned from an earlier call to #stop_propagation).

Parameters:

  • propagationLevel (Integer)


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

def resume_propagation(propagationLevel) end

#set_event_object(object) ⇒ void Also known as: event_object=

This method returns an undefined value.

Sets the originating object.

Parameters:



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

def set_event_object(object) end

#set_event_type(type) ⇒ void Also known as: event_type=

This method returns an undefined value.

Sets the event type.

Parameters:

  • type (Wx::GenericCollapsiblePane::EventType)


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

def set_event_type(type) end

#set_id(id) ⇒ void Also known as: id=

This method returns an undefined value.

Sets the identifier associated with this event, such as a button command id.

Parameters:

  • id (Integer)


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

def set_id(id) end

#set_timestamp(timeStamp = 0) ⇒ void Also known as: timestamp=

This method returns an undefined value.

Sets the timestamp for the event.

Parameters:

  • timeStamp (Integer) (defaults to: 0)


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

def set_timestamp(timeStamp=0) end

#should_propagateBoolean

Test if this event should be propagated or not, i.e. if the propagation level is currently greater than 0.

Returns:

  • (Boolean)


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

def should_propagate; end

#skip(skip = true) ⇒ void

This method returns an undefined value.

This method can be used inside an event handler to control whether further event handlers bound to this event will be called after the current one returns.

Without #skip (or equivalently if Skip(false) is used), the event will not be processed any more. If Skip(true) is called, the event processing system continues searching for a further handler function for this event, even though it has been processed already in the current handler. In general, it is recommended to skip all non-command events to allow the default handling to take place. The command events are, however, normally not skipped as usually a single command such as a button click or menu item selection must only be processed by one handler.

Parameters:

  • skip (Boolean) (defaults to: true)


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

def skip(skip=true) end

#stop_propagationInteger

Stop the event from propagating to its parent window.

Returns the old propagation level value which may be later passed to #resume_propagation to allow propagating the event again.

Returns:

  • (Integer)


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

def stop_propagation; end