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