From 42036ca82a4b055bf3f31dcdee6cf5a7ec464a7d Mon Sep 17 00:00:00 2001 From: David Elliott Date: Mon, 8 Sep 2003 20:03:16 +0000 Subject: [PATCH] Implement NSMenuValidation protocol for the wxNSMenuItemTarget git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/menuitem.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index ba92f411a8..67af3fde33 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -47,6 +47,7 @@ } - (void)wxMenuItemAction: (id)sender; +- (BOOL)validateMenuItem: (id)menuItem; @end //interface wxNSMenuItemTarget @implementation wxNSMenuItemTarget : NSObject @@ -68,6 +69,15 @@ } } +- (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 // ============================================================================ -- 2.45.2