+ (short) headerRect.origin.y, (short) headerRect.origin.x,
+ (short) (headerRect.origin.y + headerRect.size.height),
+ (short) (headerRect.origin.x + headerRect.size.width)
+ };
+
+ RgnHandle updateRgn = NewRgn();
+ RectRgn( updateRgn, &r );
+ HIViewSetNeedsDisplayInRegion( (HIViewRef) win->GetHandle(), updateRgn, true );
+ DisposeRgn( updateRgn );
+ }
+ else
+ {
+ CGContextRef cgContext;
+ cgContext = (CGContextRef) dc.GetGraphicsContext()->GetNativeContext();
+
+ HIThemeButtonDrawInfo drawInfo;
+ HIRect labelRect;
+
+ memset( &drawInfo, 0, sizeof(drawInfo) );
+ drawInfo.version = 0;
+ drawInfo.kind = kind;
+ drawInfo.state = (flags & wxCONTROL_DISABLED) ? kThemeStateInactive : kThemeStateActive;
+ drawInfo.value = (flags & wxCONTROL_SELECTED) ? kThemeButtonOn : kThemeButtonOff;
+ if (flags & wxCONTROL_UNDETERMINED)
+ drawInfo.value = kThemeButtonMixed;
+ drawInfo.adornment = adornment;
+
+ HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
+ }
+}
+
+void
+wxRendererMac::DrawCheckBox(wxWindow *win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ if (flags & wxCONTROL_CHECKED)
+ flags |= wxCONTROL_SELECTED;
+
+ DrawMacThemeButton(win, dc, rect, flags,
+ kThemeCheckBox, kThemeAdornmentNone);
+}
+
+void
+wxRendererMac::DrawComboBoxDropButton(wxWindow *win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ int kind;
+ if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
+ kind = kThemeArrowButtonSmall;
+ else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
+ kind = kThemeArrowButtonMini;
+ else
+ kind = kThemeArrowButton;
+
+ DrawMacThemeButton(win, dc, rect, flags,
+ kind, kThemeAdornmentArrowDownArrow);
+}
+
+void
+wxRendererMac::DrawPushButton(wxWindow *win,
+ wxDC& dc,
+ const wxRect& rect,
+ int flags)
+{
+ int kind;
+ if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
+ kind = kThemeBevelButtonSmall;
+ // There is no kThemeBevelButtonMini, but in this case, use Small
+ else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI || (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
+ kind = kThemeBevelButtonSmall;
+ else
+ kind = kThemeBevelButton;
+
+ DrawMacThemeButton(win, dc, rect, flags,
+ kind, kThemeAdornmentNone);
+}
+
+void
+wxRendererMac::DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
+{
+ if (!win)
+ {
+ wxDelegateRendererNative::DrawFocusRect(win, dc, rect, flags);
+ return;