+void wxMenuItem::CocoaItemSelected()
+{
+ wxMenu *menu = GetMenu();
+ wxCHECK_RET(menu,wxT("wxMenuItemAction received but wxMenuItem is not in a wxMenu"));
+ wxMenuBar *menubar = menu->GetMenuBar();
+ if(menubar)
+ {
+ wxFrame *frame = menubar->GetFrame();
+ wxCHECK_RET(frame, wxT("wxMenuBar MUST be attached to a wxFrame!"));
+ frame->ProcessCommand(GetId());
+ }
+ else
+ {
+ if(IsCheckable())
+ Toggle();
+ GetMenu()->SendEvent(GetId(), IsCheckable()?IsChecked():-1);
+ }
+}
+
+bool wxMenuItem::Cocoa_validateMenuItem()
+{
+ // TODO: do more sanity checking
+ // TODO: Do wxWindows validation here and avoid sending during idle time
+ return IsEnabled();
+}
+