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
This commit is contained in:
Robin Dunn
2001-08-14 18:34:18 +00:00
parent b0ee47ff76
commit 625cb8c0b1

View File

@@ -1904,20 +1904,23 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
int itemCount = GetItemCount(); int itemCount = GetItemCount();
int i; int i;
for (i = 0; i < itemCount; i++) if (drawHRules)
{ {
if (GetItemRect(i, itemRect)) for (i = 0; i < itemCount; i++)
{ {
cy = itemRect.GetTop(); if (GetItemRect(i, itemRect))
if (i != 0) // Don't draw the first one
{ {
dc.DrawLine(0, cy, clientSize.x, cy); cy = itemRect.GetTop();
} if (i != 0) // Don't draw the first one
// Draw last line {
if (i == (GetItemCount() - 1)) dc.DrawLine(0, cy, clientSize.x, cy);
{ }
cy = itemRect.GetBottom(); // Draw last line
dc.DrawLine(0, cy, clientSize.x, cy); if (i == (GetItemCount() - 1))
{
cy = itemRect.GetBottom();
dc.DrawLine(0, cy, clientSize.x, cy);
}
} }
} }
} }