// Licence: The wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "toolbar.h"
#endif
-#include "wx/wx.h"
+#include "wx/wxprec.h"
#if wxUSE_TOOLBAR
+#include "wx/wx.h"
#include "wx/toolbar.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
CreateBevelButtonControl( window , &toolrect , CFSTR("") , kControlBevelButtonNormalBevel , behaviour , &info ,
0 , 0 , 0 , &m_controlHandle ) ;
+ wxMacReleaseBitmapButton( &info ) ;
+
InstallControlEventHandler( (ControlRef) m_controlHandle, GetwxMacToolBarToolEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this,NULL);
// if not set yet, only one row
SetRows(1);
}
+ m_minWidth = maxWidth;
maxWidth = tw ;
maxHeight += m_yMargin + kwxMacToolBarTopMargin;
- m_maxHeight = maxHeight ;
+ m_minHeight = m_maxHeight = maxHeight ;
}
else
{
// if not set yet, have one column
SetRows(GetToolsCount());
}
+ m_minHeight = maxHeight;
maxHeight = th ;
maxWidth += m_xMargin + kwxMacToolBarLeftMargin;
- m_maxWidth = maxWidth ;
+ m_minWidth = m_maxWidth = maxWidth ;
}
SetSize( maxWidth, maxHeight );
void wxToolBar::DoEnableTool(wxToolBarToolBase *t, bool enable)
{
- if (!IsShown())
- return ;
-
((wxToolBarTool*)t)->DoEnable( enable ) ;
}
void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle)
{
- if (!IsShown())
- return ;
-
wxToolBarTool *tool = (wxToolBarTool *)t;
if ( tool->IsButton() )
{
void wxToolBar::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this) ;
+#if wxMAC_USE_CORE_GRAPHICS
+#else
wxMacPortSetter helper(&dc) ;
int w, h ;
GetSize( &w , &h ) ;
{
#if TARGET_API_MAC_OSX
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
- if ( UMAGetSystemVersion() >= 0x1030 )
- {
- HIRect hiToolbarrect = CGRectMake( dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) ,
- dc.YLOG2DEVREL(h) , dc.XLOG2DEVREL(w) );
- CGContextRef cgContext ;
- Rect bounds ;
- GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ;
- QDBeginCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ;
- CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ;
- CGContextScaleCTM( cgContext , 1 , -1 ) ;
+ if ( UMAGetSystemVersion() >= 0x1030 )
+ {
+ HIRect hiToolbarrect = CGRectMake( dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) ,
+ dc.YLOG2DEVREL(h) , dc.XLOG2DEVREL(w) );
+ CGContextRef cgContext ;
+ Rect bounds ;
+ GetPortBounds( (CGrafPtr) dc.m_macPort , &bounds ) ;
+ QDBeginCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ;
+ CGContextTranslateCTM( cgContext , 0 , bounds.bottom - bounds.top ) ;
+ CGContextScaleCTM( cgContext , 1 , -1 ) ;
+ {
+ HIThemeBackgroundDrawInfo drawInfo ;
+ drawInfo.version = 0 ;
+ drawInfo.state = kThemeStateActive ;
+ drawInfo.kind = kThemeBackgroundMetal ;
+ HIThemeApplyBackground( &hiToolbarrect, &drawInfo , cgContext,kHIThemeOrientationNormal) ;
+ }
+ QDEndCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ;
+ }
+ else
+#endif
{
- HIThemeBackgroundDrawInfo drawInfo ;
- drawInfo.version = 0 ;
- drawInfo.state = kThemeStateActive ;
- drawInfo.kind = kThemeBackgroundMetal ;
- HIThemeApplyBackground( &hiToolbarrect, &drawInfo , cgContext,kHIThemeOrientationNormal) ;
+ UMADrawThemePlacard( &toolbarrect , IsEnabled() ? kThemeStateActive : kThemeStateInactive) ;
}
- QDEndCGContext( (CGrafPtr) dc.m_macPort , &cgContext ) ;
- }
- else
#endif
- {
- UMADrawThemePlacard( &toolbarrect , IsEnabled() ? kThemeStateActive : kThemeStateInactive) ;
}
#endif
- }
+
event.Skip() ;
}