]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxCommandEvent}}\label{wxcommandevent} |
2 | ||
3 | This event class contains information about command events, which originate from a variety of | |
4 | simple controls. More complex controls, such as \helpref{wxTreeCtrl}{wxtreectrl}, have separate command event classes. | |
5 | ||
6 | \wxheading{Derived from} | |
7 | ||
8 | \helpref{wxEvent}{wxevent} | |
9 | ||
10 | \wxheading{Event table macros} | |
11 | ||
12 | To process a menu command event, use these event handler macros to direct input to member | |
13 | functions that take a wxCommandEvent argument. | |
14 | ||
15 | \twocolwidtha{7cm} | |
16 | \begin{twocollist}\itemsep=0pt | |
17 | \twocolitem{{\bf EVT\_COMMAND(id, cmd, func)}}{Process a command, supplying the window identifier, | |
18 | command event identifier, and member function.} | |
19 | \twocolitem{{\bf EVT\_COMMAND\_RANGE(id1, id2, cmd, func)}}{Process a command for a range | |
20 | of window identifiers, supplying the minimum and maximum window identifiers, | |
21 | command event identifier, and member function.} | |
22 | \twocolitem{{\bf EVT\_BUTTON(id, func)}}{Process a wxEVT\_COMMAND\_BUTTON\_CLICKED command, | |
23 | which is generated by a wxButton control.} | |
24 | \twocolitem{{\bf EVT\_CHECKBOX(id, func)}}{Process a wxEVT\_COMMAND\_CHECKBOX\_CLICKED command, | |
25 | which is generated by a wxCheckBox control.} | |
26 | \twocolitem{{\bf EVT\_CHOICE(id, func)}}{Process a wxEVT\_COMMAND\_CHOICE\_SELECTED command, | |
27 | which is generated by a wxChoice control.} | |
28 | \twocolitem{{\bf EVT\_LISTBOX(id, func)}}{Process a wxEVT\_COMMAND\_LISTBOX\_SELECTED command, | |
29 | which is generated by a wxListBox control.} | |
e14dccff | 30 | \twocolitem{{\bf EVT\_LISTBOX\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LISTBOX\_DOUBLECLICKED command, |
debe6624 | 31 | which is generated by a wxListBox control.} |
a660d684 KB |
32 | \twocolitem{{\bf EVT\_TEXT(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_UPDATED command, |
33 | which is generated by a wxTextCtrl control.} | |
34 | \twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER command, | |
35 | which is generated by a wxTextCtrl control.} | |
36 | \twocolitem{{\bf EVT\_MENU(id, func)}}{Process a wxEVT\_COMMAND\_MENU\_SELECTED command, | |
37 | which is generated by a menu item.} | |
38 | \twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_MENU\_RANGE command, | |
39 | which is generated by a range of menu items.} | |
40 | \twocolitem{{\bf EVT\_SLIDER(id, func)}}{Process a wxEVT\_COMMAND\_SLIDER\_UPDATED command, | |
41 | which is generated by a wxSlider control.} | |
42 | \twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED command, | |
43 | which is generated by a wxRadioBox control.} | |
44 | \twocolitem{{\bf EVT\_RADIOBUTTON(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBUTTON\_SELECTED command, | |
45 | which is generated by a wxRadioButton control.} | |
46 | \twocolitem{{\bf EVT\_SCROLLBAR(id, func)}}{Process a wxEVT\_COMMAND\_SCROLLBAR\_UPDATED command, | |
47 | which is generated by a wxScrollBar control. This is provided for compatibility only; | |
48 | more specific scrollbar event macros should be used instead (see \helpref{wxScrollEvent}{wxscrollevent}).} | |
49 | \twocolitem{{\bf EVT\_COMBOBOX(id, func)}}{Process a wxEVT\_COMMAND\_COMBOBOX\_SELECTED command, | |
50 | which is generated by a wxComboBox control.} | |
51 | \twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED command, | |
52 | which is generated by a toobar button.} | |
53 | \twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED command, | |
54 | which is generated by a toobar button.} | |
55 | \twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER command, | |
56 | which is generated by a toobar button.} | |
57 | \twocolitem{{\bf EVT\_COMMAND\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_CLICK command, | |
58 | which is generated by a control (Windows 95 and NT only).} | |
59 | \twocolitem{{\bf EVT\_COMMAND\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_DCLICK command, | |
60 | which is generated by a control (Windows 95 and NT only).} | |
61 | \twocolitem{{\bf EVT\_COMMAND\_RIGHT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RIGHT\_CLICK command, | |
62 | which is generated by a control (Windows 95 and NT only).} | |
63 | \twocolitem{{\bf EVT\_COMMAND\_SET\_FOCUS(id, func)}}{Process a wxEVT\_COMMAND\_SET\_FOCUS command, | |
64 | which is generated by a control (Windows 95 and NT only).} | |
65 | \twocolitem{{\bf EVT\_COMMAND\_KILL\_FOCUS(id, func)}}{Process a wxEVT\_COMMAND\_KILL\_FOCUS command, | |
66 | which is generated by a control (Windows 95 and NT only).} | |
67 | \twocolitem{{\bf EVT\_COMMAND\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_ENTER command, | |
68 | which is generated by a control.} | |
69 | \end{twocollist}% | |
70 | ||
71 | \latexignore{\rtfignore{\wxheading{Members}}} | |
72 | ||
73 | \membersection{wxCommandEvent::m\_clientData} | |
74 | ||
75 | \member{char*}{m\_clientData} | |
76 | ||
77 | Contains a pointer to client data for listboxes and choices, if the event | |
78 | was a selection. | |
79 | ||
80 | \membersection{wxCommandEvent::m\_commandInt} | |
81 | ||
82 | \member{int}{m\_commandInt} | |
83 | ||
84 | Contains an integer identifier corresponding to a listbox, choice or | |
85 | radiobox selection (only if the event was a selection, not a | |
86 | deselection), or a boolean value representing the value of a checkbox. | |
87 | ||
88 | \membersection{wxCommandEvent::m\_commandString} | |
89 | ||
90 | \member{char*}{m\_commandString} | |
91 | ||
92 | Contains a string corresponding to a listbox or choice selection. | |
93 | ||
94 | \membersection{wxCommandEvent::m\_extraLong} | |
95 | ||
96 | \member{long}{m\_extraLong} | |
97 | ||
98 | Extra information. If the event comes from a listbox selection, it is | |
99 | a boolean determining whether the event was a selection (TRUE) or a | |
100 | deselection (FALSE). A listbox deselection only occurs for | |
101 | multiple-selection boxes, and in this case the index and string values | |
102 | are indeterminate and the listbox must be examined by the application. | |
103 | ||
104 | \membersection{wxCommandEvent::wxCommandEvent} | |
105 | ||
106 | \func{}{wxCommandEvent}{\param{WXTYPE}{ commandEventType = 0}, \param{int}{ id = 0}} | |
107 | ||
108 | Constructor. | |
109 | ||
110 | \membersection{wxCommandEvent::Checked} | |
111 | ||
112 | \func{bool}{Checked}{\void} | |
113 | ||
114 | Returns TRUE or FALSE for a checkbox selection event. | |
115 | ||
116 | \membersection{wxCommandEvent::GetClientData} | |
117 | ||
118 | \func{char*}{GetClientData}{\void} | |
119 | ||
120 | Returns client data pointer for a listbox or choice selection event | |
121 | (not valid for a deselection). | |
122 | ||
123 | \membersection{wxCommandEvent::GetExtraLong} | |
124 | ||
125 | \func{long}{GetExtraLong}{\void} | |
126 | ||
127 | Returns the {\bf m\_extraLong} member. | |
128 | ||
129 | \membersection{wxCommandEvent::GetInt} | |
130 | ||
131 | \func{int}{GetInt}{\void} | |
132 | ||
133 | Returns the {\bf m\_commandInt} member. | |
134 | ||
135 | \membersection{wxCommandEvent::GetSelection} | |
136 | ||
137 | \func{int}{GetSelection}{\void} | |
138 | ||
139 | Returns item index for a listbox or choice selection event (not valid for | |
140 | a deselection). | |
141 | ||
142 | \membersection{wxCommandEvent::GetString} | |
143 | ||
144 | \func{char*}{GetString}{\void} | |
145 | ||
146 | Returns item string for a listbox or choice selection event (not valid for | |
147 | a deselection). | |
148 | ||
149 | \membersection{wxCommandEvent::IsSelection} | |
150 | ||
151 | \func{bool}{IsSelection}{\void} | |
152 | ||
153 | For a listbox or choice event, returns TRUE if it is a selection, FALSE if it | |
154 | is a deselection. | |
155 | ||
156 | \membersection{wxCommandEvent::SetClientData} | |
157 | ||
158 | \func{void}{SetClientData}{\param{char*}{ clientData}} | |
159 | ||
160 | Sets the client data for this event. | |
161 | ||
162 | \membersection{wxCommandEvent::SetExtraLong} | |
163 | ||
164 | \func{void}{SetExtraLong}{\param{int}{ extraLong}} | |
165 | ||
166 | Sets the {\bf m\_extraLong} member. | |
167 | ||
168 | \membersection{wxCommandEvent::SetInt} | |
169 | ||
170 | \func{void}{SetInt}{\param{int}{ intCommand}} | |
171 | ||
172 | Sets the {\bf m\_commandInt} member. | |
173 | ||
174 | \membersection{wxCommandEvent::SetString} | |
175 | ||
176 | \func{void}{SetString}{\param{char*}{ string}} | |
177 | ||
178 | Sets the {\bf m\_commandString} member. | |
179 | ||
e14dccff KB |
180 | |
181 | %%% Local Variables: | |
182 | %%% mode: latex | |
183 | %%% TeX-master: "referenc" | |
184 | %%% End: |