X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b0881393cc1bbc81f8d57a257494a27489798dd..eecdb0007ff012f7da0da0c9b1a17b372e24fa12:/src/generic/choicdgg.cpp diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index 6183fdefd3..15e85bb44a 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -300,7 +300,8 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent, topsizer->SetSizeHints( this ); topsizer->Fit( this ); - Centre( wxBOTH ); + if ( styleDlg & wxCENTRE ) + Centre(wxBOTH); m_listbox->SetFocus(); @@ -456,8 +457,17 @@ bool wxMultiChoiceDialog::Create( wxWindow *parent, 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]); }