+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)
+{
+#if defined(__SMARTPHONE__) || defined(__POCKETPC__)
+ styleDlg &= ~wxBORDER_MASK;
+ styleDlg &= ~wxRESIZE_BORDER;
+ styleDlg &= ~wxCAPTION;
+#endif
+
+ if ( !wxDialog::Create(parent, wxID_ANY, caption, pos, wxDefaultSize, styleDlg) )
+ return false;
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ // 1) text message
+ topsizer->Add( CreateTextSizer( message ), 0, wxALL, wxLARGESMALL(10,0) );
+
+ // 2) list box
+ m_listbox = new wxListBox( this, wxID_LISTBOX,
+ wxDefaultPosition, wxDefaultSize,
+ n, choices,
+ styleLbox );
+ if ( n > 0 )
+ m_listbox->SetSelection(0);
+
+ topsizer->Add( m_listbox, 1, wxEXPAND|wxLEFT|wxRIGHT, wxLARGESMALL(15,0) );
+
+ // smart phones does not support or do not waste space for wxButtons
+#ifdef __SMARTPHONE__
+
+ SetRightMenu(wxID_CANCEL, _("Cancel"));
+
+#else // __SMARTPHONE__/!__SMARTPHONE__
+
+#if wxUSE_STATLINE
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
+#endif
+
+ // 4) buttons
+ topsizer->Add( CreateButtonSizer( styleDlg & (wxOK|wxCANCEL) ), 0, wxEXPAND | wxALL, 10 );
+
+#endif // !__SMARTPHONE__
+
+ SetSizer( topsizer );
+
+#if !defined(__SMARTPHONE__) && !defined(__POCKETPC__)
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+
+ if ( styleDlg & wxCENTRE )
+ Centre(wxBOTH);
+#endif
+
+ m_listbox->SetFocus();
+
+ return true;
+}