bitmap support factored

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2007-05-23 04:19:39 +00:00
parent 2693d8c121
commit a684b88f30
3 changed files with 13 additions and 2 deletions

View File

@@ -47,6 +47,8 @@ public:
void UpdateItemBitmap() ;
void UpdateItemText() ;
void UpdateItemStatus() ;
void DoUpdateItemBitmap( WXHMENU menu, wxUint16 index) ;
// mark item as belonging to the given radio group
void SetAsRadioGroupStart();

View File

@@ -754,8 +754,10 @@ void wxMenuBar::MacInstallMenuBar()
if ( mh )
{
UMAAppendMenuItem(mh, wxStripMenuCodes(item->GetText()) , wxFont::GetDefaultEncoding(), entry);
SetMenuItemCommandID( mh , CountMenuItems(mh) , wxIdToMacCommand ( item->GetId() ) ) ;
SetMenuItemRefCon( mh , CountMenuItems(mh) , (URefCon) item ) ;
MenuItemIndex position = CountMenuItems(mh);
SetMenuItemCommandID( mh , position, wxIdToMacCommand ( item->GetId() ) );
SetMenuItemRefCon( mh , position, (URefCon) item );
item->DoUpdateItemBitmap( mh, position );
}
}

View File

@@ -63,6 +63,13 @@ void wxMenuItem::UpdateItemBitmap()
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 ;