]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxMenuEvent}}\label{wxmenuevent} |
2 | ||
3 | This class is used for a variety of menu-related events. Note that | |
f4fcc291 JS |
4 | these do not include menu command events, which are |
5 | handled using \helpref{wxCommandEvent}{wxcommandevent} objects. | |
6 | ||
684761db | 7 | The default handler for wxEVT\_MENU\_HIGHLIGHT displays help |
f4fcc291 | 8 | text in the first field of the status bar. |
a660d684 KB |
9 | |
10 | \wxheading{Derived from} | |
11 | ||
12 | \helpref{wxEvent}{wxevent}\\ | |
13 | \helpref{wxObject}{wxobject} | |
14 | ||
954b8ae6 JS |
15 | \wxheading{Include files} |
16 | ||
17 | <wx/event.h> | |
18 | ||
a660d684 KB |
19 | \wxheading{Event table macros} |
20 | ||
21 | To process a menu event, use these event handler macros to direct input to member | |
22 | functions that take a wxMenuEvent argument. | |
23 | ||
24 | \twocolwidtha{7cm} | |
25 | \begin{twocollist}\itemsep=0pt | |
2f930c85 JS |
26 | \twocolitem{{\bf EVT\_MENU\_OPEN(func)}}{A menu is about to be opened. On Windows, |
27 | this is only sent once for each navigation of the menubar (up until all menus have closed).} | |
ccef86c7 VZ |
28 | \twocolitem{{\bf EVT\_MENU\_CLOSE(func)}}{A menu has been just closed.} |
29 | \twocolitem{{\bf EVT\_MENU\_HIGHLIGHT(id, func)}}{The menu item with the | |
2edb0bde | 30 | specified id has been highlighted: used to show help prompts in the status bar |
ccef86c7 VZ |
31 | by \helpref{wxFrame}{wxframe}} |
32 | \twocolitem{{\bf EVT\_MENU\_HIGHLIGHT\_ALL(func)}}{A menu item has been | |
33 | highlighted, i.e. the currently selected menu item has changed.} | |
d2c2afc9 | 34 | \end{twocollist} |
a660d684 KB |
35 | |
36 | \wxheading{See also} | |
37 | ||
ccef86c7 VZ |
38 | \helpref{Command events}{wxcommandevent},\\ |
39 | \helpref{Event handling overview}{eventhandlingoverview} | |
a660d684 KB |
40 | |
41 | \latexignore{\rtfignore{\wxheading{Members}}} | |
42 | ||
71c749e1 | 43 | |
dcbd177f | 44 | \membersection{wxMenuEvent::wxMenuEvent}\label{wxmenueventctor} |
a660d684 | 45 | |
f6e9a818 | 46 | \func{}{wxMenuEvent}{\param{WXTYPE }{id = 0}, \param{int }{id = 0}, \param{wxMenu* }{menu = NULL}} |
a660d684 KB |
47 | |
48 | Constructor. | |
49 | ||
71c749e1 | 50 | |
71c749e1 VZ |
51 | \membersection{wxMenuEvent::GetMenu}\label{wxmenueventgetmenu} |
52 | ||
53 | \constfunc{wxMenu *}{GetMenu}{\void} | |
54 | ||
3980000c | 55 | Returns the menu which is being opened or closed. This method should only be |
71c749e1 VZ |
56 | used with the \texttt{OPEN} and \texttt{CLOSE} events. |
57 | ||
58 | ||
a660d684 KB |
59 | \membersection{wxMenuEvent::GetMenuId}\label{wxmenueventgetmenuid} |
60 | ||
61 | \constfunc{int}{GetMenuId}{\void} | |
62 | ||
ccef86c7 VZ |
63 | Returns the menu identifier associated with the event. This method should be |
64 | only used with the {\tt HIGHLIGHT} events. | |
65 | ||
71c749e1 | 66 | |
ccef86c7 VZ |
67 | \membersection{wxMenuEvent::IsPopup}\label{wxmenueventispopup} |
68 | ||
69 | \constfunc{bool}{IsPopup}{\void} | |
70 | ||
cc81d32f VS |
71 | Returns {\tt true} if the menu which is being opened or closed is a popup menu, |
72 | {\tt false} if it is a normal one. | |
ccef86c7 | 73 | |
3980000c | 74 | This method should only be used with the {\tt OPEN} and {\tt CLOSE} events. |
ccef86c7 | 75 | |
a660d684 | 76 |