]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/listevt.tex
reSWIGged
[wxWidgets.git] / docs / latex / wx / listevt.tex
CommitLineData
a660d684
KB
1\section{\class{wxListEvent}}\label{wxlistevent}
2
3A list event holds information about events associated with wxListCtrl 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/listctrl.h>
15
a660d684
KB
16\wxheading{Event table macros}
17
18To process input from a list control, use these event handler macros to direct input to member
19functions that take a wxListEvent argument.
20
21\twocolwidtha{7cm}
22\begin{twocollist}\itemsep=0pt
23\twocolitem{{\bf EVT\_LIST\_BEGIN\_DRAG(id, func)}}{Begin dragging with the left mouse button.}
24\twocolitem{{\bf EVT\_LIST\_BEGIN\_RDRAG(id, func)}}{Begin dragging with the right mouse button.}
fd128b0c
RR
25\twocolitem{{\bf EVT\_LIST\_BEGIN\_LABEL\_EDIT(id, func)}}{Begin editing a label. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.}
26\twocolitem{{\bf EVT\_LIST\_END\_LABEL\_EDIT(id, func)}}{Finish editing a label. This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.}
a660d684
KB
27\twocolitem{{\bf EVT\_LIST\_DELETE\_ITEM(id, func)}}{Delete an item.}
28\twocolitem{{\bf EVT\_LIST\_DELETE\_ALL\_ITEMS(id, func)}}{Delete all items.}
a660d684
KB
29\twocolitem{{\bf EVT\_LIST\_ITEM\_SELECTED(id, func)}}{The item has been selected.}
30\twocolitem{{\bf EVT\_LIST\_ITEM\_DESELECTED(id, func)}}{The item has been deselected.}
8b17ba72 31\twocolitem{{\bf EVT\_LIST\_ITEM\_ACTIVATED(id, func)}}{The item has been activated (ENTER or double click).}
0ddefeb0 32\twocolitem{{\bf EVT\_LIST\_ITEM\_FOCUSED(id, func)}}{The currently focused item has changed.}
c229e50d
JS
33\twocolitem{{\bf EVT\_LIST\_ITEM\_MIDDLE\_CLICK(id, func)}}{The middle mouse button has been clicked on an item.}
34\twocolitem{{\bf EVT\_LIST\_ITEM\_RIGHT\_CLICK(id, func)}}{The right mouse button has been clicked on an item.}
a660d684
KB
35\twocolitem{{\bf EVT\_LIST\_KEY\_DOWN(id, func)}}{A key has been pressed.}
36\twocolitem{{\bf EVT\_LIST\_INSERT\_ITEM(id, func)}}{An item has been inserted.}
37\twocolitem{{\bf EVT\_LIST\_COL\_CLICK(id, func)}}{A column ({\bf m\_col}) has been left-clicked.}
62313c27 38\twocolitem{{\bf EVT\_LIST\_COL\_RIGHT\_CLICK(id, func)}}{A column ({\bf m\_col}) (which can be $-1$ if the click occured outside any column) has been right-clicked.}
11358d39
VZ
39\twocolitem{{\bf EVT\_LIST\_COL\_BEGIN\_DRAG(id, func)}}{The user started resizing a column - can be vetoed.}
40\twocolitem{{\bf EVT\_LIST\_COL\_DRAGGING(id, func)}}{The divider between columns is being dragged.}
41\twocolitem{{\bf EVT\_LIST\_COL\_END\_DRAG(id, func)}}{A column has been resized by the user.}
614391dc 42\twocolitem{{\bf EVT\_LIST\_CACHE\_HINT(id, func)}}{Prepare cache for a virtual list control}
a660d684
KB
43\end{twocollist}%
44
45\wxheading{See also}
46
47\helpref{wxListCtrl}{wxlistctrl}
48
49\latexignore{\rtfignore{\wxheading{Members}}}
50
d2ed74b9 51
a660d684
KB
52\membersection{wxListEvent::wxListEvent}
53
54\func{}{wxListEvent}{\param{WXTYPE }{commandType = 0}, \param{int }{id = 0}}
55
56Constructor.
57
d2ed74b9 58
614391dc
VZ
59\membersection{wxListEvent::GetCacheFrom}\label{wxlisteventgetcachefrom}
60
61\constfunc{long}{GetCacheFrom}{\void}
62
63For {\tt EVT\_LIST\_CACHE\_HINT} event only: return the first item which the
64list control advises us to cache.
65
d2ed74b9 66
614391dc
VZ
67\membersection{wxListEvent::GetCacheTo}\label{wxlisteventgetcacheto}
68
69\constfunc{long}{GetCacheTo}{\void}
70
71For {\tt EVT\_LIST\_CACHE\_HINT} event only: return the last item (inclusive)
72which the list control advises us to cache.
73
d2ed74b9 74
62b77e42 75\membersection{wxListEvent::GetKeyCode}\label{wxlisteventgetkeycode}
a660d684 76
62b77e42 77\constfunc{int}{GetKeyCode}{\void}
a660d684
KB
78
79Key code if the event is a keypress event.
80
d2ed74b9 81
f6bcfd97 82\membersection{wxListEvent::GetIndex}\label{wxlisteventgetindex}
a660d684 83
f6bcfd97 84\constfunc{long}{GetIndex}{\void}
a660d684
KB
85
86The item index.
87
d2ed74b9 88
f6bcfd97 89\membersection{wxListEvent::GetColumn}\label{wxlisteventgetcolumn}
a660d684 90
f6bcfd97 91\constfunc{int}{GetColumn}{\void}
a660d684 92
11358d39
VZ
93The column position: it is only used with {\tt COL} events. For the column
94dragging events, it is the column to the left of the divider being dragged, for
95the column click events it may be $-1$ if the user clicked in the list control
96header outside any column.
a660d684 97
d2ed74b9 98
f6bcfd97 99\membersection{wxListEvent::GetPoint}\label{wxlisteventgetpoint}
a660d684 100
f6bcfd97 101\constfunc{wxPoint}{GetPoint}{\void}
a660d684
KB
102
103The position of the mouse pointer if the event is a drag event.
104
a660d684 105
d2ed74b9 106
f6bcfd97
BP
107\membersection{wxListEvent::GetLabel}\label{wxlisteventgetlabel}
108
109\constfunc{const wxString\&}{GetLabel}{\void}
110
d2ed74b9
VZ
111The (new) item label for \texttt{EVT\_LIST\_END\_LABEL\_EDIT} event.
112
f6bcfd97
BP
113
114\membersection{wxListEvent::GetText}\label{wxlisteventgettext}
115
116\constfunc{const wxString\&}{GetText}{\void}
117
118The text.
119
d2ed74b9 120
f6bcfd97
BP
121\membersection{wxListEvent::GetImage}\label{wxlisteventgetimage}
122
123\constfunc{int}{GetImage}{\void}
124
125The image.
126
d2ed74b9 127
f6bcfd97
BP
128\membersection{wxListEvent::GetData}\label{wxlisteventgetdata}
129
130\constfunc{long}{GetData}{\void}
131
132The data.
133
d2ed74b9 134
f6bcfd97
BP
135\membersection{wxListEvent::GetMask}\label{wxlisteventgetmask}
136
137\constfunc{long}{GetMask}{\void}
138
139The mask.
140
d2ed74b9 141
f6bcfd97
BP
142\membersection{wxListEvent::GetItem}\label{wxlisteventgetitem}
143
144\constfunc{const wxListItem\&}{GetItem}{\void}
a660d684
KB
145
146An item object, used by some events. See also \helpref{wxListCtrl::SetItem}{wxlistctrlsetitem}.
147
148
d2ed74b9
VZ
149\membersection{wxListEvent::IsEditCancelled}\label{wxlisteventiseditcancelled}
150
151\constfunc{bool}{IsEditCancelled}{\void}
152
153This method only makes sense for \texttt{EVT\_LIST\_END\_LABEL\_EDIT} message
154and returns \true if it the label editing has been cancelled by the user
155(\helpref{GetLabel}{wxlisteventgetlabel} returns an empty string in this case
156but it doesn't allow to distinguish between really cancelling the edit and,
157admittedly rare, case when the user wants to rename it to an empty string0.
158
159