Implement NSMenuValidation protocol for the wxNSMenuItemTarget

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott
2003-09-08 20:03:16 +00:00
parent f5382a2f00
commit 42036ca82a

View File

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