******** wx.Event ******** Inheritance diagram for `wx.Event`: | .. inheritance-diagram:: wx.Event | Description =========== An event is a structure holding information about an event passed to a callback or member function. `wx.Event` used to be a multipurpose event object, and is an abstract base class for other event classes. .. seealso:: `wx.CommandEvent `_, `wx.MouseEvent `_ Derived From ^^^^^^^^^^^^^ * `wx.Object <../Widgets/wx.Object.html>`_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.ActivateEvent `_, `wx.BookCtrlBaseEvent`, `wx.CalculateLayoutEvent `_, `wx.ChildFocusEvent `_, `wx.ChoicebookEvent`, `wx.ClipboardTextEvent `_, `wx.CloseEvent `_, `wx.CollapsiblePaneEvent `_, `wx.ColourPickerEvent `_, `wx.CommandEvent `_, `wx.ContextMenuEvent `_, `wx.DateEvent `_, `wx.DisplayChangedEvent`, `wx.DropFilesEvent `_, `wx.EraseEvent `_, `wx.FileDirPickerEvent `_, `wx.FindDialogEvent `_, `wx.FocusEvent `_, `wx.FontPickerEvent `_, `wx.HelpEvent `_, `wx.HyperlinkEvent `_, `wx.IconizeEvent `_, `wx.IdleEvent `_, `wx.InitDialogEvent `_, `wx.JoystickEvent `_, `wx.KeyEvent `_, `wx.ListEvent `_, `wx.ListbookEvent`, `wx.MaximizeEvent `_, `wx.MenuEvent `_, `wx.MouseCaptureChangedEvent `_, `wx.MouseCaptureLostEvent `_, `wx.MouseEvent `_, `wx.MoveEvent `_, `wx.NavigationKeyEvent`, `wx.NcPaintEvent`, `wx.NotebookEvent `_, `wx.NotifyEvent `_, `wx.PaintEvent `_, `wx.PaletteChangedEvent`, `wx.PowerEvent `_, `wx.ProcessEvent `_, `wx.PyCommandEvent `_, `wx.PyEvent `_, `wx.QueryLayoutInfoEvent `_, `wx.QueryNewPaletteEvent`, `wx.SashEvent `_, `wx.ScrollEvent `_, `wx.ScrollWinEvent `_, `wx.SetCursorEvent `_, `wx.ShowEvent`, `wx.SizeEvent `_, `wx.SpinEvent `_, `wx.SplitterEvent `_, `wx.SysColourChangedEvent `_, `wx.TaskBarIconEvent`, `wx.TextUrlEvent`, `wx.TimerEvent `_, `wx.ToolbookEvent`, `wx.TreeEvent `_, `wx.TreebookEvent `_, `wx.UpdateUIEvent `_, `wx.WindowCreateEvent `_, `wx.WindowDestroyEvent `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Clone <#Clone>`_ * `GetEventObject <#GetEventObject>`_ * `GetEventType <#GetEventType>`_ * `GetId <#GetId>`_ * `GetSkipped <#GetSkipped>`_ * `GetTimestamp <#GetTimestamp>`_ * `IsCommandEvent <#IsCommandEvent>`_ * `ResumePropagation <#ResumePropagation>`_ * `SetEventObject <#SetEventObject>`_ * `SetEventType <#SetEventType>`_ * `SetId <#SetId>`_ * `SetTimestamp <#SetTimestamp>`_ * `ShouldPropagate <#ShouldPropagate>`_ * `Skip <#Skip>`_ * `StopPropagation <#StopPropagation>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `EventObject <#EventObject>`_ * `EventType <#EventType>`_ * `Id <#Id>`_ * `Skipped <#Skipped>`_ * `Timestamp <#Timestamp>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(id=0, eventType=wx.wxEVT_NULL) Constructor. Should not need to be used directly by an application. **Parameters:** * `id` (int) * `eventType` (eventtype) | **Returns:** `wx.Event `_ -------- .. method:: Clone() Returns a copy of the event. Any event that is posted to the wxWidgets event system for later action (via `wx.EvtHandler.AddPendingEvent <../Widgets/wx.EvtHandler.html#AddPendingEvent>`_ or `wx.PostEvent <../wxFunctions.html#PostEvent>`_) must implement this method. All wxWidgets events fully implement this method, but any derived events implemented by the user should also implement this method just in case they (or some event derived from them) are ever posted. | **Returns:** `wx.Event `_ -------- .. method:: GetEventObject() Returns the object (usually a window) associated with the event, if any. | **Returns:** `wx.Object <../Widgets/wx.Object.html>`_ -------- .. method:: GetEventType() Returns the identifier of the given event type, such as ``wx.wxEVT_COMMAND_BUTTON_CLICKED``. | **Returns:** `int` -------- .. method:: GetId() Returns the identifier associated with this event, such as a button command id. | **Returns:** `int` -------- .. method:: GetSkipped() Returns ``True`` if the event handler should be skipped, ``False`` otherwise. | **Returns:** `bool` -------- .. method:: GetTimestamp() 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). | **Returns:** `long` -------- .. method:: IsCommandEvent() Returns ``True`` if the event is or is derived from `wx.CommandEvent `_ else it returns ``False``. | **Returns:** `bool` .. note:: This method exists only for optimization purposes. -------- .. method:: ResumePropagation(propagationLevel) Sets the propagation level to the given value (for example returned from an earlier call to `StopPropagation <#StopPropagation>`_). **Parameters:** * `propagationLevel` (int) -------- .. method:: SetEventObject(object) Sets the originating object. **Parameters:** * `object` (`wx.Object <../Widgets/wx.Object.html>`_) -------- .. method:: SetEventType(type) Sets the event type. **Parameters:** * `type` (int) -------- .. method:: SetId(id) Sets the identifier associated with this event, such as a button command id. **Parameters:** * `id` (int) -------- .. method:: SetTimestamp(timeStamp) Sets the timestamp for the event. **Parameters:** * `timeStamp` (long) -------- .. method:: ShouldPropagate() Test if this event should be propagated or not, i.e. if the propagation level is currently greater than 0. | **Returns:** `bool` -------- .. method:: Skip() 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. -------- .. method:: StopPropagation() Stop the event from propagating to its parent window. Returns the old propagation level value which may be later passed to `ResumePropagation <#ResumePropagation>`_ to allow propagating the event again. | **Returns:** `int` -------- Properties ^^^^^^^^^^ .. attribute:: EventObject See `GetEventObject <#GetEventObject>`_ and `SetEventObject <#SetEventObject>`_ .. attribute:: EventType See `GetEventType <#GetEventType>`_ and `SetEventType <#SetEventType>`_ .. attribute:: Id See `GetId <#GetId>`_ and `SetId <#SetId>`_ .. attribute:: Skipped See `GetSkipped <#GetSkipped>`_ .. attribute:: Timestamp See `GetTimestamp <#GetTimestamp>`_ and `SetTimestamp <#SetTimestamp>`_