Fix menu event propogation to be consistent across platforms, and with

the docs.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-04-03 18:40:46 +00:00
parent 073233381b
commit 0cc89f950e
4 changed files with 56 additions and 86 deletions

View File

@@ -384,11 +384,12 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
MenuCommand id ;
GetMenuItemCommandID( GetMenuHandle(HiWord(menuResult)) , LoWord(menuResult) , &id ) ;
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED, id );
event.m_timeStamp = TickCount() ;
event.SetEventObject(this->GetEventHandler());
event.SetInt( id );
GetEventHandler()->ProcessEvent(event);
wxMenuItem* item = menu->FindChildItem(id);
if (item->IsCheckable())
{
item->Check( !item->IsChecked() );
}
menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
}
::DeleteMenu( menu->MacGetMenuId() ) ;
menu->SetInvokingWindow(NULL);