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:



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

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:



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

def get_event_object; end

#get_event_typeWx::HTML::SimpleHtmlListBox::EventType Also known as: event_type

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

Returns:

  • (Wx::HTML::SimpleHtmlListBox::EventType)


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

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)


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

def get_id; end

#get_skippedBoolean Also known as: skipped

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

Returns:

  • (Boolean)


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

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 valid timestamp only for mouse and key events (see MouseEvent and KeyEvent).

Returns:

  • (Integer)


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

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)


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

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)


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

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:



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

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::HTML::SimpleHtmlListBox::EventType)


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

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)


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

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)


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

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)


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

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)


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

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)


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

def stop_propagation; end