1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxCommandEvent}}\label{wxcommandevent}
|
|
|
|
|
|
|
|
This event class contains information about command events, which originate from a variety of
|
|
|
|
simple controls. More complex controls, such as \helpref{wxTreeCtrl}{wxtreectrl}, have separate command event classes.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxEvent}{wxevent}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/event.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Event table macros}
|
|
|
|
|
|
|
|
To process a menu command event, use these event handler macros to direct input to member
|
|
|
|
functions that take a wxCommandEvent argument.
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
1999-02-02 07:37:14 -05:00
|
|
|
\twocolitem{{\bf EVT\_COMMAND(id, event, func)}}{Process a command, supplying the window identifier,
|
1998-05-20 10:25:30 -04:00
|
|
|
command event identifier, and member function.}
|
1999-02-02 07:37:14 -05:00
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_RANGE(id1, id2, event, func)}}{Process a command for a range
|
1998-05-20 10:25:30 -04:00
|
|
|
of window identifiers, supplying the minimum and maximum window identifiers,
|
|
|
|
command event identifier, and member function.}
|
|
|
|
\twocolitem{{\bf EVT\_BUTTON(id, func)}}{Process a wxEVT\_COMMAND\_BUTTON\_CLICKED command,
|
|
|
|
which is generated by a wxButton control.}
|
|
|
|
\twocolitem{{\bf EVT\_CHECKBOX(id, func)}}{Process a wxEVT\_COMMAND\_CHECKBOX\_CLICKED command,
|
|
|
|
which is generated by a wxCheckBox control.}
|
|
|
|
\twocolitem{{\bf EVT\_CHOICE(id, func)}}{Process a wxEVT\_COMMAND\_CHOICE\_SELECTED command,
|
|
|
|
which is generated by a wxChoice control.}
|
2004-10-29 21:54:17 -04:00
|
|
|
\twocolitem{{\bf EVT\_COMBOBOX(id, func)}}{Process a wxEVT\_COMMAND\_COMBOBOX\_SELECTED command,
|
|
|
|
which is generated by a wxComboBox control.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\twocolitem{{\bf EVT\_LISTBOX(id, func)}}{Process a wxEVT\_COMMAND\_LISTBOX\_SELECTED command,
|
|
|
|
which is generated by a wxListBox control.}
|
1998-07-17 08:34:50 -04:00
|
|
|
\twocolitem{{\bf EVT\_LISTBOX\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LISTBOX\_DOUBLECLICKED command,
|
1998-07-04 11:17:59 -04:00
|
|
|
which is generated by a wxListBox control.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\twocolitem{{\bf EVT\_MENU(id, func)}}{Process a wxEVT\_COMMAND\_MENU\_SELECTED command,
|
|
|
|
which is generated by a menu item.}
|
|
|
|
\twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_MENU\_RANGE command,
|
|
|
|
which is generated by a range of menu items.}
|
2002-02-23 18:16:32 -05:00
|
|
|
\twocolitem{{\bf EVT\_CONTEXT\_MENU(func)}}{Process the event generated
|
|
|
|
when the user has requested a popup menu to appear by pressing a special
|
|
|
|
keyboard key (under Windows) or by right clicking the mouse.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED command,
|
|
|
|
which is generated by a wxRadioBox control.}
|
|
|
|
\twocolitem{{\bf EVT\_RADIOBUTTON(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBUTTON\_SELECTED command,
|
|
|
|
which is generated by a wxRadioButton control.}
|
|
|
|
\twocolitem{{\bf EVT\_SCROLLBAR(id, func)}}{Process a wxEVT\_COMMAND\_SCROLLBAR\_UPDATED command,
|
|
|
|
which is generated by a wxScrollBar control. This is provided for compatibility only;
|
|
|
|
more specific scrollbar event macros should be used instead (see \helpref{wxScrollEvent}{wxscrollevent}).}
|
2004-10-29 21:54:17 -04:00
|
|
|
\twocolitem{{\bf EVT\_SLIDER(id, func)}}{Process a wxEVT\_COMMAND\_SLIDER\_UPDATED command,
|
|
|
|
which is generated by a wxSlider control.}
|
|
|
|
\twocolitem{{\bf EVT\_TEXT(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_UPDATED command,
|
|
|
|
which is generated by a wxTextCtrl control.}
|
|
|
|
\twocolitem{{\bf EVT\_TEXT\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_ENTER command,
|
|
|
|
which is generated by a wxTextCtrl control. Note that you must use
|
|
|
|
wxTE\_PROCESS\_ENTER flag when creating the control if you want it to generate
|
|
|
|
such events.}
|
|
|
|
\twocolitem{{\bf EVT\_TEXT\_MAXLEN(id, func)}}{Process a wxEVT\_COMMAND\_TEXT\_MAXLEN command,
|
|
|
|
which is generated by a wxTextCtrl control when the user tries to enter more
|
|
|
|
characters into it than the limit previously set with
|
|
|
|
\helpref{SetMaxLength}{wxtextctrlsetmaxlength}.}
|
2006-01-19 04:36:57 -05:00
|
|
|
\twocolitem{{\bf EVT\_TOGGLEBUTTON(id, func)}}{Process a wxEVT\_COMMAND\_TOGGLEBUTTON\_CLICKED event.}
|
1998-07-27 05:47:57 -04:00
|
|
|
\twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
|
|
|
|
(a synonym for wxEVT\_COMMAND\_MENU\_SELECTED). Pass the id of the tool.}
|
|
|
|
\twocolitem{{\bf EVT\_TOOL\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
|
2003-12-11 02:30:20 -05:00
|
|
|
for a range of identifiers. Pass the ids of the tools.}
|
1998-07-27 05:47:57 -04:00
|
|
|
\twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event.
|
|
|
|
Pass the id of the tool.}
|
|
|
|
\twocolitem{{\bf EVT\_TOOL\_RCLICKED\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event
|
|
|
|
for a range of ids. Pass the ids of the tools.}
|
|
|
|
\twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER event.
|
|
|
|
Pass the id of the toolbar itself. The value of wxCommandEvent::GetSelection is the tool id, or -1 if the mouse cursor has moved off a tool.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_CLICK command,
|
|
|
|
which is generated by a control (Windows 95 and NT only).}
|
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_DCLICK command,
|
|
|
|
which is generated by a control (Windows 95 and NT only).}
|
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_RIGHT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_RIGHT\_CLICK command,
|
|
|
|
which is generated by a control (Windows 95 and NT only).}
|
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_SET\_FOCUS(id, func)}}{Process a wxEVT\_COMMAND\_SET\_FOCUS command,
|
|
|
|
which is generated by a control (Windows 95 and NT only).}
|
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_KILL\_FOCUS(id, func)}}{Process a wxEVT\_COMMAND\_KILL\_FOCUS command,
|
|
|
|
which is generated by a control (Windows 95 and NT only).}
|
|
|
|
\twocolitem{{\bf EVT\_COMMAND\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_ENTER command,
|
|
|
|
which is generated by a control.}
|
|
|
|
\end{twocollist}%
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::wxCommandEvent}\label{wxcommandeventctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxCommandEvent}{\param{WXTYPE}{ commandEventType = 0}, \param{int}{ id = 0}}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::Checked}\label{wxcommandeventchecked}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
\constfunc{bool}{Checked}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
Deprecated, use \helpref{IsChecked}{wxcommandeventischecked} instead.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetClientData}\label{wxcommandeventgetclientdata}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-08-19 14:41:41 -04:00
|
|
|
\func{void*}{GetClientData}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Returns client data pointer for a listbox or choice selection event
|
2000-08-08 02:11:51 -04:00
|
|
|
(not valid for a deselection).
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetClientObject}\label{wxcommandeventgetclientobject}
|
2004-04-15 19:10:08 -04:00
|
|
|
|
|
|
|
\func{wxClientData *}{GetClientObject}{\void}
|
|
|
|
|
|
|
|
Returns client object pointer for a listbox or choice selection event
|
|
|
|
(not valid for a deselection).
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetExtraLong}\label{wxcommandeventgetextralong}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{long}{GetExtraLong}{\void}
|
|
|
|
|
2005-03-08 14:37:38 -05:00
|
|
|
Returns extra information dependant on the event objects type.
|
|
|
|
If the event comes from a listbox selection, it is a boolean
|
|
|
|
determining whether the event was a selection (true) or a
|
|
|
|
deselection (false). A listbox deselection only occurs for
|
|
|
|
multiple-selection boxes, and in this case the index and string values
|
|
|
|
are indeterminate and the listbox must be examined by the application.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetInt}\label{wxcommandeventgetint}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{int}{GetInt}{\void}
|
|
|
|
|
2005-03-08 14:37:38 -05:00
|
|
|
Returns the integer identifier corresponding to a listbox, choice or
|
|
|
|
radiobox selection (only if the event was a selection, not a
|
|
|
|
deselection), or a boolean value representing the value of a checkbox.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetSelection}\label{wxcommandeventgetselection}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{int}{GetSelection}{\void}
|
|
|
|
|
|
|
|
Returns item index for a listbox or choice selection event (not valid for
|
|
|
|
a deselection).
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::GetString}\label{wxcommandeventgetstring}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2002-12-08 19:14:51 -05:00
|
|
|
\func{wxString}{GetString}{\void}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Returns item string for a listbox or choice selection event (not valid for
|
|
|
|
a deselection).
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
\membersection{wxCommandEvent::IsChecked}\label{wxcommandeventischecked}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsChecked}{\void}
|
|
|
|
|
|
|
|
This method can be used with checkbox and menu events: for the checkboxes, the
|
2003-01-17 19:16:34 -05:00
|
|
|
method returns {\tt true} for a selection event and {\tt false} for a
|
2000-08-08 02:11:51 -04:00
|
|
|
deselection one. For the menu events, this method indicates if the menu item
|
|
|
|
just has become checked or unchecked (and thus only makes sense for checkable
|
|
|
|
menu items).
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::IsSelection}\label{wxcommandeventisselection}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{bool}{IsSelection}{\void}
|
|
|
|
|
2004-07-06 06:33:24 -04:00
|
|
|
For a listbox or similar event, returns true if it is a selection, false if it
|
1998-05-20 10:25:30 -04:00
|
|
|
is a deselection.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::SetClientData}\label{wxcommandeventsetclientdata}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-08-19 14:41:41 -04:00
|
|
|
\func{void}{SetClientData}{\param{void*}{ clientData}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the client data for this event.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::SetClientObject}\label{wxcommandeventsetclientobject}
|
2004-04-15 19:10:08 -04:00
|
|
|
|
|
|
|
\func{void}{SetClientObject}{\param{wxClientData*}{ clientObject}}
|
|
|
|
|
|
|
|
Sets the client object for this event. The client object is \emph{not} owned by the event
|
|
|
|
object and the event object will not delete the client object in its destructor.
|
|
|
|
The client object must be owned and deleted by another object (e.g. a control)
|
|
|
|
that has longer life time than the event object.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::SetExtraLong}\label{wxcommandeventsetextralong}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetExtraLong}{\param{int}{ extraLong}}
|
|
|
|
|
|
|
|
Sets the {\bf m\_extraLong} member.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::SetInt}\label{wxcommandeventsetint}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{void}{SetInt}{\param{int}{ intCommand}}
|
|
|
|
|
|
|
|
Sets the {\bf m\_commandInt} member.
|
|
|
|
|
2004-10-04 11:13:52 -04:00
|
|
|
\membersection{wxCommandEvent::SetString}\label{wxcommandeventsetstring}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2002-12-08 19:14:51 -05:00
|
|
|
\func{void}{SetString}{\param{const wxString\&}{ string}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
Sets the {\bf m\_commandString} member.
|
|
|
|
|