#include "wx/menu.h"
#include "wx/menuitem.h"
+#include <wx/mac/uma.h>
// ============================================================================
// implementation
// ============================================================================
m_pSubMenu = pSubMenu;
m_idItem = id;
m_bEnabled = TRUE;
+
+ if ( m_strName == "E&xit" ||m_strName == "Exit" )
+ {
+ m_strName = "Quit\tCtrl+Q" ;
+ }
}
wxMenuItem::~wxMenuItem()
void wxMenuItem::Enable(bool bDoEnable)
{
if ( m_bEnabled != bDoEnable ) {
- if ( m_pSubMenu == NULL ) { // normal menu item
- // TODO
+ if ( m_pSubMenu == NULL )
+ {
+ // normal menu item
+ if ( m_pParentMenu->m_macMenuHandle )
+ {
+ int index = m_pParentMenu->MacGetIndexFromItem( this ) ;
+ if ( index >= 1 )
+ {
+ if ( bDoEnable )
+ UMAEnableMenuItem( m_pParentMenu->m_macMenuHandle , index ) ;
+ else
+ UMADisableMenuItem( m_pParentMenu->m_macMenuHandle , index ) ;
+ }
+ }
}
- else // submenu
+ else
{
- // TODO
+ // submenu
+ if ( m_pParentMenu->m_macMenuHandle )
+ {
+ int index = m_pParentMenu->MacGetIndexFromItem( this ) ;
+ if ( index >= 1 )
+ {
+ if ( bDoEnable )
+ UMAEnableMenuItem( m_pParentMenu->m_macMenuHandle , index ) ;
+ else
+ UMADisableMenuItem( m_pParentMenu->m_macMenuHandle , index ) ;
+ }
+ }
}
m_bEnabled = bDoEnable;
{
wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
- if ( m_bChecked != bDoCheck ) {
- // TODO
+ if ( m_bChecked != bDoCheck )
+ {
m_bChecked = bDoCheck;
+ if ( m_pParentMenu->m_macMenuHandle )
+ {
+ int index = m_pParentMenu->MacGetIndexFromItem( this ) ;
+ if ( index >= 1 )
+ {
+ if ( bDoCheck )
+ ::SetItemMark( m_pParentMenu->m_macMenuHandle , index , 0x12 ) ; // checkmark
+ else
+ ::SetItemMark( m_pParentMenu->m_macMenuHandle , index , 0 ) ; // no mark
+ }
+ }
}
}
\ No newline at end of file