AGW Logo

agw_title CommandTreeEvent

CommandTreeEvent is a special subclassing of wx.PyCommandEvent.

Note

Not all the accessors make sense for all the events, see the event description for every method in this class.

hierarchy Inheritance Diagram

Inheritance diagram for: CommandTreeEvent

Inheritance diagram of CommandTreeEvent


subclasses Known Subclasses


method_summary Methods Summary

__init__Default class constructor.
GetItemGets the item on which the operation was performed or the newly selected
GetKeyCodeReturns the virtual key code.
GetKeyEventReturns the keyboard data (for EVT_TREE_KEY_DOWN event only).
GetLabelReturns the item text (for EVT_TREE_BEGIN_LABEL_EDIT and
GetOldItemReturns the previously selected item for EVT_TREE_SEL_CHANGED and
GetPointReturns the point where the mouse was when the drag operation started
GetToolTipReturns the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events).
IsEditCancelledReturns the edit cancel flag (for EVT_TREE_BEGIN_LABEL_EDIT and
SetEditCanceledSets the edit cancel flag (for EVT_TREE_BEGIN_LABEL_EDIT and
SetItemSets the item on which the operation was performed or the newly selected
SetKeyEventSets the keyboard data (for EVT_TREE_KEY_DOWN event only).
SetLabelSets the item text (for EVT_TREE_BEGIN_LABEL_EDIT and
SetOldItemReturns the previously selected item for EVT_TREE_SEL_CHANGED and
SetPointSets the point where the mouse was when the drag operation started
SetToolTipSets the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events).

API Class API

class CommandTreeEvent(wx.PyCommandEvent)[source]

CommandTreeEvent is a special subclassing of wx.PyCommandEvent.

Note

Not all the accessors make sense for all the events, see the event description for every method in this class.



__init__(evtType, evtId, item=None, evtKey=None, point=None, label=None)[source]

Default class constructor. For internal use: do not call it in your code!

Parameters:
  • evtType (integer) – the event type;
  • evtId (integer) – the event identifier;
  • item – an instance of GenericTreeItem;
  • evtKey (integer) – a character ordinal;
  • point – an instance of wx.Point;
  • label (string) – a GenericTreeItem text label.


GetItem()[source]

Gets the item on which the operation was performed or the newly selected item for EVT_TREE_SEL_CHANGED and EVT_TREE_SEL_CHANGING events.

Returns:An instance of GenericTreeItem.


GetKeyCode()[source]

Returns the virtual key code. ASCII events return normal ASCII values, while non-ASCII events return values such as wx.WXK_LEFT for the left cursor key.

This method is for EVT_TREE_KEY_DOWN events only.

Returns:An integer representing the virtual key code.

Note

In Unicode build, the returned value is meaningful only if the user entered a character that can be represented in current locale’s default charset. You can obtain the corresponding Unicode character using GetUnicodeKey.



GetKeyEvent()[source]

Returns the keyboard data (for EVT_TREE_KEY_DOWN event only).

Returns:An instance of wx.KeyEvent.


GetLabel()[source]

Returns the item text (for EVT_TREE_BEGIN_LABEL_EDIT and EVT_TREE_END_LABEL_EDIT events only).

Returns:A string containing the item text.


GetOldItem()[source]

Returns the previously selected item for EVT_TREE_SEL_CHANGED and EVT_TREE_SEL_CHANGING events.

Returns:An instance of GenericTreeItem.


GetPoint()[source]

Returns the point where the mouse was when the drag operation started (for EVT_TREE_BEGIN_DRAG and EVT_TREE_BEGIN_RDRAG events only) or the click position.

Returns:An instance of wx.Point.


GetToolTip()[source]

Returns the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events).

Returns:A string containing the item tooltip.


IsEditCancelled()[source]

Returns the edit cancel flag (for EVT_TREE_BEGIN_LABEL_EDIT and EVT_TREE_END_LABEL_EDIT events only).

Returns:True is the item editing has been cancelled, False otherwise.


SetEditCanceled(editCancelled)[source]

Sets the edit cancel flag (for EVT_TREE_BEGIN_LABEL_EDIT and EVT_TREE_END_LABEL_EDIT events only).

Parameters:editCancelled (bool) – True to cancel the editing, False otherwise.


SetItem(item)[source]

Sets the item on which the operation was performed or the newly selected item for EVT_TREE_SEL_CHANGED and EVT_TREE_SEL_CHANGING events.

Parameters:item – an instance of GenericTreeItem.


SetKeyEvent(event)[source]

Sets the keyboard data (for EVT_TREE_KEY_DOWN event only).

Parameters:event – a CommandTreeEvent event to be processed.


SetLabel(label)[source]

Sets the item text (for EVT_TREE_BEGIN_LABEL_EDIT and EVT_TREE_END_LABEL_EDIT events only).

Parameters:label (string) – a string containing the new item text.


SetOldItem(item)[source]

Returns the previously selected item for EVT_TREE_SEL_CHANGED and EVT_TREE_SEL_CHANGING events.

Parameters:item – an instance of GenericTreeItem.


SetPoint(pt)[source]

Sets the point where the mouse was when the drag operation started (for EVT_TREE_BEGIN_DRAG and EVT_TREE_BEGIN_RDRAG events only) or the click position.

Parameters:pt – an instance of wx.Point.



SetToolTip(toolTip)[source]

Sets the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events).

Parameters:tooltip (string) – a string representing the item tooltip.
Tree

Table Of Contents

Previous topic

customtreectrl

Next topic

CustomTreeCtrl