+
+ selections = dialog.GetSelections();
+ return selections.GetCount();
+}
+
+int wxGetSelectedChoices(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);
+ int res = wxGetSelectedChoices(selections, message, caption,
+ n, choices, parent,
+ x, y, centre, width, height);
+ delete [] choices;
+
+ return res;
+}
+
+#if WXWIN_COMPATIBILITY_2_8
+size_t wxGetMultipleChoices(wxArrayInt& selections,
+ const wxString& message,
+ const wxString& caption,
+ int n, const wxString *choices,
+ wxWindow *parent,
+ int x, int y,
+ bool centre,
+ int width, int height)
+{
+ int rc = wxGetSelectedChoices(selections, message, caption,
+ n, choices,
+ parent, x, y, centre, width, height);
+ if ( rc == -1 )
+ {
+ selections.clear();
+ return 0;
+ }
+
+ return rc;
+}
+
+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)
+{
+ int rc = wxGetSelectedChoices(selections, message, caption,
+ aChoices,
+ parent, x, y, centre, width, height);
+ if ( rc == -1 )
+ {
+ selections.clear();
+ return 0;
+ }
+
+ return rc;
+}
+#endif // WXWIN_COMPATIBILITY_2_8
+
+// ----------------------------------------------------------------------------
+// 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__
+ // FIXME: why??
+ 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
+ topsizer->
+ Add(CreateTextSizer(message), wxSizerFlags().Expand().TripleBorder());
+
+ // 2) list box
+ m_listbox = CreateList(n, choices, styleLbox);
+
+ if ( n > 0 )
+ m_listbox->SetSelection(0);
+
+ topsizer->
+ Add(m_listbox, wxSizerFlags().Expand().Proportion(1).TripleBorder(wxLEFT | wxRIGHT));
+
+ // 3) buttons if any
+ wxSizer *
+ buttonSizer = CreateSeparatedButtonSizer(styleDlg & ButtonSizerFlags);
+ if ( buttonSizer )
+ {
+ topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder());
+ }
+
+ SetSizer( topsizer );
+
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+
+ if ( styleDlg & wxCENTRE )
+ Centre(wxBOTH);
+
+ m_listbox->SetFocus();
+
+ return true;