CW5.2 Pro Adaptions, wxMac starting to move in

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
1999-11-05 09:16:09 +00:00
parent 20f2deb3cf
commit 519cb848a8
176 changed files with 19303 additions and 9141 deletions

View File

@@ -16,6 +16,7 @@
#include "wx/menu.h"
#include "wx/menuitem.h"
#include <wx/mac/uma.h>
// ============================================================================
// implementation
// ============================================================================
@@ -49,6 +50,11 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
m_pSubMenu = pSubMenu;
m_idItem = id;
m_bEnabled = TRUE;
if ( m_strName == "E&xit" ||m_strName == "Exit" )
{
m_strName = "Quit\tCtrl+Q" ;
}
}
wxMenuItem::~wxMenuItem()
@@ -73,12 +79,35 @@ void wxMenuItem::DeleteSubMenu()
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;
@@ -89,7 +118,19 @@ void wxMenuItem::Check(bool bDoCheck)
{
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
}
}
}
}