Use wxObjcAutoRefFromAlloc for sm_cocoaTarget.
Move some processing code from wxMenuItemAction to CocoaItemSelected. Add Cocoa_validateMenuItem and use it instead of calling IsEnabled directly. Do not set the target or action for wxMenuItem that open submenus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
#include "wx/hashmap.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
#include "wx/cocoa/ObjcRef.h"
|
||||
|
||||
// ========================================================================
|
||||
// wxMenuItem
|
||||
// ========================================================================
|
||||
@@ -49,10 +51,12 @@ public:
|
||||
return iter->second;
|
||||
return NULL;
|
||||
}
|
||||
void CocoaItemSelected();
|
||||
bool Cocoa_validateMenuItem();
|
||||
protected:
|
||||
WX_NSMenuItem m_cocoaNSMenuItem;
|
||||
static wxMenuItemCocoaHash sm_cocoaHash;
|
||||
static struct objc_object *sm_cocoaTarget;
|
||||
static wxObjcAutoRefFromAlloc<struct objc_object *> sm_cocoaTarget;
|
||||
// ------------------------------------------------------------------------
|
||||
// Implementation
|
||||
// ------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user