void wxVListBox::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const { // use wxRendererNative for more native look unless we use custom bg colour if ( !DoDrawSolidBackground(m_colBgSel, dc, rect, n) ) { int flags = 0; if ( IsSelected(n) ) flags |= wxCONTROL_SELECTED; if ( IsCurrent(n) ) flags |= wxCONTROL_CURRENT; if ( wxWindow::FindFocus() == const_cast<wxVListBox*>(this) ) flags |= wxCONTROL_FOCUSED; wxRendererNative::Get().DrawItemSelectionRect( const_cast<wxVListBox *>(this), dc, rect, flags); } }
void wxHtmlListBox::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const { if ( IsSelected(n) ) { if ( DoDrawSolidBackground ( GetSelectedTextBgColour(GetBackgroundColour()), dc, rect, n ) ) { return; } //else: no custom selection background colour, use base class version } wxVListBox::OnDrawBackground(dc, rect, n); }