SetSelection() may be used for both single and multi selection listboxes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21139 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-06-13 22:30:55 +00:00
parent 9a9b4940a1
commit de5d3a20ce
2 changed files with 33 additions and 2 deletions

View File

@@ -249,8 +249,11 @@ void wxVListBox::SetSelection(int selection)
(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);
}