Fixed menu event propogation to be consistent across platforms, and

with the docs.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19967 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-04-03 18:39:20 +00:00
parent 91ce04cf9e
commit a01fe3d6d2
5 changed files with 106 additions and 99 deletions

View File

@@ -2348,21 +2348,13 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
void wxApp::MacHandleMenuCommand( wxUint32 id )
{
wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ;
wxMenu* menu = NULL ;
wxMenuItem* item = NULL ;
if ( mbar )
{
item = mbar->FindItem( id , &menu ) ;
}
wxCHECK_RET( item != NULL && menu != NULL && mbar != NULL, wxT("error in menu item callback") );
if (item->IsCheckable())
{
item->Check( !item->IsChecked() ) ;
}
menu->SendEvent( id , item->IsCheckable() ? item->IsChecked() : -1 ) ;
wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar() ;
wxFrame* frame = mbar->GetFrame();
wxCHECK_RET( mbar != NULL && frame != NULL, wxT("error in menu item callback") );
if ( frame )
{
frame->ProcessCommand(id);
}
}
#if !TARGET_CARBON