1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxUpdateUIEvent}}\label{wxupdateuievent}
|
|
|
|
|
|
|
|
This class is used for pseudo-events which are called by wxWindows
|
|
|
|
to give an application the chance to update various user interface elements.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
\helpref{wxCommandEvent}{wxcommandevent}\\
|
1998-05-20 10:25:30 -04:00
|
|
|
\helpref{wxEvent}{wxevent}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
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}
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
To process an update event, use these event handler macros to direct input to member
|
1998-05-20 10:25:30 -04:00
|
|
|
functions that take a wxUpdateUIEvent argument.
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
2000-08-08 02:11:51 -04:00
|
|
|
\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event for the command with the given id.}
|
|
|
|
\twocolitem{{\bf EVT\_UPDATE\_UI\_RANGE(id1, id2, func)}}{Process a wxEVT\_UPDATE\_UI event for any command with id included in the given range.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\end{twocollist}%
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
Without update UI events, an application has to work hard to check/uncheck, enable/disable,
|
|
|
|
and set the text for elements such as menu items and toolbar buttons.
|
|
|
|
The code for doing this has to be mixed up with the code that is invoked when
|
|
|
|
an action is invoked for a menu item or button.
|
|
|
|
|
|
|
|
With update UI events, you define an event handler to look at the state of
|
|
|
|
the application and change UI elements accordingly. wxWindows will call your
|
|
|
|
member functions in idle time, so you don't have to worry where to call this code.
|
|
|
|
In addition to being a clearer and more declarative method, it also means you
|
|
|
|
don't have to worry whether you're updating a toolbar or menubar identifier.
|
|
|
|
The same handler can update a menu item and toolbar button, if the identifier is the same.
|
|
|
|
|
|
|
|
Instead of directly manipulating the menu or button, you call functions in the event
|
|
|
|
object, such as \helpref{wxUpdateUIEvent::Check}{wxupdateuieventcheck}. wxWindows
|
|
|
|
will determine whether such a call has been made, and which UI element to update.
|
|
|
|
|
1999-02-06 08:32:46 -05:00
|
|
|
These events will work for popup menus as well as menubars. Just before a menu is popped
|
|
|
|
up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called to process any UI events for
|
|
|
|
the window that owns the menu.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{Event handling overview}{eventhandlingoverview}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::wxUpdateUIEvent}
|
|
|
|
|
|
|
|
\func{}{wxUpdateUIEvent}{\param{wxWindowID }{commandId = 0}}
|
|
|
|
|
|
|
|
Constructor.
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_checked}
|
|
|
|
|
|
|
|
\member{bool}{m\_checked}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the element should be checked, false otherwise.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_enabled}
|
|
|
|
|
|
|
|
\member{bool}{m\_checked}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the element should be enabled, false otherwise.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_setChecked}
|
|
|
|
|
|
|
|
\member{bool}{m\_setChecked}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the application has set the {\bf m\_checked} member.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_setEnabled}
|
|
|
|
|
|
|
|
\member{bool}{m\_setEnabled}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the application has set the {\bf m\_enabled} member.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_setText}
|
|
|
|
|
|
|
|
\member{bool}{m\_setText}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the application has set the {\bf m\_text} member.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::m\_text}
|
|
|
|
|
|
|
|
\member{wxString}{m\_text}
|
|
|
|
|
|
|
|
Holds the text with which the the application wishes to
|
|
|
|
update the UI element.
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::Check}\label{wxupdateuieventcheck}
|
|
|
|
|
|
|
|
\func{void}{Check}{\param{bool}{ check}}
|
|
|
|
|
|
|
|
Check or uncheck the UI element.
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::Enable}\label{wxupdateuieventenable}
|
|
|
|
|
|
|
|
\func{void}{Enable}{\param{bool}{ enable}}
|
|
|
|
|
|
|
|
Enable or disable the UI element.
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetChecked}\label{wxupdateuieventgetchecked}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetChecked}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the UI element should be checked.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetEnabled}\label{wxupdateuieventgetenabled}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetEnabled}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the UI element should be enabled.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetSetChecked}\label{wxupdateuieventgetsetchecked}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetSetChecked}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the application has called {\bf SetChecked}. For wxWindows internal use only.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetSetEnabled}\label{wxupdateuieventgetsetenabled}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetSetEnabled}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the application has called {\bf SetEnabled}. For wxWindows internal use only.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetSetText}\label{wxupdateuieventgetsettext}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetSetText}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the application has called {\bf SetText}. For wxWindows internal use only.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::GetText}\label{wxupdateuieventgettext}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetText}{\void}
|
|
|
|
|
|
|
|
Returns the text that should be set for the UI element.
|
|
|
|
|
|
|
|
\membersection{wxUpdateUIEvent::SetText}\label{wxupdateuieventsettext}
|
|
|
|
|
|
|
|
\func{void}{SetText}{\param{const wxString\&}{ text}}
|
|
|
|
|
|
|
|
Sets the text for this UI element.
|
|
|
|
|