]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/treeevt.tex
Moved desktop margin options to a more sensible place
[wxWidgets.git] / docs / latex / wx / treeevt.tex
CommitLineData
a660d684
KB
1\section{\class{wxTreeEvent}}\label{wxtreeevent}
2
3A tree event holds information about events associated with wxTreeCtrl objects.
4
5\wxheading{Derived from}
6
86f975a8 7\helpref{wxNotifyEvent}{wxnotifyevent}\\
a660d684
KB
8\helpref{wxCommandEvent}{wxcommandevent}\\
9\helpref{wxEvent}{wxevent}\\
10\helpref{wxObject}{wxobject}
11
954b8ae6
JS
12\wxheading{Include files}
13
14<wx/treectrl.h>
15
a660d684
KB
16\wxheading{Event table macros}
17
18To process input from a tree control, use these event handler macros to direct input to member
19functions that take a wxTreeEvent argument.
20
2e0ce62d 21\twocolwidtha{9cm}
a660d684 22\begin{twocollist}\itemsep=0pt
2b5f62a0
VZ
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.}
fd128b0c 25\twocolitem{{\bf EVT\_TREE\_BEGIN\_LABEL\_EDIT(id, func)}}{Begin editing a label. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.}
2e0ce62d
VZ
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.}
dbd94b75 29% they're not very (or at all) useful currently
2e0ce62d
VZ
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).}
fb96bc75
VZ
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}.}
2e0ce62d
VZ
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.}
a660d684 40\twocolitem{{\bf EVT\_TREE\_SEL\_CHANGED(id, func)}}{Selection has changed.}
fd128b0c 41\twocolitem{{\bf EVT\_TREE\_SEL\_CHANGING(id, func)}}{Selection is changing. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.}
156194e1
JS
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
44is being given to the application (call wxTreeEvent::SetToolTip). Windows only.}
4acaa5e2 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.}
6bce9756 46\twocolitem{{\bf EVT\_TREE\_STATE\_IMAGE\_CLICK(id, func)}}{The state image has been clicked. Windows only.}
d2c2afc9 47\end{twocollist}
a660d684
KB
48
49\wxheading{See also}
50
51\helpref{wxTreeCtrl}{wxtreectrl}
52
53\latexignore{\rtfignore{\wxheading{Members}}}
54
0d93bb50 55
15d83f72 56\membersection{wxTreeEvent::wxTreeEvent}\label{wxtreeeventctor}
a660d684 57
8e3fa7ee 58\func{}{wxTreeEvent}{\param{wxEventType }{commandType}, \param{wxTreeCtrl *}{tree}, \param{const wxTreeItemId\&}{item = wxTreeItemId()}}
0d93bb50
VZ
59
60Constructor, used by wxWidgets itself only.
a660d684 61
a660d684 62
15d83f72 63\membersection{wxTreeEvent::GetKeyCode}\label{wxtreeeventgetkeycode}
b09bda68 64
62b77e42 65\constfunc{int}{GetKeyCode}{}
b09bda68 66
154b6b0f 67Returns the key code if the event is a key event. Use
b09bda68
VZ
68\helpref{GetKeyEvent}{wxtreeeventgetkeyevent} to get the values of the
69modifier keys for this event (i.e. Shift or Ctrl).
70
0d93bb50 71
15d83f72 72\membersection{wxTreeEvent::GetItem}\label{wxtreeeventgetitem}
a660d684 73
515da557 74\constfunc{wxTreeItemId}{GetItem}{}
a660d684 75
2e0ce62d 76Returns the item (valid for all events).
a660d684 77
0d93bb50 78
b09bda68 79\membersection{wxTreeEvent::GetKeyEvent}\label{wxtreeeventgetkeyevent}
a660d684 80
b09bda68 81\constfunc{const wxKeyEvent\&}{GetKeyEvent}{}
a660d684 82
b09bda68 83Returns the key event for {\tt EVT\_TREE\_KEY\_DOWN} events.
a660d684 84
0d93bb50 85
15d83f72 86\membersection{wxTreeEvent::GetLabel}\label{wxtreeeventgetlabel}
a660d684 87
b09bda68 88\constfunc{const wxString\&}{GetLabel}{}
a660d684 89
154b6b0f 90Returns the label if the event is a begin or end edit label event.
a660d684 91
0d93bb50 92
15d83f72 93\membersection{wxTreeEvent::GetOldItem}\label{wxtreeeventgetolditem}
a660d684 94
b09bda68 95\constfunc{wxTreeItemId}{GetOldItem}{}
a660d684 96
b09bda68 97Returns the old item index (valid for EVT\_TREE\_ITEM\_CHANGING and CHANGED events)
a660d684 98
0d93bb50
VZ
99
100\membersection{wxTreeEvent::GetPoint}\label{wxtreeeventgetpoint}
515da557 101
b09bda68 102\constfunc{wxPoint}{GetPoint}{}
515da557 103
0d93bb50
VZ
104Returns the position of the mouse pointer if the event is a drag or menu-context event.
105In both cases the position is in client coordinates - i.e. relative to the wxTreeCtrl
106window (so that you can pass it directly to e.g. \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu}).
7e9a386e 107
0d93bb50
VZ
108
109\membersection{wxTreeEvent::IsEditCancelled}\label{wxtreeeventiseditcancelled}
dd23c25c
JS
110
111\constfunc{bool}{IsEditCancelled}{}
112
cc81d32f 113Returns true if the label edit was cancelled. This should be
dd23c25c
JS
114called from within an EVT\_TREE\_END\_LABEL\_EDIT handler.
115
0d93bb50 116
15d83f72 117\membersection{wxTreeEvent::SetToolTip}\label{wxtreeeventsettooltip}
156194e1
JS
118
119\func{void}{SetToolTip}{\param{const wxString\&}{ tooltip}}
120
121Set the tooltip for the item (valid for EVT\_TREE\_ITEM\_GETTOOLTIP events).
122Windows only.
123