Clarified context menu event behaviour.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-12-05 08:44:41 +00:00
parent bbde7abce9
commit 6d8d750e37
2 changed files with 15 additions and 4 deletions

View File

@@ -1,7 +1,14 @@
\section{\class{wxContextMenuEvent}}\label{wxcontextmenuevent}
This class is used for context menu events, sent to give
the application a chance to show a context (popup) menu.
This class is used for context menu events, sent to give the application a chance to show a context (popup) menu.
Note that if \helpref{GetPosition}{wxcontextmenueventgetposition} returns wxDefaultPosition, this means that the event originated
from a keyboard context button event, and you should compute a suitable position yourself,
for example by calling \helpref{wxGetMousePosition}{wxgetmouseposition}.
When a keyboard context menu button is pressed on Windows, a right-click event with default position is sent first,
and 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
is not being called, you could call wxEvent::Skip for mouse right-down events.
\wxheading{Derived from}
@@ -40,7 +47,11 @@ Constructor.
\constfunc{wxPoint}{GetPosition}{\void}
Returns the position at which the menu should be shown.
Returns the position in screen coordinates at which the menu should be shown. Use \helpref{wxWindow::ScreenToClient}{wxwindowscreentoclient} to
convert to client coordinates. You can also omit a position from \helpref{wxWindow::PopupMenu}{wxwindowpopupmenu} in order to use
the current mouse pointer position.
If the event originated from a keyboard event, the value returned from this function will be wxDefaultPosition.
\membersection{wxContextMenuEvent::SetPosition}\label{wxcontextmenueventsetposition}

View File

@@ -2288,7 +2288,7 @@ default value is {\tt false}.}
Pops up the given menu at the specified coordinates, relative to this
window, and returns control when the user has dismissed the menu. If a
menu item is selected, the corresponding menu event is generated and will be
processed as usually. If the coordinates are not specified, current mouse
processed as usually. If the coordinates are not specified, the current mouse
cursor position is used.
\wxheading{Parameters}