wxID_MDI_WINDOW_NEXT,
wxID_MDI_WINDOW_LAST = wxID_MDI_WINDOW_NEXT,
+ /* OS X system menu ids */
+ wxID_OSX_MENU_FIRST = 5250,
+ wxID_OSX_HIDE = wxID_OSX_MENU_FIRST,
+ wxID_OSX_HIDEOTHERS,
+ wxID_OSX_SHOWALL,
+ wxID_OSX_MENU_LAST = wxID_OSX_SHOWALL,
+
/* IDs used by generic file dialog (13 consecutive starting from this value) */
wxID_FILEDLGG = 5900,
wxUnusedVar(sender);
if ( impl )
{
- impl->GetWXPeer()->GetMenu()->HandleCommandProcess(impl->GetWXPeer());
+ wxMenuItem* menuitem = impl->GetWXPeer();
+ if ( menuitem->GetMenu()->HandleCommandProcess(menuitem) == false )
+ {
+ }
}
}
wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry );
}
+
+ bool DoDefault();
void * GetHMenuItem() { return m_osxMenuItem; }
[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),
processed = true ;
}
}
+
+ if(!processed && item)
+ {
+ processed = item->GetPeer()->DoDefault();
+ }
+
return processed;
}
// recommended, sometimes these items really don't make sense.
if ( wxApp::s_macAboutMenuItemId != wxID_NONE )
{
- wxString aboutLabel("About");
+ wxString aboutLabel(_("About"));
if ( wxTheApp )
aboutLabel << ' ' << wxTheApp->GetAppDisplayName();
else
if ( wxApp::s_macPreferencesMenuItemId != wxID_NONE )
{
m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId,
- "Preferences...\tCtrl+," );
+ _("Preferences...") + "\tCtrl+," );
m_appleMenu->AppendSeparator();
}
+ // standard menu items, handled in wxMenu::HandleCommandProcess(), see above:
+ wxString hideLabel(_("Hide"));
+ if ( wxTheApp )
+ hideLabel << ' ' << wxTheApp->GetAppDisplayName();
+ hideLabel << "\tCtrl+H";
+ m_appleMenu->Append( wxID_OSX_HIDE, hideLabel );
+ m_appleMenu->Append( wxID_OSX_HIDEOTHERS, _("Hide Others")+"\tAlt+Ctrl+H" );
+ m_appleMenu->Append( wxID_OSX_SHOWALL, _("Show All") );
+ m_appleMenu->AppendSeparator();
+
// Do always add "Quit" item unconditionally however, it can't be disabled.
- m_appleMenu->Append( wxApp::s_macExitMenuItemId, "Quit\tCtrl+Q" );
+ wxString quitLabel(_("Quit"));
+ if ( wxTheApp )
+ quitLabel << ' ' << wxTheApp->GetAppDisplayName();
+ quitLabel << "\tCtrl+Q";
+ m_appleMenu->Append( wxApp::s_macExitMenuItemId, quitLabel );
#endif // !wxOSX_USE_CARBON
m_rootMenu->AppendSubMenu(m_appleMenu, "\x14") ;