X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c9413b7de1e86bc3e2d96b9bc55d35d287ee0f7..f9b4d680d72930c31fe14dd63421a85d97ccd739:/src/osx/cocoa/menuitem.mm?ds=sidebyside diff --git a/src/osx/cocoa/menuitem.mm b/src/osx/cocoa/menuitem.mm index cb525c3fac..c253f75672 100644 --- a/src/osx/cocoa/menuitem.mm +++ b/src/osx/cocoa/menuitem.mm @@ -35,7 +35,10 @@ wxUnusedVar(sender); if ( impl ) { - impl->GetWXPeer()->GetMenu()->HandleCommandProcess(impl->GetWXPeer()); + wxMenuItem* menuitem = impl->GetWXPeer(); + if ( menuitem->GetMenu()->HandleCommandProcess(menuitem) == false ) + { + } } } @@ -68,7 +71,7 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry* int key = entry->GetKeyCode() ; if ( key ) { - if (entry->GetFlags() & wxACCEL_CTRL); + if (entry->GetFlags() & wxACCEL_CTRL) modifiers |= NSCommandKeyMask; if (entry->GetFlags() & wxACCEL_ALT) @@ -212,6 +215,8 @@ public : wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry ); } + + bool DoDefault(); void * GetHMenuItem() { return m_osxMenuItem; } @@ -226,6 +231,29 @@ wxMenuItemCocoaImpl::~wxMenuItemCocoaImpl() [m_osxMenuItem release]; } +bool wxMenuItemCocoaImpl::DoDefault() +{ + bool handled=false; + int menuid = m_peer->GetId(); + + NSApplication *theNSApplication = [NSApplication sharedApplication]; + if (menuid == wxID_OSX_HIDE) + { + [theNSApplication hide:nil]; + handled=true; + } + else if (menuid == wxID_OSX_HIDEOTHERS) + { + [theNSApplication hideOtherApplications:nil]; + handled=true; + } + else if (menuid == wxID_OSX_SHOWALL) + { + [theNSApplication unhideAllApplications:nil]; + handled=true; + } + return handled; +} wxMenuItemImpl* wxMenuItemImpl::Create( wxMenuItem* peer, wxMenu *pParentMenu, int WXUNUSED(id),