]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/upduievt.tex
Further stream tests, doc updates and minor clean-ups.
[wxWidgets.git] / docs / latex / wx / upduievt.tex
CommitLineData
a660d684
KB
1\section{\class{wxUpdateUIEvent}}\label{wxupdateuievent}
2
3This class is used for pseudo-events which are called by wxWindows
4to give an application the chance to update various user interface elements.
5
6\wxheading{Derived from}
7
8\helpref{wxEvent}{wxevent}\\
9\helpref{wxObject}{wxobject}
10
954b8ae6
JS
11\wxheading{Include files}
12
13<wx/event.h>
14
a660d684
KB
15\wxheading{Event table macros}
16
631f1bfe 17To process an update event, use these event handler macros to direct input to member
a660d684
KB
18functions that take a wxUpdateUIEvent argument.
19
20\twocolwidtha{7cm}
21\begin{twocollist}\itemsep=0pt
22\twocolitem{{\bf EVT\_UPDATE\_UI(id, func)}}{Process a wxEVT\_UPDATE\_UI event.}
23\end{twocollist}%
24
25\wxheading{Remarks}
26
27Without update UI events, an application has to work hard to check/uncheck, enable/disable,
28and set the text for elements such as menu items and toolbar buttons.
29The code for doing this has to be mixed up with the code that is invoked when
30an action is invoked for a menu item or button.
31
32With update UI events, you define an event handler to look at the state of
33the application and change UI elements accordingly. wxWindows will call your
34member functions in idle time, so you don't have to worry where to call this code.
35In addition to being a clearer and more declarative method, it also means you
36don't have to worry whether you're updating a toolbar or menubar identifier.
37The same handler can update a menu item and toolbar button, if the identifier is the same.
38
39Instead of directly manipulating the menu or button, you call functions in the event
40object, such as \helpref{wxUpdateUIEvent::Check}{wxupdateuieventcheck}. wxWindows
41will determine whether such a call has been made, and which UI element to update.
42
631f1bfe
JS
43These events will work for popup menus as well as menubars. Just before a menu is popped
44up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called to process any UI events for
45the window that owns the menu.
46
a660d684
KB
47\wxheading{See also}
48
49\helpref{Event handling overview}{eventhandlingoverview}
50
51\latexignore{\rtfignore{\wxheading{Members}}}
52
53\membersection{wxUpdateUIEvent::wxUpdateUIEvent}
54
55\func{}{wxUpdateUIEvent}{\param{wxWindowID }{commandId = 0}}
56
57Constructor.
58
59\membersection{wxUpdateUIEvent::m\_checked}
60
61\member{bool}{m\_checked}
62
63TRUE if the element should be checked, FALSE otherwise.
64
65\membersection{wxUpdateUIEvent::m\_enabled}
66
67\member{bool}{m\_checked}
68
69TRUE if the element should be enabled, FALSE otherwise.
70
71\membersection{wxUpdateUIEvent::m\_setChecked}
72
73\member{bool}{m\_setChecked}
74
75TRUE if the application has set the {\bf m\_checked} member.
76
77\membersection{wxUpdateUIEvent::m\_setEnabled}
78
79\member{bool}{m\_setEnabled}
80
81TRUE if the application has set the {\bf m\_enabled} member.
82
83\membersection{wxUpdateUIEvent::m\_setText}
84
85\member{bool}{m\_setText}
86
87TRUE if the application has set the {\bf m\_text} member.
88
89\membersection{wxUpdateUIEvent::m\_text}
90
91\member{wxString}{m\_text}
92
93Holds the text with which the the application wishes to
94update the UI element.
95
96\membersection{wxUpdateUIEvent::Check}\label{wxupdateuieventcheck}
97
98\func{void}{Check}{\param{bool}{ check}}
99
100Check or uncheck the UI element.
101
102\membersection{wxUpdateUIEvent::Enable}\label{wxupdateuieventenable}
103
104\func{void}{Enable}{\param{bool}{ enable}}
105
106Enable or disable the UI element.
107
108\membersection{wxUpdateUIEvent::GetChecked}\label{wxupdateuieventgetchecked}
109
110\constfunc{bool}{GetChecked}{\void}
111
112Returns TRUE if the UI element should be checked.
113
114\membersection{wxUpdateUIEvent::GetEnabled}\label{wxupdateuieventgetenabled}
115
116\constfunc{bool}{GetEnabled}{\void}
117
118Returns TRUE if the UI element should be enabled.
119
120\membersection{wxUpdateUIEvent::GetSetChecked}\label{wxupdateuieventgetsetchecked}
121
122\constfunc{bool}{GetSetChecked}{\void}
123
124Returns TRUE if the application has called {\bf SetChecked}. For wxWindows internal use only.
125
126\membersection{wxUpdateUIEvent::GetSetEnabled}\label{wxupdateuieventgetsetenabled}
127
128\constfunc{bool}{GetSetEnabled}{\void}
129
130Returns TRUE if the application has called {\bf SetEnabled}. For wxWindows internal use only.
131
132\membersection{wxUpdateUIEvent::GetSetText}\label{wxupdateuieventgetsettext}
133
134\constfunc{bool}{GetSetText}{\void}
135
136Returns TRUE if the application has called {\bf SetText}. For wxWindows internal use only.
137
138\membersection{wxUpdateUIEvent::GetText}\label{wxupdateuieventgettext}
139
140\constfunc{wxString}{GetText}{\void}
141
142Returns the text that should be set for the UI element.
143
144\membersection{wxUpdateUIEvent::SetText}\label{wxupdateuieventsettext}
145
146\func{void}{SetText}{\param{const wxString\&}{ text}}
147
148Sets the text for this UI element.
149