X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/294ea16de3359844cb884baad219b40ea04fac48..35c9a66079b6468e7fdb76771efe211625ae5a3a:/src/cocoa/menu.mm?ds=sidebyside diff --git a/src/cocoa/menu.mm b/src/cocoa/menu.mm index c39d49cb0b..4ec5859993 100644 --- a/src/cocoa/menu.mm +++ b/src/cocoa/menu.mm @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/menu.cpp +// Name: src/cocoa/menu.cpp // Purpose: wxMenu and wxMenuBar implementation // Author: David Elliott // Modified by: // Created: 2002/12/09 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2002 David Elliott // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// @@ -18,8 +18,10 @@ // ---------------------------------------------------------------------------- #include "wx/wxprec.h" + +#include "wx/menu.h" + #ifndef WX_PRECOMP - #include "wx/menu.h" #include "wx/log.h" #endif // WX_PRECOMP @@ -27,7 +29,7 @@ #include "wx/cocoa/string.h" #import -#import +#include "wx/cocoa/objc/NSMenu.h" #if wxUSE_MENUS @@ -44,7 +46,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler) bool wxMenu::Create(const wxString& title, long style) { wxAutoNSAutoreleasePool pool; - m_cocoaNSMenu = [[NSMenu alloc] initWithTitle: wxNSStringWithWxString(title)]; + m_cocoaNSMenu = [[WX_GET_OBJC_CLASS(WXNSMenu) alloc] initWithTitle: wxNSStringWithWxString(title)]; AssociateNSMenu(m_cocoaNSMenu); return true; } @@ -128,11 +130,14 @@ bool wxMenuBar::Create(long style) return true; } -wxMenuBar::wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long WXUNUSED(style)) +wxMenuBar::wxMenuBar(size_t n, + wxMenu *menus[], + const wxString titles[], + long style) { Create(style); - for(size_t i = 0; i < n; ++i ) + for ( size_t i = 0; i < n; ++i ) Append(menus[i], titles[i]); } @@ -210,11 +215,11 @@ bool wxMenuBar::IsEnabledTop(size_t pos) const return false; } -void wxMenuBar::SetLabelTop(size_t pos, const wxString& label) +void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) { } -wxString wxMenuBar::GetLabelTop(size_t pos) const +wxString wxMenuBar::GetMenuLabel(size_t pos) const { wxMenu *menu = GetMenu(pos); int itemindex = [m_cocoaNSMenu indexOfItemWithSubmenu:menu->GetNSMenu()];