]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/renderg.cpp
Hacks for wine.
[wxWidgets.git] / src / generic / renderg.cpp
index cc3af3fdc5610280559ccbe183d6c415afd5f07a..11c05ae4b3673af14906fd406a67fc0ba2d1970c 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/string.h"
     #include "wx/dc.h"
+    #include "wx/settings.h"
+    #include "wx/gdicmn.h"
+    #include "wx/module.h"
 #endif //WX_PRECOMP
 
-#include "wx/gdicmn.h"
-
-#include "wx/settings.h"
 #include "wx/splitter.h"
 #include "wx/dcmirror.h"
-#include "wx/module.h"
 
 // ----------------------------------------------------------------------------
 // wxRendererGeneric: our wxRendererNative implementation
@@ -232,12 +231,9 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win),
                                       int flags)
 {
     // store settings
-    wxPen pen(dc.GetPen());
-    wxBrush brush(dc.GetBrush());
+    wxDCPenChanger penChanger(dc, *wxGREY_PEN);
+    wxDCBrushChanger brushChanger(dc, *wxWHITE_BRUSH);
 
-    // white background
-    dc.SetPen(*wxGREY_PEN);
-    dc.SetBrush(*wxWHITE_BRUSH);
     dc.DrawRectangle(rect);
 
     // black lines
@@ -257,9 +253,6 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win),
         dc.DrawLine(xMiddle, yMiddle - halfHeight,
                     xMiddle, yMiddle + halfHeight + 1);
     }
-
-    dc.SetPen(pen);
-    dc.SetBrush(brush);
 }
 
 // ----------------------------------------------------------------------------