MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
+ DoUpdateItemBitmap( mhandle, index );
+}
+
+void wxMenuItem::DoUpdateItemBitmap( WXHMENU menu, wxUint16 index)
+{
+ MenuHandle mhandle = (MenuHandle) menu;
+
if ( mhandle == NULL || index == 0)
return ;
if ( info.contentType == kControlContentIconRef )
SetMenuItemIconHandle( mhandle , index ,
kMenuIconRefType , (Handle) info.u.iconRef ) ;
+ else if ( info.contentType == kControlContentCGImageRef )
+ SetMenuItemIconHandle( mhandle , index ,
+ kMenuCGImageRefType , (Handle) info.u.imageRef ) ;
}
wxMacReleaseBitmapButton( &info ) ;
#endif
if ( IsSeparator() )
return ;
-#if TARGET_CARBON
- if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
+ if ( GetId() == wxApp::s_macPreferencesMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandPreferences ) ;
EnableMenuCommand( NULL , kHICommandPreferences ) ;
}
- if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId)
+ if ( GetId() == wxApp::s_macExitMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandQuit ) ;
else
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
-#endif
{
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
void wxMenuItem::Enable(bool bDoEnable)
{
if (( m_isEnabled != bDoEnable
-#if TARGET_CARBON
// avoid changing menuitem state when menu is disabled
// eg. BeginAppModalStateForWindow() will disable menus and ignore this change
// which in turn causes m_isEnabled to become out of sync with real menuitem state
|| ( GetId() == wxApp::s_macPreferencesMenuItemId
|| GetId() == wxApp::s_macExitMenuItemId
|| GetId() == wxApp::s_macAboutMenuItemId
-#endif
))
{
wxMenuItemBase::Enable( bDoEnable ) ;