]> git.saurik.com Git - wxWidgets.git/commitdiff
use renderer for drawing the item background on ports other than GTK2 and Mac too...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Oct 2008 08:58:52 +0000 (08:58 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 Oct 2008 08:58:52 +0000 (08:58 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56459 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index 4c0d7d69fe58a5daa381cc6f66a1349f0d8f8d09..0e14dc28301b8dbf1d2c420011c28cc2fb00643a 100644 (file)
@@ -2535,9 +2535,6 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
         x=0;
         GetVirtualSize(&w, &h);
         wxRect rect( x, item->GetY()+offset, w, total_h-offset);
         x=0;
         GetVirtualSize(&w, &h);
         wxRect rect( x, item->GetY()+offset, w, total_h-offset);
-#if !defined(__WXGTK20__) && !defined(__WXMAC__)
-        dc.DrawRectangle(rect);
-#else
         if (!item->IsSelected())
         {
             dc.DrawRectangle(rect);
         if (!item->IsSelected())
         {
             dc.DrawRectangle(rect);
@@ -2557,9 +2554,8 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
             wxRendererNative::Get().
                 DrawItemSelectionRect(this, dc, rect, flags);
         }
             wxRendererNative::Get().
                 DrawItemSelectionRect(this, dc, rect, flags);
         }
-#endif
     }
     }
-    else
+    else // no full row highlight
     {
         if ( item->IsSelected() &&
                 (state != wxTREE_ITEMSTATE_NONE || image != NO_IMAGE) )
     {
         if ( item->IsSelected() &&
                 (state != wxTREE_ITEMSTATE_NONE || image != NO_IMAGE) )
@@ -2593,14 +2589,11 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
         {
             wxRect rect( item->GetX()-2, item->GetY()+offset,
                          item->GetWidth()+2, total_h-offset );
         {
             wxRect rect( item->GetX()-2, item->GetY()+offset,
                          item->GetWidth()+2, total_h-offset );
-#if !defined(__WXGTK20__) && !defined(__WXMAC__)
-            dc.DrawRectangle( rect );
-#else
             if ( hasBgColour )
             {
                 dc.DrawRectangle( rect );
             }
             if ( hasBgColour )
             {
                 dc.DrawRectangle( rect );
             }
-            else
+            else // no specific background colour
             {
                 rect.x -= 1;
                 rect.width += 2;
             {
                 rect.x -= 1;
                 rect.width += 2;
@@ -2613,7 +2606,6 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
                 wxRendererNative::Get().
                     DrawItemSelectionRect(this, dc, rect, flags);
             }
                 wxRendererNative::Get().
                     DrawItemSelectionRect(this, dc, rect, flags);
             }
-#endif
         }
     }
 
         }
     }