1\section{\class{wxContextMenuEvent}}\label{wxcontextmenuevent}
2
3This class is used for context menu events, sent to give the application a chance to show a context (popup) menu.
4
5Note that if \helpref{GetPosition}{wxcontextmenueventgetposition} returns wxDefaultPosition, this means that the event originated
6from a keyboard context button event, and you should compute a suitable position yourself,
7for example by calling \helpref{wxGetMousePosition}{wxgetmouseposition}.
8
9When a keyboard context menu button is pressed on Windows, a right-click event with default position is sent first,
10and if this event is not processed, the context menu event is sent. So if you process mouse events and you find your context menu event handler
11is not being called, you could call wxEvent::Skip for mouse right-down events.
12
13\wxheading{Derived from}
14
15\helpref{wxCommandEvent}{wxcommandevent}\\
16\helpref{wxEvent}{wxevent}\\
17\helpref{wxObject}{wxobject}
18
19\wxheading{Include files}
20
21<wx/event.h>
22
23\wxheading{Event table macros}
24
25To process a menu event, use these event handler macros to direct input to member
26functions that take a wxContextMenuEvent argument.
27
28\twocolwidtha{7cm}
29\begin{twocollist}\itemsep=0pt
30\twocolitem{{\bf EVT\_CONTEXT\_MENU(func)}}{A right click (or other context menu command depending on platform) has been detected.}
31\end{twocollist}
32
33\wxheading{See also}
34
35\helpref{Command events}{wxcommandevent},\\
36\helpref{Event handling overview}{eventhandlingoverview}
37
38\latexignore{\rtfignore{\wxheading{Members}}}
39
40\membersection{wxContextMenuEvent::wxContextMenuEvent}\label{wxcontextmenueventctor}
41
42\func{}{wxContextMenuEvent}{\param{WXTYPE }{id = 0}, \param{int }{id = 0}, \param{const wxPoint\&}{ pos=wxDefaultPosition}}
43
44Constructor.
45
46\membersection{wxContextMenuEvent::GetPosition}\label{wxcontextmenueventgetposition}
47
48\constfunc{wxPoint}{GetPosition}{\void}
49
50Returns the position in screen coordinates at which the menu should be shown. Use \helpref{wxWindow::ScreenToClient}{wxwindowscreentoclient} to
51convert to client coordinates. You can also omit a position from \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu} in order to use
52the current mouse pointer position.
53
54If the event originated from a keyboard event, the value returned from this function will be wxDefaultPosition.
55
56\membersection{wxContextMenuEvent::SetPosition}\label{wxcontextmenueventsetposition}
57
58\func{void}{SetPosition}{\param{const wxPoint\&}{ point}}
59
60Sets the position at which the menu should be shown.
61
62