]> git.saurik.com Git - wxWidgets.git/commitdiff
don't preselect the first item if the array with the initial selections is empty...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 Oct 2004 19:23:59 +0000 (19:23 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 27 Oct 2004 19:23:59 +0000 (19:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/choicdgg.cpp

index 6e591c78cd370f518078f969e82b20e1e51db83a..bb2a38dc5636bb1df7ce1cc0ee5db4b276c5759d 100644 (file)
@@ -218,8 +218,9 @@ size_t wxGetMultipleChoices(wxArrayInt& selections,
 {
     wxMultiChoiceDialog dialog(parent, message, caption, n, choices);
 
 {
     wxMultiChoiceDialog dialog(parent, message, caption, n, choices);
 
-    if ( !selections.IsEmpty() )
-        dialog.SetSelections(selections);
+    // call this even if selections array is empty and this then (correctly)
+    // deselects the first item which is selected by default
+    dialog.SetSelections(selections);
 
     if ( dialog.ShowModal() == wxID_OK )
         selections = dialog.GetSelections();
 
     if ( dialog.ShowModal() == wxID_OK )
         selections = dialog.GetSelections();