git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28471
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
{
void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
{
- size_t count = selections.GetCount();
- for ( size_t n = 0; n < count; n++ )
+ // first clear all currently selected items
+ size_t n,
+ count = m_listbox->GetCount();
+ for ( n = 0; n < count; ++n )
+ {
+ m_listbox->Deselect(n);
+ }
+
+ // now select the ones which should be selected
+ count = selections.GetCount();
+ for ( n = 0; n < count; n++ )
{
m_listbox->Select(selections[n]);
}
{
m_listbox->Select(selections[n]);
}