]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/renderer.cpp
OpenGL changes for carbon and cocoa
[wxWidgets.git] / src / osx / carbon / renderer.cpp
index 1d8bbd4df761a9dbec827fa0845299c91ff2bd2c..b0138ca631aba0c03fe230dcca39e76f7b706e06 100644 (file)
@@ -38,6 +38,7 @@
 // check if we're currently in a paint event
 inline bool wxInPaintEvent(wxWindow* win, wxDC& dc)
 {
+    wxUnusedVar(dc);
     return ( win->MacGetCGContextRef() != NULL );
 }
 
@@ -100,7 +101,7 @@ public:
 
     virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
 
-    virtual void DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
+    virtual void DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, int flags=0);
 
 private:
     void DrawMacThemeButton(wxWindow *win,
@@ -351,7 +352,7 @@ wxRendererMac::DrawMacThemeButton(wxWindow *win,
         drawInfo.adornment = adornment;
         if (flags & wxCONTROL_FOCUSED)
             drawInfo.adornment |= kThemeAdornmentFocus;
-        
+
         HIThemeDrawButton( &headerRect, &drawInfo, cgContext, kHIThemeOrientationNormal, &labelRect );
     }
 }
@@ -366,7 +367,7 @@ wxRendererMac::DrawCheckBox(wxWindow *win,
         flags |= wxCONTROL_SELECTED;
 
     int kind;
-    
+
     if (win->GetWindowVariant() == wxWINDOW_VARIANT_SMALL ||
         (win->GetParent() && win->GetParent()->GetWindowVariant() == wxWINDOW_VARIANT_SMALL))
         kind = kThemeCheckBoxSmall;
@@ -469,7 +470,7 @@ 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;
@@ -487,7 +488,7 @@ 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;
@@ -500,11 +501,11 @@ void wxRendererMac::DrawComboBox(wxWindow* win, wxDC& dc,
     DrawMacThemeButton(win, dc, rect, flags, kind, kThemeAdornmentNone);
 }
 
-void wxRendererMac::DrawRadioButton(wxWindow* win, wxDC& dc,
+void wxRendererMac::DrawRadioBitmap(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;
@@ -532,23 +533,13 @@ void wxRendererMac::DrawTextCtrl(wxWindow* win, wxDC& dc,
     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) )
     {
-        Rect r =
-        {
-            (short) hiRect.origin.y, (short) hiRect.origin.x,
-            (short) (hiRect.origin.y + hiRect.size.height),
-            (short) (hiRect.origin.x + hiRect.size.width)
-        };
-
-        RgnHandle updateRgn = NewRgn();
-        RectRgn( updateRgn, &r );
-        HIViewSetNeedsDisplayInRegion( (HIViewRef) win->GetHandle(), updateRgn, true );
-        DisposeRgn( updateRgn );
+        win->Refresh( &rect );
     }
     else
     {