static const int WIDTH_COL_DEFAULT = 80;
static const int WIDTH_COL_MIN = 10;
+// the space between the image and the text in the report mode
+static const int IMAGE_MARGIN_IN_REPORT_MODE = 5;
+
// ============================================================================
// private classes
// ============================================================================
if (item->HasText())
{
wxRect rectLabel = m_gi->m_rectLabel;
+
+ wxDCClipper clipper(*dc, rectLabel);
dc->DrawText( item->GetText(), rectLabel.x, rectLabel.y );
}
}
{
wxListItemData *item = node->GetData();
+ int width = m_owner->GetColumnWidth(col++);
int xOld = x;
+ x += width;
if ( item->HasImage() )
{
int ix, iy;
- m_owner->DrawImage( item->GetImage(), dc, x, y );
+ m_owner->DrawImage( item->GetImage(), dc, xOld, y );
m_owner->GetImageSize( item->GetImage(), ix, iy );
- x += ix + 5; // FIXME: what is "5"?
- }
- int width = m_owner->GetColumnWidth(col++);
+ ix += IMAGE_MARGIN_IN_REPORT_MODE;
- wxDCClipper clipper(*dc, x, y, width, rect.height);
+ xOld += ix;
+ width -= ix;
+ }
+
+ wxDCClipper clipper(*dc, xOld, y, width, rect.height);
if ( item->HasText() )
{
- dc->DrawText( item->GetText(), x, y );
+ dc->DrawText( item->GetText(), xOld, y );
}
- x = xOld + width;
-
node = node->GetNext();
}
}
dc.SetPen( *wxWHITE_PEN );
DoDrawRect( &dc, x, HEADER_OFFSET_Y, cw, h-2 );
- dc.SetClippingRegion( x, HEADER_OFFSET_Y, cw-5, h-4 );
- dc.DrawText( item.GetText(), x + EXTRA_WIDTH, HEADER_OFFSET_Y + EXTRA_HEIGHT );
- dc.DestroyClippingRegion();
+ wxDCClipper clipper(dc, x, HEADER_OFFSET_Y, cw-5, h-4 );
+
+ dc.DrawText( item.GetText(),
+ x + EXTRA_WIDTH, HEADER_OFFSET_Y + EXTRA_HEIGHT );
+
x += wCol;
if (xEnd > w+5)
void wxListMainWindow::RefreshLine( size_t line )
{
- size_t visibleFrom, visibleTo;
- GetVisibleLinesRange(&visibleFrom, &visibleTo);
+ if ( HasFlag(wxLC_REPORT) )
+ {
+ size_t visibleFrom, visibleTo;
+ GetVisibleLinesRange(&visibleFrom, &visibleTo);
- if ( line < visibleFrom || line > visibleTo )
- return;
+ if ( line < visibleFrom || line > visibleTo )
+ return;
+ }
wxRect rect = GetLineRect(line);