X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1ea5ef0190b1b2f4d248af6b06d718a9adef2d41..d85aece19960f1c09051d2bd5f54281272fde8ff:/src/osx/menu_osx.cpp?ds=inline diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index 91f2de1798..9e2da30874 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -18,6 +18,8 @@ #include "wx/wxprec.h" +#if wxUSE_MENUS + #include "wx/menu.h" #ifndef WX_PRECOMP @@ -74,7 +76,7 @@ void wxMenu::Init() m_startRadioGroup = -1; m_allowRearrange = true; m_noEventsMode = false; - + m_peer = wxMenuImpl::Create( this, wxStripMenuCodes(m_title) ); @@ -142,7 +144,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) pSubMenu->DoRearrange(); } else - { + { if ( pItem->GetId() == idMenuTitle ) pItem->GetMenu()->Enable( idMenuTitle, false ); } @@ -163,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; @@ -195,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?") ); } } } @@ -291,7 +293,7 @@ void wxMenu::DoRearrange() { if ( !AllowRearrange() ) return; - + wxMenuItem* previousItem = NULL ; size_t pos ; wxMenuItemList::compatibility_iterator node; @@ -329,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 && @@ -562,7 +564,7 @@ void wxMenuBar::MacInstallMenuBar() { if ( s_macInstalledMenuBar == this ) return ; - + m_rootMenu->GetPeer()->MakeRoot(); // DisableMenuCommand( NULL , kHICommandPreferences ) ; #if 0 @@ -641,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 { @@ -763,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(); @@ -845,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) @@ -940,7 +944,7 @@ void wxMenuBar::SetInvokingWindow(wxFrame *frame) { m_invokingWindow = frame; wxMenubarSetInvokingWindow(m_appleMenu, frame); - + wxMenu *menu; wxMenuList::compatibility_iterator node = m_menus.GetFirst(); @@ -995,3 +999,5 @@ wxMenuItem *wxMenuBar::FindItem(int id, wxMenu **itemMenu) const return item; } + +#endif