X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1673e527f08395de6864b09540162ca409a3c28..6af984df34c71bc14648a7b5bf1ad3c3cd07fc05:/src/mac/carbon/renderer.cpp diff --git a/src/mac/carbon/renderer.cpp b/src/mac/carbon/renderer.cpp index e72aa9a748..fb16dd723a 100644 --- a/src/mac/carbon/renderer.cpp +++ b/src/mac/carbon/renderer.cpp @@ -121,17 +121,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win, HIRect headerRect = CGRectMake( x, y, w, h ); if ( !dc.IsKindOf( CLASSINFO( wxPaintDC ) ) ) { - Rect r = - { - (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 ); + win->Refresh( &rect ); } else { @@ -213,17 +203,7 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win, HIRect headerRect = CGRectMake( x, y, w, h ); if ( !dc.IsKindOf( CLASSINFO( wxPaintDC ) ) ) { - Rect r = - { - (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 ); + win->Refresh( &rect ); } else { @@ -268,19 +248,10 @@ void wxRendererMac::DrawSplitterSash( wxWindow *win, if ( !dc.IsKindOf( CLASSINFO( wxPaintDC ) ) ) { - Rect r = - { - (short) splitterRect.origin.y, - (short) splitterRect.origin.x, - (short) (splitterRect.origin.y + splitterRect.size.height), - (short) (splitterRect.origin.x + splitterRect.size.width) - }; - - RgnHandle updateRgn = NewRgn(); - RectRgn( updateRgn, &r ); - HIViewSetNeedsDisplayInRegion( (HIViewRef) win->GetHandle(), updateRgn, true ); - DisposeRgn( updateRgn ); - } + wxRect rect( (int) splitterRect.origin.x, (int) splitterRect.origin.y, (int) splitterRect.size.width, + (int) splitterRect.size.height ); + win->Refresh( &rect ); + } else { CGContextRef cgContext; @@ -303,21 +274,12 @@ wxRendererMac::DrawItemSelectionRect(wxWindow *win, { if ( !(flags & wxCONTROL_SELECTED) ) return; - - if (flags & wxCONTROL_FOCUSED) - { - if (!IsControlActive( (ControlRef)win->GetHandle() )) - flags = wxCONTROL_SELECTED; - } - - RGBColor selColor; - GetThemeBrushAsColor(flags & wxCONTROL_FOCUSED - ? kThemeBrushAlternatePrimaryHighlightColor - : kThemeBrushSecondaryHighlightColor, - 32, true, &selColor); - - wxBrush selBrush(selColor); - + + wxColour col( wxMacCreateCGColorFromHITheme( (flags & wxCONTROL_FOCUSED) ? + kThemeBrushAlternatePrimaryHighlightColor + : kThemeBrushSecondaryHighlightColor ) ); + wxBrush selBrush( col ); + dc.SetPen( *wxTRANSPARENT_PEN ); dc.SetBrush( selBrush ); dc.DrawRectangle( rect ); @@ -343,17 +305,7 @@ wxRendererMac::DrawMacThemeButton(wxWindow *win, HIRect headerRect = CGRectMake( x, y, w, h ); if ( !dc.IsKindOf( CLASSINFO( wxPaintDC ) ) ) { - Rect r = - { - (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 ); + win->Refresh( &rect ); } else {