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