1 \section{\class{wxTreeEvent
}}\label{wxtreeevent
}
3 A tree event holds information about events associated with wxTreeCtrl objects.
5 \wxheading{Derived from
}
7 \helpref{wxNotifyEvent
}{wxnotifyevent
}\\
8 \helpref{wxCommandEvent
}{wxcommandevent
}\\
9 \helpref{wxEvent
}{wxevent
}\\
10 \helpref{wxObject
}{wxobject
}
12 \wxheading{Include files
}
16 \wxheading{Event table macros
}
18 To process input from a tree control, use these event handler macros to direct input to member
19 functions that take a wxTreeEvent argument.
22 \begin{twocollist
}\itemsep=
0pt
23 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_DRAG(id, func)
}}{The user has started dragging an item with the left mouse button. The event handler must call
{\bf wxTreeEvent::Allow()
} for the drag operation to continue.
}
24 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_RDRAG(id, func)
}}{The user has started dragging an item with the right mouse button. The event handler must call
{\bf wxTreeEvent::Allow()
} for the drag operation to continue.
}
25 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_LABEL\_EDIT(id, func)
}}{Begin editing a label. This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
26 \twocolitem{{\bf EVT
\_TREE\_END\_DRAG(id, func)
}}{The user has released the mouse after dragging an item.
}
27 \twocolitem{{\bf EVT
\_TREE\_END\_LABEL\_EDIT(id, func)
}}{The user has finished editing a label. This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
28 \twocolitem{{\bf EVT
\_TREE\_DELETE\_ITEM(id, func)
}}{A tree item has been deleted.
}
29 % they're not very (or at all) useful currently
30 %\twocolitem{{\bf EVT\_TREE\_GET\_INFO(id, func)}}{Request information from the application.}
31 %\twocolitem{{\bf EVT\_TREE\_SET\_INFO(id, func)}}{Information is being supplied.}
32 \twocolitem{{\bf EVT
\_TREE\_ITEM\_ACTIVATED(id, func)
}}{An item has been activated (e.g. double clicked).
}
33 \twocolitem{{\bf EVT
\_TREE\_ITEM\_COLLAPSED(id, func)
}}{The item has been collapsed.
}
34 \twocolitem{{\bf EVT
\_TREE\_ITEM\_COLLAPSING(id, func)
}}{The item is being collapsed. This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
35 \twocolitem{{\bf EVT
\_TREE\_ITEM\_EXPANDED(id, func)
}}{The item has been expanded.
}
36 \twocolitem{{\bf EVT
\_TREE\_ITEM\_EXPANDING(id, func)
}}{The item is being expanded. This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
37 \twocolitem{{\bf EVT
\_TREE\_ITEM\_RIGHT\_CLICK(id, func)
}}{The user has clicked the item with the right mouse button.
}
38 \twocolitem{{\bf EVT
\_TREE\_ITEM\_MIDDLE\_CLICK(id, func)
}}{The user has clicked the item with the middle mouse button.
}
39 \twocolitem{{\bf EVT
\_TREE\_KEY\_DOWN(id, func)
}}{A key has been pressed.
}
40 \twocolitem{{\bf EVT
\_TREE\_SEL\_CHANGED(id, func)
}}{Selection has changed.
}
41 \twocolitem{{\bf EVT
\_TREE\_SEL\_CHANGING(id, func)
}}{Selection is changing. This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
42 \twocolitem{{\bf EVT
\_TREE\_KEY\_DOWN(id, func)
}}{A key has been pressed.
}
43 \twocolitem{{\bf EVT
\_TREE\_ITEM\_GETTOOLTIP(id, func)
}}{The opportunity to set the item tooltip
44 is being given to the application (call wxTreeEvent::SetToolTip). Windows only.
}
45 \twocolitem{{\bf 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.
}
46 \twocolitem{{\bf EVT
\_TREE\_STATE\_IMAGE\_CLICK(id, func)
}}{The state image has been clicked. Windows only.
}
51 \helpref{wxTreeCtrl
}{wxtreectrl
}
53 \latexignore{\rtfignore{\wxheading{Members
}}}
56 \membersection{wxTreeEvent::wxTreeEvent
}\label{wxtreeeventctor
}
58 \func{}{wxTreeEvent
}{\param{wxEventType
}{commandType
},
\param{wxTreeCtrl *
}{tree
},
\param{const wxTreeItemId\&
}{item = wxTreeItemId()
}}
60 Constructor, used by wxWidgets itself only.
63 \membersection{wxTreeEvent::GetKeyCode
}\label{wxtreeeventgetkeycode
}
65 \constfunc{int
}{GetKeyCode
}{}
67 Returns the key code if the event is a key event. Use
68 \helpref{GetKeyEvent
}{wxtreeeventgetkeyevent
} to get the values of the
69 modifier keys for this event (i.e. Shift or Ctrl).
72 \membersection{wxTreeEvent::GetItem
}\label{wxtreeeventgetitem
}
74 \constfunc{wxTreeItemId
}{GetItem
}{}
76 Returns the item (valid for all events).
79 \membersection{wxTreeEvent::GetKeyEvent
}\label{wxtreeeventgetkeyevent
}
81 \constfunc{const wxKeyEvent\&
}{GetKeyEvent
}{}
83 Returns the key event for
{\tt EVT
\_TREE\_KEY\_DOWN} events.
86 \membersection{wxTreeEvent::GetLabel
}\label{wxtreeeventgetlabel
}
88 \constfunc{const wxString\&
}{GetLabel
}{}
90 Returns the label if the event is a begin or end edit label event.
93 \membersection{wxTreeEvent::GetOldItem
}\label{wxtreeeventgetolditem
}
95 \constfunc{wxTreeItemId
}{GetOldItem
}{}
97 Returns the old item index (valid for EVT
\_TREE\_ITEM\_CHANGING and CHANGED events)
100 \membersection{wxTreeEvent::GetPoint
}\label{wxtreeeventgetpoint
}
102 \constfunc{wxPoint
}{GetPoint
}{}
104 Returns the position of the mouse pointer if the event is a drag or menu-context event.
105 In both cases the position is in client coordinates - i.e. relative to the wxTreeCtrl
106 window (so that you can pass it directly to e.g.
\helpref{wxWindow::PopupMenu
}{wxwindowpopupmenu
}).
109 \membersection{wxTreeEvent::IsEditCancelled
}\label{wxtreeeventiseditcancelled
}
111 \constfunc{bool
}{IsEditCancelled
}{}
113 Returns true if the label edit was cancelled. This should be
114 called from within an EVT
\_TREE\_END\_LABEL\_EDIT handler.
117 \membersection{wxTreeEvent::SetToolTip
}\label{wxtreeeventsettooltip
}
119 \func{void
}{SetToolTip
}{\param{const wxString\&
}{ tooltip
}}
121 Set the tooltip for the item (valid for EVT
\_TREE\_ITEM\_GETTOOLTIP events).