Applied part of #9142 (wxMac: Fixes missing translation of "Window" menu name)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62126 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2009-09-25 14:32:56 +00:00
parent ada887153d
commit d9c068bee7

View File

@@ -780,6 +780,11 @@ void wxMenuBar::MacInstallMenuBar()
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
#endif
wxString strippedHelpMenuTitle = wxStripMenuCodes( wxApp::s_macHelpMenuTitleName ) ;
wxString strippedTranslatedHelpMenuTitle = wxStripMenuCodes( wxString( _("&Help") ) ) ;
wxString strippedWindowMenuTitle = wxStripMenuCodes( wxT("&Window") /* wxApp::s_macWindowMenuTitleName */ ) ;
wxString strippedTranslatedWindowMenuTitle = wxStripMenuCodes( wxString( _("&Window") ) ) ;
wxMenuList::compatibility_iterator menuIter = m_menus.GetFirst();
for (size_t i = 0; i < m_menus.GetCount(); i++, menuIter = menuIter->GetNext())
@@ -787,8 +792,9 @@ void wxMenuBar::MacInstallMenuBar()
wxMenuItemList::compatibility_iterator node;
wxMenuItem *item;
wxMenu* menu = menuIter->GetData() , *subMenu = NULL ;
wxString strippedMenuTitle = wxStripMenuCodes(m_titles[i]);
if ( m_titles[i] == wxT("?") || m_titles[i] == wxT("&?") || m_titles[i] == wxApp::s_macHelpMenuTitleName )
if ( strippedMenuTitle == wxT("?") || strippedMenuTitle == strippedHelpMenuTitle || strippedMenuTitle == strippedTranslatedHelpMenuTitle )
{
for (node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext())
{
@@ -847,8 +853,7 @@ void wxMenuBar::MacInstallMenuBar()
}
}
}
else if ( ( m_titles[i] == wxT("Window") || m_titles[i] == wxT("&Window") )
else if ( (strippedMenuTitle == wxT("Window") || strippedMenuTitle == strippedWindowMenuTitle || strippedMenuTitle == strippedTranslatedWindowMenuTitle )
&& GetAutoWindowMenu() )
{
if ( MacGetWindowMenuHMenu() == NULL )