+ DoChoice();
+}
+
+#ifndef __SMARTPHONE__
+void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
+{
+ DoChoice();
+}
+#endif
+
+#ifdef __WXWINCE__
+void wxSingleChoiceDialog::OnJoystickButtonDown(wxJoystickEvent& WXUNUSED(event))
+{
+ DoChoice();
+}
+#endif
+
+void wxSingleChoiceDialog::DoChoice()
+{
+ m_selection = m_listbox->GetSelection();
+ m_stringSelection = m_listbox->GetStringSelection();
+
+ if ( m_listbox->HasClientUntypedData() )
+ SetClientData(m_listbox->GetClientData(m_selection));
+
+ EndModal(wxID_OK);
+}
+
+// ----------------------------------------------------------------------------
+// wxMultiChoiceDialog
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxMultiChoiceDialog, wxDialog)
+
+bool wxMultiChoiceDialog::Create( wxWindow *parent,
+ const wxString& message,
+ const wxString& caption,
+ int n,
+ const wxString *choices,
+ long style,
+ const wxPoint& pos )
+{
+ long styleLbox;
+#if wxUSE_CHECKLISTBOX
+ styleLbox = wxLB_ALWAYS_SB;
+#else
+ styleLbox = wxLB_ALWAYS_SB | wxLB_EXTENDED;
+#endif
+
+ if ( !wxAnyChoiceDialog::Create(parent, message, caption,
+ n, choices,
+ style, pos,
+ styleLbox) )
+ return false;
+
+ return true;
+}
+
+bool wxMultiChoiceDialog::Create( wxWindow *parent,
+ const wxString& message,
+ const wxString& caption,
+ const wxArrayString& choices,
+ long style,
+ const wxPoint& pos )
+{
+ wxCArrayString chs(choices);
+ return Create( parent, message, caption, chs.GetCount(),
+ chs.GetStrings(), style, pos );
+}
+
+void wxMultiChoiceDialog::SetSelections(const wxArrayInt& selections)
+{
+#if wxUSE_CHECKLISTBOX
+ wxCheckListBox* checkListBox = wxDynamicCast(m_listbox, wxCheckListBox);
+ if (checkListBox)
+ {
+ // first clear all currently selected items
+ size_t n,
+ count = checkListBox->GetCount();
+ for ( n = 0; n < count; ++n )
+ {
+ if (checkListBox->IsChecked(n))
+ checkListBox->Check(n, false);
+ }
+
+ // now select the ones which should be selected
+ count = selections.GetCount();
+ for ( n = 0; n < count; n++ )
+ {
+ checkListBox->Check(selections[n]);
+ }
+
+ return;
+ }
+#endif
+
+ // first clear all currently selected items
+ size_t n,
+ count = m_listbox->GetCount();
+ for ( n = 0; n < count; ++n )