X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b880f293e6c07997a47ab6535ca1bb77a7bc19f..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/cocoa/menu.mm diff --git a/src/cocoa/menu.mm b/src/cocoa/menu.mm index fc5e4b038c..b02bb35b34 100644 --- a/src/cocoa/menu.mm +++ b/src/cocoa/menu.mm @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/menu.cpp +// Name: src/cocoa/menu.mm // 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 +// Licence: wxWindows 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 @@ -39,12 +41,10 @@ // wxMenu implementation // ============================================================================ -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; } @@ -113,7 +113,6 @@ void wxMenu::Cocoa_dealloc() // ============================================================================ // wxMenuBar implementation // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow) bool wxMenuBar::Create(long style) { @@ -213,11 +212,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()];