Set popup menu invoking window in wxWindowBase and not in all ports.

Don't duplicate the code for setting (and unsetting, which was forgotten by at
least wxGTK) the popup menu invoking window in all ports but do it in the base
class PopupMenu() itself.

Also add a helper wxMenuInvokingWindowSetter class which ensures that the
invoking window will be unset in any case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-26 14:19:17 +00:00
parent 6de0a414a5
commit c59aa14a6c
10 changed files with 56 additions and 61 deletions

View File

@@ -3996,10 +3996,6 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
{
wxCHECK_MSG( m_widget != NULL, false, wxT("invalid window") );
wxCHECK_MSG( menu != NULL, false, wxT("invalid popup-menu") );
menu->SetInvokingWindow( this );
menu->UpdateUI();
wxPoint pos;
@@ -4034,8 +4030,6 @@ bool wxWindowGTK::DoPopupMenu( wxMenu *menu, int x, int y )
gtk_main_iteration();
}
menu->SetInvokingWindow( NULL );
return true;
}