X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/605c7e7ed81c740e80de66c751f50fc54bd77e4d..09b895cb4a954494063eb17d3dc302a654fd99e5:/include/wx/cocoa/menu.h diff --git a/include/wx/cocoa/menu.h b/include/wx/cocoa/menu.h index 8a75b38687..6903d190bc 100644 --- a/include/wx/cocoa/menu.h +++ b/include/wx/cocoa/menu.h @@ -4,7 +4,7 @@ // Author: David Elliott // Modified by: // Created: 2002/12/09 -// RCS-ID: $Id: +// RCS-ID: $Id: // Copyright: (c) 2002 David Elliott // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -22,12 +22,14 @@ // wxMenu // ======================================================================== -class WXDLLEXPORT wxMenu : public wxMenuBase, public wxCocoaNSMenu +class WXDLLIMPEXP_CORE 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); } @@ -39,16 +41,19 @@ public: // ------------------------------------------------------------------------ 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 @@ -68,11 +73,12 @@ private: // ======================================================================== // wxMenuBar // ======================================================================== -class WXDLLEXPORT wxMenuBar : public wxMenuBarBase, public wxCocoaNSMenu +class WXDLLIMPEXP_CORE wxMenuBar : public wxMenuBarBase { 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(); @@ -87,8 +93,6 @@ protected: // Implementation // ------------------------------------------------------------------------ public: - wxMenuItemList m_items; // the list of menu items - // implement base class virtuals virtual bool Append(wxMenu *menu, const wxString &title); virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); @@ -98,8 +102,8 @@ public: virtual void EnableTop(size_t pos, bool enable); virtual bool IsEnabledTop(size_t pos) const; - virtual void SetLabelTop(size_t pos, const wxString& label); - virtual wxString GetLabelTop(size_t pos) const; + virtual void SetMenuLabel(size_t pos, const wxString& label); + virtual wxString GetMenuLabel(size_t pos) const; virtual void Attach(wxFrame *frame); virtual void Detach();