if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) )
return false;
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
-
if ( style & wxLB_MULTIPLE )
m_selStore = new wxSelectionStore;
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX));
+ m_colBgSel = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
+
return true;
}
(selection >= 0 && (size_t)selection < GetItemCount()),
_T("wxVListBox::SetSelection(): invalid item index") );
- wxASSERT_MSG( !HasMultipleSelection(),
- _T("SetSelection() is invalid with multiselection listbox") );
+ if ( HasMultipleSelection() )
+ {
+ Select(selection);
+ m_anchor = selection;
+ }
DoSetCurrent(selection);
}
}
// ----------------------------------------------------------------------------
-// wxVListBox painting
+// wxVListBox appearance parameters
// ----------------------------------------------------------------------------
void wxVListBox::SetMargins(const wxPoint& pt)
}
}
+void wxVListBox::SetSelectionBackground(const wxColour& col)
+{
+ m_colBgSel = col;
+}
+
+// ----------------------------------------------------------------------------
+// wxVListBox painting
+// ----------------------------------------------------------------------------
+
wxCoord wxVListBox::OnGetLineHeight(size_t line) const
{
return OnMeasureItem(line) + 2*m_ptMargins.y;
{
if ( isSelected )
{
- wxBrush brush(wxSystemSettings::
- GetColour(wxSYS_COLOUR_HIGHLIGHT),
- wxSOLID);
- dc.SetBrush(brush);
+ dc.SetBrush(wxBrush(m_colBgSel, wxSOLID));
}
else // !selected
{