void UMASetMenuItemShortcut( MenuRef menu , MenuItemIndex item , wxAcceleratorEntry *entry )
{
if ( !entry )
+ {
+ SetMenuItemCommandKey(menu, item, false, 0);
return ;
+ }
UInt8 modifiers = 0 ;
SInt16 key = entry->GetKeyCode() ;
wxUnusedVar(menuItem);
if( impl )
{
- if ( impl->GetWXPeer()->GetMenu()->HandleCommandUpdateStatus(impl->GetWXPeer()) )
- return impl->GetWXPeer()->IsEnabled();
+ wxMenuItem* wxmenuitem = impl->GetWXPeer();
+ if ( wxmenuitem )
+ {
+ wxmenuitem->GetMenu()->HandleCommandUpdateStatus(wxmenuitem);
+ return wxmenuitem->IsEnabled();
+ }
}
return YES ;
}
void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry* entry )
{
+ if ( entry == NULL )
+ {
+ [menuItem setKeyEquivalent:@""];
+ return;
+ }
+
unsigned int modifiers = 0 ;
int key = entry->GetKeyCode() ;
if ( key )
wxCFStringRef cfText(text);
[m_osxMenuItem setTitle:cfText.AsNSString()];
- if ( entry )
- wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry );
-
+ wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry );
}
bool DoDefault();
}
else
{
- if ( entry )
- wxMacCocoaMenuItemSetAccelerator( menuitem, entry );
+ wxMacCocoaMenuItemSetAccelerator( menuitem, entry );
}
item = menuitem;
}
wxMenuItem* menuitem = mbar->FindItem(wxOSXGetIdFromSelector(action), &menu);
if ( menu != NULL && menuitem != NULL)
{
- if ( menu->HandleCommandUpdateStatus(menuitem) )
- return menuitem->IsEnabled();
+ menu->HandleCommandUpdateStatus(menuitem);
+ return menuitem->IsEnabled();
}
}
return YES;