using CGImage for all native toolbar items
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -481,10 +481,10 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
|
|||||||
#if wxMAC_USE_NATIVE_TOOLBAR
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
||||||
if (m_toolbarItemRef != NULL)
|
if (m_toolbarItemRef != NULL)
|
||||||
{
|
{
|
||||||
if ( info.contentType == kControlContentIconRef )
|
ControlButtonContentInfo info2;
|
||||||
HIToolbarItemSetIconRef( m_toolbarItemRef, info.u.iconRef );
|
wxMacCreateBitmapButton( &info2, bmp, kControlContentCGImageRef);
|
||||||
else
|
HIToolbarItemSetImage( m_toolbarItemRef, info2.u.imageRef );
|
||||||
HIToolbarItemSetImage( m_toolbarItemRef, info.u.imageRef );
|
wxMacReleaseBitmapButton( &info2 );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wxMacReleaseBitmapButton( &info );
|
wxMacReleaseBitmapButton( &info );
|
||||||
@@ -497,10 +497,10 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
|
|||||||
#if wxMAC_USE_NATIVE_TOOLBAR
|
#if wxMAC_USE_NATIVE_TOOLBAR
|
||||||
if (m_toolbarItemRef != NULL)
|
if (m_toolbarItemRef != NULL)
|
||||||
{
|
{
|
||||||
if ( info.contentType == kControlContentIconRef )
|
ControlButtonContentInfo info2;
|
||||||
HIToolbarItemSetIconRef( m_toolbarItemRef, info.u.iconRef );
|
wxMacCreateBitmapButton( &info2, m_bmpNormal, kControlContentCGImageRef);
|
||||||
else
|
HIToolbarItemSetImage( m_toolbarItemRef, info2.u.imageRef );
|
||||||
HIToolbarItemSetImage( m_toolbarItemRef, info.u.imageRef );
|
wxMacReleaseBitmapButton( &info2 );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wxMacReleaseBitmapButton( &info );
|
wxMacReleaseBitmapButton( &info );
|
||||||
@@ -1532,16 +1532,18 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
|
|||||||
kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft | kHIToolbarItemAllowDuplicates, &item );
|
kHIToolbarItemCantBeRemoved | kHIToolbarItemAnchoredLeft | kHIToolbarItemAllowDuplicates, &item );
|
||||||
if (err == noErr)
|
if (err == noErr)
|
||||||
{
|
{
|
||||||
|
ControlButtonContentInfo info2;
|
||||||
|
wxMacCreateBitmapButton( &info2, tool->GetNormalBitmap(), kControlContentCGImageRef);
|
||||||
|
|
||||||
InstallEventHandler(
|
InstallEventHandler(
|
||||||
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
|
HIObjectGetEventTarget(item), GetwxMacToolBarEventHandlerUPP(),
|
||||||
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
|
GetEventTypeCount(toolBarEventList), toolBarEventList, tool, NULL );
|
||||||
HIToolbarItemSetLabel( item, wxMacCFStringHolder(tool->GetLabel(), m_font.GetEncoding()) );
|
HIToolbarItemSetLabel( item, wxMacCFStringHolder(tool->GetLabel(), m_font.GetEncoding()) );
|
||||||
if ( info.contentType == kControlContentIconRef )
|
HIToolbarItemSetImage( item, info2.u.imageRef );
|
||||||
HIToolbarItemSetIconRef( item, info.u.iconRef );
|
|
||||||
else
|
|
||||||
HIToolbarItemSetImage( item, info.u.imageRef );
|
|
||||||
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
|
HIToolbarItemSetCommandID( item, kHIToolbarCommandPressAction );
|
||||||
tool->SetToolbarItemRef( item );
|
tool->SetToolbarItemRef( item );
|
||||||
|
|
||||||
|
wxMacReleaseBitmapButton( &info2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user