Search documentation of wx

# View Source wxTreeEvent (wx v2.4.2)

Functions for wxTreeEvent class

A tree event holds information about events associated with `wxTreeCtrl` objects.

To process input from a tree control, use these event handler macros to direct input to member functions that take a `wxTreeEvent` argument.

See: `wxTreeCtrl`

This class is derived (and can use functions) from: `wxNotifyEvent` `wxCommandEvent` `wxEvent`

wxWidgets docs: wxTreeEvent

## Events

Use `wxEvtHandler:connect/3` with `wxTreeEventType` to subscribe to events of this type.

# Summary

## Types

wxTree()
wxTreeEvent()
wxTreeEventType()

## Functions

getItem(This)

Returns the item (valid for all events).

getKeyCode(This)

Returns the key code if the event is a key event.

getKeyEvent(This)

Returns the key event for `EVT_TREE_KEY_DOWN` events.

getLabel(This)

Returns the label if the event is a begin or end edit label event.

getOldItem(This)

Returns the old item index (valid for `EVT_TREE_SEL_CHANGING` and `EVT_TREE_SEL_CHANGED` events).

getPoint(This)

Returns the position of the mouse pointer if the event is a drag or menu-context event.

isEditCancelled(This)

Returns true if the label edit was cancelled.

setToolTip(This, Tooltip)

Set the tooltip for the item (valid for `EVT_TREE_ITEM_GETTOOLTIP` events).

# Types

Link to this type

# wxTree()

View Source

    -type wxTree() ::
              #wxTree{type :: wxTreeEvent:wxTreeEventType(),
                      item :: integer(),
                      itemOld :: integer(),
                      pointDrag :: {X :: integer(), Y :: integer()}}.

Link to this type

# wxTreeEvent()

View Source

    -type wxTreeEvent() :: wx:wx_object().

Link to this type

# wxTreeEventType()

View Source

    -type wxTreeEventType() ::
              command_tree_begin_drag | command_tree_begin_rdrag | command_tree_begin_label_edit |
              command_tree_end_label_edit | command_tree_delete_item | command_tree_get_info |
              command_tree_set_info | command_tree_item_expanded | command_tree_item_expanding |
              command_tree_item_collapsed | command_tree_item_collapsing | command_tree_sel_changed |
              command_tree_sel_changing | command_tree_key_down | command_tree_item_activated |
              command_tree_item_right_click | command_tree_item_middle_click | command_tree_end_drag |
              command_tree_state_image_click | command_tree_item_gettooltip | command_tree_item_menu |
              dirctrl_selectionchanged | dirctrl_fileactivated.

# Functions

Link to this function

# getItem(This)

View Source

    -spec getItem(This) -> integer() when This :: wxTreeEvent().

Returns the item (valid for all events).

Link to this function

# getKeyCode(This)

View Source

    -spec getKeyCode(This) -> integer() when This :: wxTreeEvent().

Returns the key code if the event is a key event.

Use `getKeyEvent/1` to get the values of the modifier keys for this event (i.e. Shift or Ctrl).

Link to this function

# getKeyEvent(This)

View Source

    -spec getKeyEvent(This) -> wxKeyEvent:wxKeyEvent() when This :: wxTreeEvent().

Returns the key event for `EVT_TREE_KEY_DOWN` events.

Link to this function

# getLabel(This)

View Source

    -spec getLabel(This) -> unicode:charlist() when This :: wxTreeEvent().

Returns the label if the event is a begin or end edit label event.

Link to this function

# getOldItem(This)

View Source

    -spec getOldItem(This) -> integer() when This :: wxTreeEvent().

Returns the old item index (valid for `EVT_TREE_SEL_CHANGING` and `EVT_TREE_SEL_CHANGED` events).

Link to this function

# getPoint(This)

View Source

    -spec getPoint(This) -> {X :: integer(), Y :: integer()} when This :: wxTreeEvent().

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 `wxTreeCtrl` window (so that you can pass it directly to e.g. `wxWindow:popupMenu/4`).

Link to this function

# isEditCancelled(This)

View Source

    -spec isEditCancelled(This) -> boolean() when This :: wxTreeEvent().

Returns true if the label edit was cancelled.

This should be called from within an `EVT_TREE_END_LABEL_EDIT` handler.

Link to this function

# setToolTip(This, Tooltip)

View Source

    -spec setToolTip(This, Tooltip) -> ok when This :: wxTreeEvent(), Tooltip :: unicode:chardata().

Set the tooltip for the item (valid for `EVT_TREE_ITEM_GETTOOLTIP` events).

Windows only.