added direct HICommand updating

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-04-15 19:39:44 +00:00
parent 8e7cd32b33
commit 756c27045d
2 changed files with 62 additions and 26 deletions

View File

@@ -99,6 +99,23 @@ void wxMenuItem::UpdateItemStatus()
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
#if TARGET_CARBON
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandPreferences ) ;
else
EnableMenuCommand( NULL , kHICommandPreferences ) ;
}
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandQuit ) ;
else
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
#endif
{
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
@@ -114,6 +131,7 @@ void wxMenuItem::UpdateItemStatus()
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
}
} }
void wxMenuItem::UpdateItemText() void wxMenuItem::UpdateItemText()

View File

@@ -99,6 +99,23 @@ void wxMenuItem::UpdateItemStatus()
if ( !m_parentMenu ) if ( !m_parentMenu )
return ; return ;
#if TARGET_CARBON
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandPreferences ) ;
else
EnableMenuCommand( NULL , kHICommandPreferences ) ;
}
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId)
{
if ( !IsEnabled() )
DisableMenuCommand( NULL , kHICommandQuit ) ;
else
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
#endif
{
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ; MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ; MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
if( mhandle == NULL || index == 0) if( mhandle == NULL || index == 0)
@@ -114,6 +131,7 @@ void wxMenuItem::UpdateItemStatus()
wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ; wxAcceleratorEntry *entry = wxGetAccelFromString( m_text ) ;
UMASetMenuItemShortcut( mhandle , index , entry ) ; UMASetMenuItemShortcut( mhandle , index , entry ) ;
delete entry ; delete entry ;
}
} }
void wxMenuItem::UpdateItemText() void wxMenuItem::UpdateItemText()