X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2fc2d511d0f095ab5de3713cff6042832f886d15..af5454a410ed37a8a1639716a0c96c191e60b7f0:/src/cocoa/menuitem.mm diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index ba92f411a8..e5e5e7659d 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 @@ -64,10 +65,19 @@ { wxFrame *frame = menubar->GetFrame(); wxCHECK_RET(frame, "wxMenuBar MUST be attached to a wxFrame!"); - frame->Command(item->GetId()); + frame->ProcessCommand(item->GetId()); } } +- (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 // ============================================================================