- wxMacWindowClipper clipper(win) ;
- Rect rect = { y , x , y + h , x + w } ;
- wxPoint origin = win->GetClientAreaOrigin() ;
- int dx , dy ;
- dx = origin.x ;
- dy = origin.y ;
- win->MacWindowToRootWindow( &dx , &dy ) ;
- OffsetRect( &rect , dx , dy ) ;
-
- ThemeButtonDrawInfo drawInfo ;
- memset( &drawInfo , 0 , sizeof(drawInfo) ) ;
- drawInfo.state = ( flags & wxCONTROL_DISABLED ) ? kThemeStateInactive : kThemeStateActive ;
- drawInfo.value = 0 ;
- drawInfo.adornment = kThemeAdornmentNone ;
- DrawThemeButton( &rect , kThemeListHeaderButton , &drawInfo , NULL , NULL , NULL , 0 ) ;
+ CGContextRef cgContext;
+
+ wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl();
+ cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext();
+
+ HIThemeButtonDrawInfo drawInfo;
+ HIRect labelRect;
+
+ memset( &drawInfo, 0, sizeof(drawInfo) );
+ drawInfo.version = 0;
+ drawInfo.kind = kThemeDisclosureButton;
+ drawInfo.state = (flags & wxCONTROL_DISABLED) ? kThemeStateInactive : kThemeStateActive;
+ // Apple mailing list posts say to use the arrow adornment constants, but those don't work.
+ // We need to set the value using the 'old' DrawThemeButton constants instead.
+ drawInfo.value = (flags & wxCONTROL_EXPANDED) ? kThemeDisclosureDown : kThemeDisclosureRight;
+ drawInfo.adornment = kThemeAdornmentNone;
+
+ HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
+ }
+}
+
+void wxRendererMac::DrawSplitterSash( wxWindow *win,
+ wxDC& dc,
+ const wxSize& size,
+ wxCoord position,
+ wxOrientation orient,
+ int WXUNUSED(flags) )
+{
+ bool hasMetal = win->MacGetTopLevelWindow()->MacGetMetalAppearance();
+ SInt32 height;
+ GetThemeMetric( kThemeMetricSmallPaneSplitterHeight, &height );
+ HIRect splitterRect;
+ if (orient == wxVERTICAL)
+ splitterRect = CGRectMake( position, 0, height, size.y );
+ else
+ splitterRect = CGRectMake( 0, position, size.x, height );
+
+ // under compositing we should only draw when called by the OS, otherwise just issue a redraw command
+ // strange redraw errors occur if we don't do this
+
+ if ( !dc.IsKindOf( CLASSINFO( wxPaintDC ) ) )
+ {
+ wxRect rect( (int) splitterRect.origin.x, (int) splitterRect.origin.y, (int) splitterRect.size.width,
+ (int) splitterRect.size.height );
+ win->Refresh( &rect );
+ }
+ else
+ {
+ CGContextRef cgContext;
+ wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl();
+ cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext();
+
+ HIThemeSplitterDrawInfo drawInfo;
+ drawInfo.version = 0;
+ drawInfo.state = kThemeStateActive;
+ drawInfo.adornment = hasMetal ? kHIThemeSplitterAdornmentMetal : kHIThemeSplitterAdornmentNone;
+ HIThemeDrawPaneSplitter( &splitterRect, &drawInfo, cgContext, kHIThemeOrientationNormal );