- wxMenu* applemenu = new wxMenu();
- applemenu->SetAllowRearrange(false);
- applemenu->Append( wxApp::s_macAboutMenuItemId, "About..." );
- applemenu->AppendSeparator();
- applemenu->Append( wxApp::s_macPreferencesMenuItemId, "Preferences..." );
- applemenu->AppendSeparator();
+ m_rootMenu->Attach(this);
+
+ m_appleMenu = new wxMenu();
+ m_appleMenu->SetAllowRearrange(false);
+
+ // Create standard items unless the application explicitly disabled this by
+ // setting the corresponding ids to wxID_NONE: although this is not
+ // recommended, sometimes these items really don't make sense.
+ if ( wxApp::s_macAboutMenuItemId != wxID_NONE )
+ {
+ wxString aboutLabel(_("About"));
+ if ( wxTheApp )
+ aboutLabel << ' ' << wxTheApp->GetAppDisplayName();
+ else
+ aboutLabel << "...";
+ m_appleMenu->Append( wxApp::s_macAboutMenuItemId, aboutLabel);
+ m_appleMenu->AppendSeparator();
+ }
+
+#if !wxOSX_USE_CARBON
+ if ( wxApp::s_macPreferencesMenuItemId != wxID_NONE )
+ {
+ m_appleMenu->Append( wxApp::s_macPreferencesMenuItemId,
+ _("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();