4
4
// Author: Stefan Csomor
7
// RCS-ID: $Id: toolbar.cpp 57849 2009-01-06 09:36:54Z SC $
7
// RCS-ID: $Id: toolbar.cpp 67130 2011-03-05 18:36:04Z SC $
8
8
// Copyright: (c) Stefan Csomor
9
9
// Licence: wxWindows licence
10
10
/////////////////////////////////////////////////////////////////////////////
133
133
if ( m_toolbarItemRef )
135
135
CFIndex count = CFGetRetainCount( m_toolbarItemRef ) ;
136
// different behaviour under Leopard
137
if ( UMAGetSystemVersion() < 0x1050 )
139
wxASSERT_MSG( count == 1 , wxT("Reference Count of native tool was not 1 in wxToolBarTool destructor") );
136
// different behaviour under Leopard
137
if ( UMAGetSystemVersion() < 0x1050 )
139
wxASSERT_MSG( count == 1 , wxT("Reference Count of native tool was not 1 in wxToolBarTool destructor") );
141
141
wxTheApp->MacAddToAutorelease(m_toolbarItemRef);
142
142
CFRelease(m_toolbarItemRef);
143
143
m_toolbarItemRef = NULL;
472
472
#ifdef __WXMAC_OSX__
475
int w = m_bmpNormal.GetWidth();
476
int h = m_bmpNormal.GetHeight();
475
int w = m_bmpNormal.GetWidth() + 6;
476
int h = m_bmpNormal.GetHeight() + 6;
477
477
wxBitmap bmp( w, h );
480
480
dc.SelectObject( bmp );
481
dc.SetPen( wxPen(*wxBLACK) );
482
dc.SetBrush( wxBrush( *wxLIGHT_GREY ));
483
dc.DrawRectangle( 0, 0, w, h );
484
dc.DrawBitmap( m_bmpNormal, 0, 0, true );
481
wxColour mid_grey_75 = wxColour(128, 128, 128, 196);
482
wxColour light_grey_75 = wxColour(196, 196, 196, 196);
483
dc.GradientFillLinear( wxRect(1, 1, w - 1, h-1),
484
light_grey_75, mid_grey_75, wxNORTH);
485
wxColour black_50 = wxColour(0, 0, 0, 127);
486
dc.SetPen( wxPen(black_50) );
487
dc.DrawRoundedRectangle( 0, 0, w, h, 1.5 );
488
dc.DrawBitmap( m_bmpNormal, 3, 3, true );
485
490
dc.SelectObject( wxNullBitmap );
486
491
ControlButtonContentInfo info;
487
492
wxMacCreateBitmapButton( &info, bmp, kControlContentIconRef);
679
684
case kEventToolbarItemCreateCustomView:
681
686
HIViewRef viewRef = object->viewRef ;
682
HIViewRemoveFromSuperview( viewRef ) ;
687
HIViewRemoveFromSuperview( viewRef ) ;
683
688
HIViewSetVisible(viewRef, true) ;
684
689
CFRetain( viewRef ) ;
685
690
result = SetEventParameter( inEvent, kEventParamControlRef, typeControlRef, sizeof( HIViewRef ), &viewRef );
900
905
MacInstallNativeToolbar( false );
902
907
CFIndex count = CFGetRetainCount( m_macHIToolbarRef ) ;
903
// Leopard seems to have one refcount more, so we cannot check reliably at the moment
904
if ( UMAGetSystemVersion() < 0x1050 )
906
wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in wxToolBar destructor") );
908
// Leopard seems to have one refcount more, so we cannot check reliably at the moment
909
if ( UMAGetSystemVersion() < 0x1050 )
911
wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in wxToolBar destructor") );
908
913
CFRelease( (HIToolbarRef)m_macHIToolbarRef );
909
914
m_macHIToolbarRef = NULL;