+
+void wxRendererMac::DrawChoice(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 = kThemePopupButtonSmall;
+ else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI ||
+ (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
+ kind = kThemePopupButtonMini;
+ else
+ kind = kThemePopupButton;
+
+ DrawMacThemeButton(win, dc, rect, flags, kind, kThemeAdornmentNone);
+}
+
+
+void wxRendererMac::DrawComboBox(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 = kThemeComboBoxSmall;
+ else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI ||
+ (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
+ kind = kThemeComboBoxMini;
+ else
+ kind = kThemeComboBox;
+
+ DrawMacThemeButton(win, dc, rect, flags, kind, kThemeAdornmentNone);
+}
+
+void wxRendererMac::DrawRadioButton(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 = kThemeRadioButtonSmall;
+ else if (win->GetWindowVariant() == wxWINDOW_VARIANT_MINI ||
+ (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_MINI))
+ kind = kThemeRadioButtonMini;
+ else
+ kind = kThemeRadioButton;
+
+ if (flags & wxCONTROL_CHECKED)
+ flags |= wxCONTROL_SELECTED;
+
+ DrawMacThemeButton(win, dc, rect, flags,
+ kind, kThemeAdornmentNone);
+}
+
+void wxRendererMac::DrawTextCtrl(wxWindow* win, wxDC& dc,
+ const wxRect& rect, int flags)
+{
+ const wxCoord x = rect.x;
+ const wxCoord y = rect.y;
+ const wxCoord w = rect.width;
+ const wxCoord h = rect.height;
+
+ dc.SetBrush( *wxWHITE_BRUSH );
+ dc.SetPen( *wxTRANSPARENT_PEN );
+ dc.DrawRectangle(rect);
+
+ dc.SetBrush( *wxTRANSPARENT_BRUSH );
+
+ HIRect hiRect = CGRectMake( x, y, w, h );
+ if ( !wxInPaintEvent(win, dc) )
+ {
+ win->Refresh( &rect );
+ }
+ else
+ {
+ CGContextRef cgContext;
+
+ cgContext = (CGContextRef) static_cast<wxGCDCImpl*>(dc.GetImpl())->GetGraphicsContext()->GetNativeContext();
+
+ {
+ HIThemeFrameDrawInfo drawInfo;
+
+ memset( &drawInfo, 0, sizeof(drawInfo) );
+ drawInfo.version = 0;
+ drawInfo.kind = kHIThemeFrameTextFieldSquare;
+ drawInfo.state = (flags & wxCONTROL_DISABLED) ? kThemeStateInactive : kThemeStateActive;
+ if (flags & wxCONTROL_FOCUSED)
+ drawInfo.isFocused = true;
+
+ HIThemeDrawFrame( &hiRect, &drawInfo, cgContext, kHIThemeOrientationNormal);
+ }
+ }
+}
+