+// ----------------------------------------------------------------------------
+// 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 )
+{
+ if ( !wxAnyChoiceDialog::Create(parent, message, caption,
+ n, choices,
+ style, pos,
+ wxLB_ALWAYS_SB | wxLB_EXTENDED) )
+ 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)
+{
+ // first clear all currently selected items
+ size_t n,
+ count = m_listbox->GetCount();
+ for ( n = 0; n < count; ++n )
+ {
+ m_listbox->Deselect(n);
+ }
+
+ // now select the ones which should be selected
+ count = selections.GetCount();
+ for ( n = 0; n < count; n++ )
+ {
+ m_listbox->Select(selections[n]);
+ }
+}
+
+bool wxMultiChoiceDialog::TransferDataFromWindow()
+{
+ m_selections.Empty();
+ size_t count = m_listbox->GetCount();
+ for ( size_t n = 0; n < count; n++ )
+ {
+ if ( m_listbox->IsSelected(n) )
+ m_selections.Add(n);
+ }
+
+ return true;
+}
+
+#endif // wxUSE_CHOICEDLG