use current mouse position as default position in wxWindow::PopupMenu (works better in wxGTK and is what you need in majority of cases)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-06-03 14:05:30 +00:00
parent e77d093dbe
commit 971562cb51
10 changed files with 107 additions and 32 deletions

View File

@@ -1439,7 +1439,16 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
{
menu->SetInvokingWindow(this);
menu->UpdateUI();
ClientToScreen( &x , &y ) ;
if ( x == -1 && y == -1 )
{
wxPoint mouse = wxGetMousePosition();
x = mouse.x; y = mouse.y;
}
else
{
ClientToScreen( &x , &y ) ;
}
menu->MacBeforeDisplay( true ) ;
long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ;