From 625cb8c0b1ac12f26265cae2c69d7f510de0edb1 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 14 Aug 2001 18:34:18 +0000 Subject: [PATCH] Fixed a bug so wxLC_VRULES works by itself. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 68cd535490..4f3ed90f60 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1904,20 +1904,23 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) int itemCount = GetItemCount(); int i; - for (i = 0; i < itemCount; i++) + if (drawHRules) { - if (GetItemRect(i, itemRect)) + for (i = 0; i < itemCount; i++) { - cy = itemRect.GetTop(); - if (i != 0) // Don't draw the first one - { - dc.DrawLine(0, cy, clientSize.x, cy); - } - // Draw last line - if (i == (GetItemCount() - 1)) + if (GetItemRect(i, itemRect)) { - cy = itemRect.GetBottom(); - dc.DrawLine(0, cy, clientSize.x, cy); + cy = itemRect.GetTop(); + if (i != 0) // Don't draw the first one + { + dc.DrawLine(0, cy, clientSize.x, cy); + } + // Draw last line + if (i == (GetItemCount() - 1)) + { + cy = itemRect.GetBottom(); + dc.DrawLine(0, cy, clientSize.x, cy); + } } } } -- 2.45.2