X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb896a322a2ed53d393ee738765ddd3f72cee004..e4277538a535d6d6c049f0b0ead9ed2b07cd93f2:/include/wx/cocoa/menu.h diff --git a/include/wx/cocoa/menu.h b/include/wx/cocoa/menu.h index 814599dea0..21ceed2f32 100644 --- a/include/wx/cocoa/menu.h +++ b/include/wx/cocoa/menu.h @@ -27,18 +27,33 @@ class WXDLLEXPORT wxMenu : public wxMenuBase, public wxCocoaNSMenu public: // ctors and dtor wxMenu(const wxString& title, long style = 0) - : wxMenuBase(title, style) { Create(title,style); } + : wxMenuBase(title, style) + , m_cocoaDeletes(false) + { Create(title,style); } bool Create(const wxString& title, long style = 0); wxMenu(long style = 0) : wxMenuBase(style) { Create(wxEmptyString, style); } virtual ~wxMenu(); +// ------------------------------------------------------------------------ +// Cocoa specifics +// ------------------------------------------------------------------------ +public: + inline WX_NSMenu GetNSMenu() { return m_cocoaNSMenu; } + void SetCocoaDeletes(bool cocoaDeletes); + virtual void Cocoa_dealloc(); +protected: + WX_NSMenu m_cocoaNSMenu; + bool m_cocoaDeletes; +// ------------------------------------------------------------------------ +// Implementation +// ------------------------------------------------------------------------ protected: // implement base class virtuals - virtual bool DoAppend(wxMenuItem *item); - virtual bool DoInsert(size_t pos, wxMenuItem *item); - virtual wxMenuItem *DoRemove(wxMenuItem *item); + virtual wxMenuItem* DoAppend(wxMenuItem *item); + virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); + virtual wxMenuItem* DoRemove(wxMenuItem *item); #if wxUSE_ACCEL // add/remove accel for the given menu item @@ -63,11 +78,21 @@ class WXDLLEXPORT wxMenuBar : public wxMenuBarBase, public wxCocoaNSMenu public: // ctors and dtor wxMenuBar(long style = 0) { Create(style); } + wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long style = 0); bool Create(long style = 0); virtual ~wxMenuBar(); - wxMenuItemList m_items; // the list of menu items - +// ------------------------------------------------------------------------ +// Cocoa specifics +// ------------------------------------------------------------------------ +public: + inline WX_NSMenu GetNSMenu() { return m_cocoaNSMenu; } +protected: + WX_NSMenu m_cocoaNSMenu; +// ------------------------------------------------------------------------ +// Implementation +// ------------------------------------------------------------------------ +public: // implement base class virtuals virtual bool Append(wxMenu *menu, const wxString &title); virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);