wxToolBarTool* tbartool = (wxToolBarTool*)data ;
if ( tbartool->CanBeToggled() )
{
+#ifdef __WXMAC_OSX__
+ ((wxToolBar*)tbartool->GetToolBar())->ToggleTool(tbartool->GetId(), !tbartool->IsToggled() );
+#else
((wxToolBar*)tbartool->GetToolBar())->ToggleTool(tbartool->GetId(), GetControl32BitValue((ControlRef)tbartool->GetControlHandle()));
+#endif
}
((wxToolBar*)tbartool->GetToolBar())->OnLeftClick( tbartool->GetId() , tbartool -> IsToggled() ) ;
result = noErr;
m_x = position.x;
m_y = position.y;
- if ( IsButton() )
+ int x , y ;
+ x = y = 0 ;
+ int mac_x = position.x ;
+ int mac_y = position.y ;
+
+ if ( ! GetToolBar()->MacGetTopLevelWindow()->MacUsesCompositing() )
{
- int x , y ;
- x = y = 0 ;
- int mac_x = position.x ;
- int mac_y = position.y ;
-#ifdef __WXMAC_OSX__
- // already correctly set up
-#else
- WindowRef rootwindow = (WindowRef) GetToolBar()->MacGetTopLevelWindowRef() ;
GetToolBar()->MacWindowToRootWindow( &x , &y ) ;
mac_x += x;
mac_y += y;
-#endif
+ }
+
+ if ( IsButton() )
+ {
Rect contrlRect ;
GetControlBounds( m_controlHandle , &contrlRect ) ;
int former_mac_x = contrlRect.left ;
{
// separator
#ifdef __WXMAC_OSX__
- int x , y ;
- x = y = 0 ;
- int mac_x = position.x ;
- int mac_y = position.y ;
-
Rect contrlRect ;
GetControlBounds( m_controlHandle , &contrlRect ) ;
int former_mac_x = contrlRect.left ;
else
{
ControlButtonContentInfo info ;
- wxMacCreateBitmapButton( &info , GetNormalBitmap() ) ;
+ wxMacCreateBitmapButton( &info , GetNormalBitmap() , kControlContentIconRef ) ;
#ifdef __WXMAC_OSX__
CreateIconControl( window , &toolrect , &info , false , &m_controlHandle ) ;