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:
David Elliott
2004-10-15 01:39:35 +00:00
parent 28d1454aff
commit d04995b3a6
2 changed files with 42 additions and 15 deletions

View File

@@ -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
// ------------------------------------------------------------------------