const wxRect& rectHL,
bool highlighted )
{
- // use our own flag if we maintain it
- if ( !IsVirtual() )
- highlighted = m_highlighted;
-
// TODO: later we should support setting different attributes for
// different columns - to do it, just add "col" argument to
// GetAttr() and move these lines into the loop below
void wxListMainWindow::RefreshLine( size_t line )
{
+ size_t visibleFrom, visibleTo;
+ GetVisibleLinesRange(&visibleFrom, &visibleTo);
+
+ if ( line < visibleFrom || line > visibleTo )
+ return;
+
wxRect rect = GetLineRect(line);
CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
GetLine(line)->DrawInReportMode( &dc,
rectLine,
GetLineHighlightRect(line),
- IsHighlighted(line) );
+ m_hasFocus && IsHighlighted(line) );
}
if ( HasFlag(wxLC_HRULES) )
}
}
- if ( HasCurrent() && m_hasFocus )
+ if ( HasCurrent() )
{
+ // don't draw rect outline under Max if we already have the background
+ // color
#ifdef __WXMAC__
- // no rect outline, we already have the background color
-#else
- dc.SetPen( *wxBLACK_PEN );
- dc.SetBrush( *wxTRANSPARENT_BRUSH );
- dc.DrawRectangle( GetLineHighlightRect(m_current) );
-#endif
+ if ( !m_hasFocus )
+#endif // !__WXMAC__
+ {
+ dc.SetPen( *wxBLACK_PEN );
+ dc.SetBrush( *wxTRANSPARENT_BRUSH );
+ dc.DrawRectangle( GetLineHighlightRect(m_current) );
+ }
}
dc.EndDrawing();
if ( point != wxDefaultPosition )
le.m_pointDrag = point;
- if ( command != wxEVT_COMMAND_LIST_DELETE_ITEM )
+ // don't try to get the line info for virtual list controls: the main
+ // program has it anyhow and if we did it would result in accessing all
+ // the lines, even those which are not visible now and this is precisely
+ // what we're trying to avoid
+ if ( !IsVirtual() && (command != wxEVT_COMMAND_LIST_DELETE_ITEM) )
{
GetLine(line)->GetItem( 0, le.m_item );
}