X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11fed901d1744019e2a4279714d172829a3c0699..bc5c09a3aa3662137da2d781c0b101a598d2650d:/src/osx/menu_osx.cpp diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index d5b042ec52..9e2da30874 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -76,7 +76,7 @@ void wxMenu::Init() m_startRadioGroup = -1; m_allowRearrange = true; m_noEventsMode = false; - + m_peer = wxMenuImpl::Create( this, wxStripMenuCodes(m_title) ); @@ -144,7 +144,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) pSubMenu->DoRearrange(); } else - { + { if ( pItem->GetId() == idMenuTitle ) pItem->GetMenu()->Enable( idMenuTitle, false ); } @@ -165,7 +165,7 @@ void wxMenu::EndRadioGroup() wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") ); bool check = false; @@ -197,7 +197,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) } else { - wxFAIL_MSG( _T("where is the radio group start item?") ); + wxFAIL_MSG( wxT("where is the radio group start item?") ); } } } @@ -293,7 +293,7 @@ void wxMenu::DoRearrange() { if ( !AllowRearrange() ) return; - + wxMenuItem* previousItem = NULL ; size_t pos ; wxMenuItemList::compatibility_iterator node; @@ -331,7 +331,7 @@ void wxMenu::DoRearrange() { // next (i.e. second as we must be first) item is // the separator to hide - wxASSERT_MSG( pos == 0, _T("should be the menu start") ); + wxASSERT_MSG( pos == 0, wxT("should be the menu start") ); sepToHide = next; } else if ( GetMenuItems().GetCount() == pos + 1 && @@ -564,7 +564,7 @@ void wxMenuBar::MacInstallMenuBar() { if ( s_macInstalledMenuBar == this ) return ; - + m_rootMenu->GetPeer()->MakeRoot(); // DisableMenuCommand( NULL , kHICommandPreferences ) ; #if 0 @@ -643,7 +643,9 @@ void wxMenuBar::MacInstallMenuBar() subMenu = item->GetSubMenu() ; if (subMenu) { - // we don't support hierarchical menus in the help menu yet + UMAAppendMenuItem(mh, wxStripMenuCodes(item->GetText()) , wxFont::GetDefaultEncoding() ); + MenuItemIndex position = CountMenuItems(mh); + ::SetMenuItemHierarchicalMenu(mh, position, MAC_WXHMENU(subMenu->GetHMenu())); } else { @@ -765,7 +767,7 @@ void wxMenuBar::MacInstallMenuBar() void wxMenuBar::EnableTop(size_t pos, bool enable) { wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") ); - + m_rootMenu->FindItemByPosition( pos )->Enable(enable); Refresh(); @@ -847,7 +849,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) return false; m_titles.Insert(title, pos); - + m_rootMenu->Insert( pos+firstMenuPos, wxMenuItem::New( m_rootMenu, wxID_ANY, title, "", wxITEM_NORMAL, menu ) ); if (m_invokingWindow) @@ -942,7 +944,7 @@ void wxMenuBar::SetInvokingWindow(wxFrame *frame) { m_invokingWindow = frame; wxMenubarSetInvokingWindow(m_appleMenu, frame); - + wxMenu *menu; wxMenuList::compatibility_iterator node = m_menus.GetFirst();