************ wx.TreeEvent ************ Inheritance diagram for `wx.TreeEvent`: | .. inheritance-diagram:: wx.TreeEvent | Description =========== A tree event holds information about events associated with `wx.TreeCtrl <../Widgets/wx.TreeCtrl.html>`_ objects. .. seealso:: `wx.TreeCtrl <../Widgets/wx.TreeCtrl.html>`_ Derived From ^^^^^^^^^^^^^ * `wx.NotifyEvent `_ * `wx.CommandEvent `_ * `wx.Event `_ * `wx.Object <../Widgets/wx.Object.html>`_ Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_TREE_BEGIN_DRAG(id, func) Begin dragging with the left mouse button. wx.EVT_TREE_BEGIN_RDRAG(id, func) Begin dragging with the right mouse button. wx.EVT_TREE_END_DRAG(id, func) End dragging with the left or right mouse button. wx.EVT_TREE_BEGIN_LABEL_EDIT(id, func) Begin editing a label. This can be prevented by calling `Veto`. wx.EVT_TREE_END_LABEL_EDIT(id, func) Finish editing a label. This can be prevented by calling `Veto`. wx.EVT_TREE_DELETE_ITEM(id, func) Delete an item. wx.EVT_TREE_GET_INFO(id, func) Request information from the application. wx.EVT_TREE_SET_INFO(id, func) Information is being supplied. wx.EVT_TREE_ITEM_ACTIVATED(id, func) The item has been activated, i.e. chosen by double clicking it with mouse or from keyboard wx.EVT_TREE_ITEM_COLLAPSED(id, func) The item has been collapsed. wx.EVT_TREE_ITEM_COLLAPSING(id, func) The item is being collapsed. This can be prevented by calling `Veto`. wx.EVT_TREE_ITEM_EXPANDED(id, func) The item has been expanded. wx.EVT_TREE_ITEM_EXPANDING(id, func) The item is being expanded. This can be prevented by calling `Veto`. wx.EVT_TREE_ITEM_RIGHT_CLICK(id, func) The user has clicked the item with the right mouse button. wx.EVT_TREE_ITEM_MIDDLE_CLICK(id, func) The user has clicked the item with the middle mouse button. wx.EVT_TREE_SEL_CHANGED(id, func) Selection has changed. wx.EVT_TREE_SEL_CHANGING(id, func) Selection is changing. This can be prevented by calling `Veto`. wx.EVT_TREE_KEY_DOWN(id, func) A key has been pressed. wx.EVT_TREE_ITEM_GETTOOLTIP(id, func) The opportunity to set the item tooltip is being given to the application (call `SetToolTip <#SetToolTip>`_). Windows only. wx.EVT_TREE_ITEM_MENU(id, func) The context menu for the selected item has been requested, either by a right click or by using the menu key. wx.EVT_TREE_STATE_IMAGE_CLICK(id, func) The state image has been clicked. Windows only. ================================================== ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetItem <#GetItem>`_ * `GetKeyCode <#GetKeyCode>`_ * `GetKeyEvent <#GetKeyEvent>`_ * `GetLabel <#GetLabel>`_ * `GetOldItem <#GetOldItem>`_ * `GetPoint <#GetPoint>`_ * `GetToolTip <#GetToolTip>`_ * `IsEditCancelled <#IsEditCancelled>`_ * `SetEditCanceled <#SetEditCanceled>`_ * `SetItem <#SetItem>`_ * `SetKeyEvent <#SetKeyEvent>`_ * `SetLabel <#SetLabel>`_ * `SetOldItem <#SetOldItem>`_ * `SetPoint <#SetPoint>`_ * `SetToolTip <#SetToolTip>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `EditCancelled <#EditCancelled>`_ * `Item <#Item>`_ * `KeyCode <#KeyCode>`_ * `KeyEvent <#KeyEvent>`_ * `Label <#Label>`_ * `OldItem <#OldItem>`_ * `Point <#Point>`_ * `ToolTip <#ToolTip>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(commandType=wx.wxEVT_NULL, id=0) Alternate constructor: `__init__(commandType, tree, item=None)` **Parameters:** * `commandType` (eventtype) * `id` (int) | **Returns:** `wx.TreeEvent `_ -------- .. method:: GetItem() Returns the item (valid for all events). | **Returns:** `wx.TreeItemId <../Widgets/wx.TreeItemId.html>`_ -------- .. method:: GetKeyCode() Returns the key code if the event is a key event. Use `GetKeyEvent <#GetKeyEvent>`_ to get the values of the modifier keys for this event (i.e. ``Shift`` or ``Ctrl``). | **Returns:** `int` -------- .. method:: GetKeyEvent() Returns the key event for ``wx.EVT_TREE_KEY_DOWN`` events. | **Returns:** `wx.KeyEvent `_ -------- .. method:: GetLabel() Returns the label if the event is a begin or end edit label event. | **Returns:** `string` -------- .. method:: GetOldItem() Returns the old item index (valid for ``wx.EVT_TREE_ITEM_CHANGING`` and ``CHANGED`` events) | **Returns:** `wx.TreeItemId <../Widgets/wx.TreeItemId.html>`_ -------- .. method:: GetPoint() Returns the position of the mouse pointer if the event is a drag or menu-context event. In both cases the position is in client coordinates - i.e. relative to the `wx.TreeCtrl <../Widgets/wx.TreeCtrl.html>`_ window (so that you can pass it directly to e.g. `wx.Window.PopupMenu <../Widgets/wx.Window.html#PopupMenu>`_). | **Returns:** `wx.Point <../Widgets/wx.Point.html>`_ -------- .. method:: GetToolTip() Get the tooltip for the item (valid for ``wx.EVT_TREE_ITEM_GETTOOLTIP`` events). Windows only. | **Returns:** `string` -------- .. method:: IsEditCancelled() Returns ``True`` if the label edit was cancelled. This should be called from within an ``wx.EVT_TREE_END_LABEL_EDIT`` handler. | **Returns:** `bool` -------- .. method:: SetEditCanceled(editCancelled) | **Parameters:** * `editCancelled` (bool) -------- .. method:: SetItem(item) | **Parameters:** * `item` (`wx.TreeItemId <../Widgets/wx.TreeItemId.html>`_) -------- .. method:: SetKeyEvent(evt) | **Parameters:** * `evt` (`wx.KeyEvent `_) -------- .. method:: SetLabel(label) | **Parameters:** * `label` (string) -------- .. method:: SetOldItem(item) | **Parameters:** * `item` (`wx.TreeItemId <../Widgets/wx.TreeItemId.html>`_) -------- .. method:: SetPoint(pt) | **Parameters:** * `pt` (`wx.Point <../Widgets/wx.Point.html>`_) -------- .. method:: SetToolTip(tooltip) Set the tooltip for the item (valid for ``wx.EVT_TREE_ITEM_GETTOOLTIP`` events). Windows only. **Parameters:** * `tooltip` (string) -------- Properties ^^^^^^^^^^ .. attribute:: EditCancelled See `IsEditCancelled <#IsEditCancelled>`_ and `SetEditCanceled <#SetEditCanceled>`_ .. attribute:: Item See `GetItem <#GetItem>`_ and `SetItem <#SetItem>`_ .. attribute:: KeyCode See `GetKeyCode <#GetKeyCode>`_ .. attribute:: KeyEvent See `GetKeyEvent <#GetKeyEvent>`_ and `SetKeyEvent <#SetKeyEvent>`_ .. attribute:: Label See `GetLabel <#GetLabel>`_ and `SetLabel <#SetLabel>`_ .. attribute:: OldItem See `GetOldItem <#GetOldItem>`_ and `SetOldItem <#SetOldItem>`_ .. attribute:: Point See `GetPoint <#GetPoint>`_ and `SetPoint <#SetPoint>`_ .. attribute:: ToolTip See `GetToolTip <#GetToolTip>`_ and `SetToolTip <#SetToolTip>`_