+ wxString *choices;
+ int n = ConvertWXArrayToC(aChoices, &choices);
+ void *res = wxGetSingleChoiceData(message, caption, n, choices,
+ client_data, parent,
+ x, y, centre, width, height);
+ delete [] choices;
+
+ return res;
+}
+
+size_t wxGetMultipleChoices(wxArrayInt& selections,
+ const wxString& message,
+ const wxString& caption,
+ int n, const wxString *choices,
+ wxWindow *parent,
+ int WXUNUSED(x), int WXUNUSED(y),
+ bool WXUNUSED(centre),
+ int WXUNUSED(width), int WXUNUSED(height))
+{
+ wxMultiChoiceDialog dialog(parent, message, caption, n, choices);
+
+ // 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();
+ else
+ selections.Empty();
+
+ return selections.GetCount();
+}
+
+size_t wxGetMultipleChoices(wxArrayInt& selections,
+ const wxString& message,
+ const wxString& caption,
+ const wxArrayString& aChoices,
+ wxWindow *parent,
+ int x, int y,
+ bool centre,
+ int width, int height)
+{
+ wxString *choices;
+ int n = ConvertWXArrayToC(aChoices, &choices);
+ size_t res = wxGetMultipleChoices(selections, message, caption,
+ n, choices, parent,
+ x, y, centre, width, height);
+ delete [] choices;
+
+ return res;
+}
+
+// ----------------------------------------------------------------------------
+// wxAnyChoiceDialog
+// ----------------------------------------------------------------------------
+
+bool wxAnyChoiceDialog::Create(wxWindow *parent,
+ const wxString& message,
+ const wxString& caption,
+ int n, const wxString *choices,
+ long styleDlg,
+ const wxPoint& pos,
+ long styleLbox)
+{
+#ifdef __WXMAC__
+ if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg & (~wxCANCEL) ) )
+ return false;
+#else
+ if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg) )
+ return false;
+#endif
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ // 1) text message
+#ifdef __WXMAC__
+ // align text and list at least on mac
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(15,0) );
+#else
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
+#endif
+ // 2) list box
+ m_listbox = CreateList(n,choices,styleLbox);
+
+ if ( n > 0 )
+ m_listbox->SetSelection(0);
+
+ topsizer->Add( m_listbox, 1, wxEXPAND|wxLEFT|wxRIGHT, wxLARGESMALL(15,0) );
+
+ // 3) buttons if any
+ wxSizer *buttonSizer = CreateButtonSizer( styleDlg & ButtonSizerFlags , true, wxLARGESMALL(10,0) );
+ if(buttonSizer->GetChildren().GetCount() > 0 )