]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectrl.cpp
fixed cutnpaste error samples->utils in UTILS_DIST
[wxWidgets.git] / src / generic / treectrl.cpp
index 3586419f4ad13d64e21bd93b6a94b2c2bae7b759..7bdbfe798da1ca357f94d263295edab4cb869f97 100644 (file)
@@ -588,7 +588,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id,
     SetValidator( validator );
 #endif
 
-    SetBackgroundColour( *wxWHITE );
+    SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
     m_dottedPen = wxPen( "grey", 0, 0 );
 
@@ -1531,12 +1531,17 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
 
     int total_h = GetLineHeight(item);
 
-    wxColour colBg;
-    if ( attr && attr->HasBackgroundColour() )
-        colBg = attr->GetBackgroundColour();
+    if (item->IsSelected())
+        dc.SetBrush(*m_hilightBrush);
     else
-        colBg = m_backgroundColour;
-    dc.SetBrush(wxBrush(colBg, wxSOLID));
+    {
+        wxColour colBg;
+        if ( attr && attr->HasBackgroundColour() )
+            colBg = attr->GetBackgroundColour();
+        else
+            colBg = m_backgroundColour;
+        dc.SetBrush(wxBrush(colBg, wxSOLID));
+    }
 
     dc.DrawRectangle( item->GetX()-2, item->GetY(), item->GetWidth()+2, total_h );
 
@@ -1600,15 +1605,12 @@ void wxTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &
         }
 
         wxPen *pen = wxTRANSPARENT_PEN;
-        wxBrush *brush;                 // FIXME is this really needed?
         wxColour colText;
 
         if ( item->IsSelected() )
         {
             colText = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT );
 
-            brush = m_hilightBrush;
-
             if ( m_hasFocus )
                pen = wxBLACK_PEN;
 
@@ -1620,14 +1622,11 @@ void wxTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &
                 colText = attr->GetTextColour();
             else
                 colText = *wxBLACK;
-
-            brush = wxWHITE_BRUSH;
         }
 
         // prepare to draw
         dc.SetTextForeground(colText);
         dc.SetPen(*pen);
-        dc.SetBrush(*brush);
 
         // draw
         PaintItem(item, dc);