Allow the wxMenu to be owned by the NSMenu so that it can be returned

from methods which Cocoa calls when a menu is to be popped up.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2004-10-15 03:06:50 +00:00
parent 3312496dcc
commit 950432e407
2 changed files with 37 additions and 2 deletions

View File

@@ -27,7 +27,9 @@ 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); }
@@ -39,8 +41,11 @@ 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
// ------------------------------------------------------------------------