From b2d739ba552a391d912f018da8acf3cfc13c1244 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 27 Oct 2004 19:23:59 +0000 Subject: [PATCH] don't preselect the first item if the array with the initial selections is empty in wxMultiChoiceDialog git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/choicdgg.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index 6e591c78cd..bb2a38dc56 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -218,8 +218,9 @@ size_t wxGetMultipleChoices(wxArrayInt& selections, { 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(); -- 2.45.2