Put Services submenu into the Apple menu on OS X.

Native applications have a Services submenu in the apple menu.  wx
applications didn't until now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2013-11-17 18:03:05 +00:00
parent 6aa48db478
commit ff7f9c2def
3 changed files with 13 additions and 1 deletions

View File

@@ -2293,8 +2293,13 @@ enum wxStandardID
wxID_OSX_HIDE = wxID_OSX_MENU_FIRST,
wxID_OSX_HIDEOTHERS,
wxID_OSX_SHOWALL,
#if wxABI_VERSION >= 30001
wxID_OSX_SERVICES,
wxID_OSX_MENU_LAST = wxID_OSX_SERVICES,
#else
wxID_OSX_MENU_LAST = wxID_OSX_SHOWALL,
#endif
/* IDs used by generic file dialog (13 consecutive starting from this value) */
wxID_FILEDLGG = 5900,

View File

@@ -194,6 +194,10 @@ public :
{
[NSApp setMainMenu:m_osxMenu];
[NSApp setAppleMenu:[[m_osxMenu itemAtIndex:0] submenu]];
wxMenuItem *services = GetWXPeer()->FindItem(wxID_OSX_SERVICES);
if ( services )
[NSApp setServicesMenu:services->GetSubMenu()->GetHMenu()];
}
virtual void Enable( bool WXUNUSED(enable) )

View File

@@ -615,6 +615,9 @@ static wxMenu *CreateAppleMenu()
appleMenu->AppendSeparator();
}
appleMenu->Append(wxID_OSX_SERVICES, _("Services"), new wxMenu());
appleMenu->AppendSeparator();
// standard menu items, handled in wxMenu::HandleCommandProcess(), see above:
wxString hideLabel;
hideLabel = wxString::Format(_("Hide %s"), wxTheApp ? wxTheApp->GetAppDisplayName() : _("Application"));