]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
made GetColourFromGTKWidget() more general, it is now used for all colours
[wxWidgets.git] / src / msw / listctrl.cpp
index 4f3ed90f60ab220ef8bb1acd43c82ad8df8a586a..1196685fe8506f99ad660b9d43176a5734a05e96 100644 (file)
@@ -1906,7 +1906,8 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
     int i;
     if (drawHRules)
     {
-        for (i = 0; i < itemCount; i++)
+        long top = GetTopItem();
+        for (i = top; i < top + GetCountPerPage() + 1; i++)
         {
             if (GetItemRect(i, itemRect))
             {
@@ -1916,7 +1917,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
                     dc.DrawLine(0, cy, clientSize.x, cy);
                 }
                 // Draw last line
-                if (i == (GetItemCount() - 1))
+                if (i == itemCount - 1)
                 {
                     cy = itemRect.GetBottom();
                     dc.DrawLine(0, cy, clientSize.x, cy);
@@ -1924,7 +1925,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
             }
         }
     }
-    i = (GetItemCount() - 1);
+    i = itemCount - 1;
     if (drawVRules && (i > -1))
     {
         wxRect firstItemRect;