]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement NSMenuValidation protocol for the wxNSMenuItemTarget
authorDavid Elliott <dfe@tgwbd.org>
Mon, 8 Sep 2003 20:03:16 +0000 (20:03 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 8 Sep 2003 20:03:16 +0000 (20:03 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/menuitem.mm

index ba92f411a82411b18362aec801eb98b2f586e687..67af3fde333ba7e0ee6be9663ec6a644ad0f823c 100644 (file)
@@ -47,6 +47,7 @@
 }
 
 - (void)wxMenuItemAction: (id)sender;
+- (BOOL)validateMenuItem: (id)menuItem;
 @end //interface wxNSMenuItemTarget
 
 @implementation wxNSMenuItemTarget : NSObject
     }
 }
 
+- (BOOL)validateMenuItem: (id)menuItem
+{
+    // TODO: Do wxWindows validation here and avoid sending during idle time
+    wxLogDebug("wxMenuItemAction");
+    wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem);
+    wxCHECK_MSG(item,NO,"validateMenuItem received but no wxMenuItem exists!");
+    return item->IsEnabled();
+}
+
 @end //implementation wxNSMenuItemTarget
 
 // ============================================================================