X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f11220943f14b4bb5190db0dfd0054304f5015c..544229d1069a20ca4c81fac6059aa4d92d8559ef:/docs/latex/wx/cmdevent.tex?ds=inline diff --git a/docs/latex/wx/cmdevent.tex b/docs/latex/wx/cmdevent.tex index 8d4873fb1f..bd6ac03f30 100644 --- a/docs/latex/wx/cmdevent.tex +++ b/docs/latex/wx/cmdevent.tex @@ -7,6 +7,10 @@ simple controls. More complex controls, such as \helpref{wxTreeCtrl}{wxtreectrl} \helpref{wxEvent}{wxevent} +\wxheading{Include files} + + + \wxheading{Event table macros} To process a menu command event, use these event handler macros to direct input to member @@ -32,11 +36,20 @@ which is generated by a wxListBox 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.} +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}.} \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.} +\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.} \twocolitem{{\bf EVT\_SLIDER(id, func)}}{Process a wxEVT\_COMMAND\_SLIDER\_UPDATED command, which is generated by a wxSlider control.} \twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED command, @@ -51,7 +64,7 @@ which is generated by a wxComboBox control.} \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 -for a range id identifiers. Pass the ids of the tools.} +for a range of identifiers. Pass the ids of the tools.} \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 @@ -76,10 +89,10 @@ which is generated by a control.} \membersection{wxCommandEvent::m\_clientData} -\member{char*}{m\_clientData} +\member{void*}{m\_clientData} Contains a pointer to client data for listboxes and choices, if the event -was a selection. +was a selection. Beware, this is not implemented anyway... \membersection{wxCommandEvent::m\_commandInt} @@ -91,7 +104,7 @@ deselection), or a boolean value representing the value of a checkbox. \membersection{wxCommandEvent::m\_commandString} -\member{char*}{m\_commandString} +\member{wxString}{m\_commandString} Contains a string corresponding to a listbox or choice selection. @@ -100,8 +113,8 @@ Contains a string corresponding to a listbox or choice selection. \member{long}{m\_extraLong} Extra information. 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 +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. @@ -113,17 +126,24 @@ Constructor. \membersection{wxCommandEvent::Checked} -\func{bool}{Checked}{\void} +\constfunc{bool}{Checked}{\void} -Returns TRUE or FALSE for a checkbox selection event. +Deprecated, use \helpref{IsChecked}{wxcommandeventischecked} instead. \membersection{wxCommandEvent::GetClientData} -\func{char*}{GetClientData}{\void} +\func{void*}{GetClientData}{\void} Returns client data pointer for a listbox or choice selection event (not valid for a deselection). +\membersection{wxCommandEvent::GetClientObject} + +\func{wxClientData *}{GetClientObject}{\void} + +Returns client object pointer for a listbox or choice selection event +(not valid for a deselection). + \membersection{wxCommandEvent::GetExtraLong} \func{long}{GetExtraLong}{\void} @@ -145,24 +165,43 @@ a deselection). \membersection{wxCommandEvent::GetString} -\func{char*}{GetString}{\void} +\func{wxString}{GetString}{\void} Returns item string for a listbox or choice selection event (not valid for a deselection). +\membersection{wxCommandEvent::IsChecked}\label{wxcommandeventischecked} + +\constfunc{bool}{IsChecked}{\void} + +This method can be used with checkbox and menu events: for the checkboxes, the +method returns {\tt true} for a selection event and {\tt false} for a +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). + \membersection{wxCommandEvent::IsSelection} \func{bool}{IsSelection}{\void} -For a listbox or choice event, returns TRUE if it is a selection, FALSE if it +For a listbox or similar event, returns true if it is a selection, false if it is a deselection. \membersection{wxCommandEvent::SetClientData} -\func{void}{SetClientData}{\param{char*}{ clientData}} +\func{void}{SetClientData}{\param{void*}{ clientData}} Sets the client data for this event. +\membersection{wxCommandEvent::SetClientObject} + +\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. + \membersection{wxCommandEvent::SetExtraLong} \func{void}{SetExtraLong}{\param{int}{ extraLong}} @@ -177,7 +216,7 @@ Sets the {\bf m\_commandInt} member. \membersection{wxCommandEvent::SetString} -\func{void}{SetString}{\param{char*}{ string}} +\func{void}{SetString}{\param{const wxString\&}{ string}} Sets the {\bf m\_commandString} member.