X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1ea5ef0190b1b2f4d248af6b06d718a9adef2d41..09981ba7981297056da49ceb0eb85d3ac9fc5f6f:/src/osx/menuitem_osx.cpp diff --git a/src/osx/menuitem_osx.cpp b/src/osx/menuitem_osx.cpp index a2b69f7442..cff6e59777 100644 --- a/src/osx/menuitem_osx.cpp +++ b/src/osx/menuitem_osx.cpp @@ -11,6 +11,8 @@ #include "wx/wxprec.h" +#if wxUSE_MENUS + #include "wx/menuitem.h" #include "wx/stockitem.h" @@ -46,14 +48,14 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, m_radioGroup.start = -1; m_isRadioGroupStart = false; - + wxString text = wxStripMenuCodes(m_text); if (text.IsEmpty() && !IsSeparator()) { wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?")); text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC); } - + wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ; // use accessors for ID and Kind because they might have been changed in the base constructor m_peer = wxMenuItemImpl::Create( this, pParentMenu, GetId(), text, entry, strHelp, GetKind(), pSubMenu ); @@ -81,7 +83,7 @@ void wxMenuItem::Enable(bool bDoEnable) // eg. BeginAppModalStateForWindow() will disable menus and ignore this change // which in turn causes m_isEnabled to become out of sync with real menuitem state #if wxOSX_USE_CARBON - && !(m_parentMenu && !IsMenuItemEnabled(MAC_WXHMENU(m_parentMenu->GetHMenu()), 0)) + && !(m_parentMenu && !IsMenuItemEnabled(MAC_WXHMENU(m_parentMenu->GetHMenu()), 0)) #endif ) // always update builtin menuitems @@ -121,7 +123,7 @@ void wxMenuItem::Check(bool bDoCheck) const wxMenuItemList& items = m_parentMenu->GetMenuItems(); int pos = items.IndexOf(this); wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); + wxT("menuitem not found in the menu items list?") ); // get the radio group range int start, end; @@ -174,7 +176,7 @@ void wxMenuItem::UpdateItemBitmap() { if ( !m_parentMenu ) return; - + if ( m_bitmap.Ok() ) { m_peer->SetBitmap( m_bitmap ); @@ -188,12 +190,12 @@ void wxMenuItem::UpdateItemStatus() if ( IsSeparator() ) return ; - + if ( IsCheckable() && IsChecked() ) m_peer->Check( true ); else m_peer->Check( false ); - + m_peer->Enable( IsEnabled() ); } @@ -208,7 +210,7 @@ void wxMenuItem::UpdateItemText() wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?")); text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC); } - + wxAcceleratorEntry *entry = wxAcceleratorEntry::Create( m_text ) ; m_peer->SetLabel( text, entry ); delete entry ; @@ -251,3 +253,5 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, { return new wxMenuItem(parentMenu, id, name, help, kind, subMenu); } + +#endif