added forcing to image conversion to always attempt a color icon (needed eg for menus)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-08-25 21:02:39 +00:00
parent 9ac71bef07
commit 93e5d8999f
5 changed files with 71 additions and 15 deletions

View File

@@ -209,10 +209,34 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
if ( pos == (size_t)-1 )
{
UMAAppendMenuItem(MAC_WXHMENU(m_hMenu), label,key,modifiers);
if ( pItem->GetBitmap().Ok() )
{
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , pItem->GetBitmap() , true ) ;
if ( info.contentType != kControlNoContent )
{
if ( info.contentType == kControlContentCIconHandle )
SetMenuItemIconHandle( MAC_WXHMENU(m_hMenu) , CountMenuItems(MAC_WXHMENU(m_hMenu) ) ,
kMenuColorIconType , (Handle) info.u.cIconHandle ) ;
}
}
}
else
{
UMAInsertMenuItem(MAC_WXHMENU(m_hMenu), label , pos,key,modifiers);
if ( pItem->GetBitmap().Ok() )
{
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , pItem->GetBitmap() , true ) ;
if ( info.contentType != kControlNoContent )
{
if ( info.contentType == kControlContentCIconHandle )
SetMenuItemIconHandle( MAC_WXHMENU(m_hMenu) , pos ,
kMenuColorIconType , (Handle) info.u.cIconHandle ) ;
}
}
}
if ( pItem->GetId() == idMenuTitle )
{