int itemCount = GetItemCount();
int i;
- for (i = 0; i < itemCount; i++)
+ if (drawHRules)
{
- if (GetItemRect(i, itemRect))
+ long top = GetTopItem();
+ for (i = top; i < top + GetCountPerPage() + 1; 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 == itemCount - 1)
+ {
+ cy = itemRect.GetBottom();
+ dc.DrawLine(0, cy, clientSize.x, cy);
+ }
}
}
}
- i = (GetItemCount() - 1);
+ i = itemCount - 1;
if (drawVRules && (i > -1))
{
wxRect firstItemRect;