1 \section{\class{wxUpdateUIEvent
}}\label{wxupdateuievent
}
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.
6 \wxheading{Derived from
}
8 \helpref{wxEvent
}{wxevent
}\\
9 \helpref{wxObject
}{wxobject
}
11 \wxheading{Include files
}
15 \wxheading{Event table macros
}
17 To process an update event, use these event handler macros to direct input to member
18 functions that take a wxUpdateUIEvent argument.
21 \begin{twocollist
}\itemsep=
0pt
22 \twocolitem{{\bf EVT
\_UPDATE\_UI(id, func)
}}{Process a wxEVT
\_UPDATE\_UI event for the command with the given id.
}
23 \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.
}
28 Without update UI events, an application has to work hard to check/uncheck, enable/disable,
29 and set the text for elements such as menu items and toolbar buttons.
30 The code for doing this has to be mixed up with the code that is invoked when
31 an action is invoked for a menu item or button.
33 With update UI events, you define an event handler to look at the state of
34 the application and change UI elements accordingly. wxWindows will call your
35 member functions in idle time, so you don't have to worry where to call this code.
36 In addition to being a clearer and more declarative method, it also means you
37 don't have to worry whether you're updating a toolbar or menubar identifier.
38 The same handler can update a menu item and toolbar button, if the identifier is the same.
40 Instead of directly manipulating the menu or button, you call functions in the event
41 object, such as
\helpref{wxUpdateUIEvent::Check
}{wxupdateuieventcheck
}. wxWindows
42 will determine whether such a call has been made, and which UI element to update.
44 These events will work for popup menus as well as menubars. Just before a menu is popped
45 up,
\helpref{wxMenu::UpdateUI
}{wxmenuupdateui
} is called to process any UI events for
46 the window that owns the menu.
50 \helpref{Event handling overview
}{eventhandlingoverview
}
52 \latexignore{\rtfignore{\wxheading{Members
}}}
54 \membersection{wxUpdateUIEvent::wxUpdateUIEvent
}
56 \func{}{wxUpdateUIEvent
}{\param{wxWindowID
}{commandId =
0}}
60 \membersection{wxUpdateUIEvent::m
\_checked}
62 \member{bool
}{m
\_checked}
64 TRUE if the element should be checked, FALSE otherwise.
66 \membersection{wxUpdateUIEvent::m
\_enabled}
68 \member{bool
}{m
\_checked}
70 TRUE if the element should be enabled, FALSE otherwise.
72 \membersection{wxUpdateUIEvent::m
\_setChecked}
74 \member{bool
}{m
\_setChecked}
76 TRUE if the application has set the
{\bf m
\_checked} member.
78 \membersection{wxUpdateUIEvent::m
\_setEnabled}
80 \member{bool
}{m
\_setEnabled}
82 TRUE if the application has set the
{\bf m
\_enabled} member.
84 \membersection{wxUpdateUIEvent::m
\_setText}
86 \member{bool
}{m
\_setText}
88 TRUE if the application has set the
{\bf m
\_text} member.
90 \membersection{wxUpdateUIEvent::m
\_text}
92 \member{wxString
}{m
\_text}
94 Holds the text with which the the application wishes to
95 update the UI element.
97 \membersection{wxUpdateUIEvent::Check
}\label{wxupdateuieventcheck
}
99 \func{void
}{Check
}{\param{bool
}{ check
}}
101 Check or uncheck the UI element.
103 \membersection{wxUpdateUIEvent::Enable
}\label{wxupdateuieventenable
}
105 \func{void
}{Enable
}{\param{bool
}{ enable
}}
107 Enable or disable the UI element.
109 \membersection{wxUpdateUIEvent::GetChecked
}\label{wxupdateuieventgetchecked
}
111 \constfunc{bool
}{GetChecked
}{\void}
113 Returns TRUE if the UI element should be checked.
115 \membersection{wxUpdateUIEvent::GetEnabled
}\label{wxupdateuieventgetenabled
}
117 \constfunc{bool
}{GetEnabled
}{\void}
119 Returns TRUE if the UI element should be enabled.
121 \membersection{wxUpdateUIEvent::GetSetChecked
}\label{wxupdateuieventgetsetchecked
}
123 \constfunc{bool
}{GetSetChecked
}{\void}
125 Returns TRUE if the application has called
{\bf SetChecked
}. For wxWindows internal use only.
127 \membersection{wxUpdateUIEvent::GetSetEnabled
}\label{wxupdateuieventgetsetenabled
}
129 \constfunc{bool
}{GetSetEnabled
}{\void}
131 Returns TRUE if the application has called
{\bf SetEnabled
}. For wxWindows internal use only.
133 \membersection{wxUpdateUIEvent::GetSetText
}\label{wxupdateuieventgetsettext
}
135 \constfunc{bool
}{GetSetText
}{\void}
137 Returns TRUE if the application has called
{\bf SetText
}. For wxWindows internal use only.
139 \membersection{wxUpdateUIEvent::GetText
}\label{wxupdateuieventgettext
}
141 \constfunc{wxString
}{GetText
}{\void}
143 Returns the text that should be set for the UI element.
145 \membersection{wxUpdateUIEvent::SetText
}\label{wxupdateuieventsettext
}
147 \func{void
}{SetText
}{\param{const wxString\&
}{ text
}}
149 Sets the text for this UI element.