git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36569
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
if ( !m_parentMenu )
return ;
{
if ( !m_parentMenu )
return ;
+
+ if ( IsSeparator() )
+ return ;
#if TARGET_CARBON
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
#if TARGET_CARBON
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macPreferencesMenuItemId)
else
EnableMenuCommand( NULL , kHICommandPreferences ) ;
}
else
EnableMenuCommand( NULL , kHICommandPreferences ) ;
}
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId)
{
if ( !IsEnabled() )
if ( UMAGetSystemVersion() >= 0x1000 && GetId() == wxApp::s_macExitMenuItemId)
{
if ( !IsEnabled() )
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
#endif
EnableMenuCommand( NULL , kHICommandQuit ) ;
}
#endif
{
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
{
MenuHandle mhandle = MAC_WXHMENU(m_parentMenu->GetHMenu()) ;
MenuItemIndex index = m_parentMenu->MacGetIndexFromItem( this ) ;
- if( mhandle == NULL || index == 0)
+ if ( mhandle == NULL || index == 0)
return ;
UMAEnableMenuItem( mhandle , index , m_isEnabled ) ;
return ;
UMAEnableMenuItem( mhandle , index , m_isEnabled ) ;
void wxMenuItem::Enable(bool bDoEnable)
{
if (( m_isEnabled != bDoEnable
void wxMenuItem::Enable(bool bDoEnable)
{
if (( m_isEnabled != bDoEnable
void wxMenuItem::UncheckRadio()
{
if ( m_isChecked )
void wxMenuItem::UncheckRadio()
{
if ( m_isChecked )
void wxMenuItem::Check(bool bDoCheck)
{
void wxMenuItem::Check(bool bDoCheck)
{
- wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") );
+ wxCHECK_RET( IsCheckable() && !IsSeparator(), wxT("only checkable items may be checked") );
if ( m_isChecked != bDoCheck )
{
if ( m_isChecked != bDoCheck )
{
_T("menuitem not found in the menu items list?") );
// get the radio group range
_T("menuitem not found in the menu items list?") );
// get the radio group range
if ( m_isRadioGroupStart )
{
if ( m_isRadioGroupStart )
{
for ( int n = start; n <= end && node; n++ )
{
if ( n != pos )
for ( int n = start; n <= end && node; n++ )
{
if ( n != pos )
((wxMenuItem*)node->GetData())->UncheckRadio();
((wxMenuItem*)node->GetData())->UncheckRadio();
node = node->GetNext();
}
}
node = node->GetNext();
}
}