]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/renderg.cpp
correct painting of the items with custom colours in TVIS_DROPHILITED state (patch...
[wxWidgets.git] / src / generic / renderg.cpp
index 217cbbf19daf8fcbacf5033a2ecd4e6a09eb8d33..817dd01986f07abee00454b65e18b46ea1511f22 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/renderer.h"
+
 #ifndef WX_PRECOMP
     #include "wx/string.h"
+    #include "wx/dc.h"
+    #include "wx/settings.h"
 #endif //WX_PRECOMP
 
 #include "wx/gdicmn.h"
-#include "wx/dc.h"
 
-#include "wx/settings.h"
 #include "wx/splitter.h"
 #include "wx/dcmirror.h"
 #include "wx/module.h"
-#include "wx/renderer.h"
 
 // ----------------------------------------------------------------------------
 // wxRendererGeneric: our wxRendererNative implementation
@@ -78,10 +79,10 @@ public:
                                const wxRect& rect,
                                int flags = 0);
 
-    virtual void DrawCheckButton(wxWindow *win,
-                                 wxDC& dc,
-                                 const wxRect& rect,
-                                 int flags = 0);
+    virtual void DrawCheckBox(wxWindow *win,
+                              wxDC& dc,
+                              const wxRect& rect,
+                              int flags = 0);
 
     virtual void DrawPushButton(wxWindow *win,
                                 wxDC& dc,
@@ -230,9 +231,10 @@ wxRendererGeneric::DrawTreeItemButton(wxWindow * WXUNUSED(win),
                                       const wxRect& rect,
                                       int flags)
 {
-    // white background
-    dc.SetPen(*wxGREY_PEN);
-    dc.SetBrush(*wxWHITE_BRUSH);
+    // store settings
+    wxDCPenChanger penChanger(dc, *wxGREY_PEN);
+    wxDCBrushChanger brushChanger(dc, *wxWHITE_BRUSH);
+
     dc.DrawRectangle(rect);
 
     // black lines
@@ -402,10 +404,10 @@ wxRendererGeneric::DrawDropArrow(wxWindow *win,
 }
 
 void
-wxRendererGeneric::DrawCheckButton(wxWindow *WXUNUSED(win),
-                                   wxDC& dc,
-                                   const wxRect& rect,
-                                   int flags)
+wxRendererGeneric::DrawCheckBox(wxWindow *WXUNUSED(win),
+                                wxDC& dc,
+                                const wxRect& rect,
+                                int flags)
 {
     dc.SetPen(*(flags & wxCONTROL_DISABLED ? wxGREY_PEN : wxBLACK_PEN));
     dc.SetBrush( *wxTRANSPARENT_BRUSH );