don't draw the selected item background if we don't have the focus

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-08-06 19:27:08 +00:00
parent cdb3cffe0e
commit c25f61f16a

View File

@@ -1630,10 +1630,6 @@ void wxListLineData::DrawInReportMode( wxDC *dc,
const wxRect& rectHL, const wxRect& rectHL,
bool highlighted ) bool highlighted )
{ {
// use our own flag if we maintain it
if ( !IsVirtual() )
highlighted = m_highlighted;
// TODO: later we should support setting different attributes for // TODO: later we should support setting different attributes for
// different columns - to do it, just add "col" argument to // different columns - to do it, just add "col" argument to
// GetAttr() and move these lines into the loop below // GetAttr() and move these lines into the loop below
@@ -2555,7 +2551,7 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
GetLine(line)->DrawInReportMode( &dc, GetLine(line)->DrawInReportMode( &dc,
rectLine, rectLine,
GetLineHighlightRect(line), GetLineHighlightRect(line),
IsHighlighted(line) ); m_hasFocus && IsHighlighted(line) );
} }
if ( HasFlag(wxLC_HRULES) ) if ( HasFlag(wxLC_HRULES) )
@@ -2612,15 +2608,18 @@ void wxListMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
} }
} }
if ( HasCurrent() && m_hasFocus ) if ( HasCurrent() )
{ {
// don't draw rect outline under Max if we already have the background
// color
#ifdef __WXMAC__ #ifdef __WXMAC__
// no rect outline, we already have the background color if ( !m_hasFocus )
#else #endif // !__WXMAC__
dc.SetPen( *wxBLACK_PEN ); {
dc.SetBrush( *wxTRANSPARENT_BRUSH ); dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( GetLineHighlightRect(m_current) ); dc.SetBrush( *wxTRANSPARENT_BRUSH );
#endif dc.DrawRectangle( GetLineHighlightRect(m_current) );
}
} }
dc.EndDrawing(); dc.EndDrawing();