+// ----------------------------------------------------------------------------
+// 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 )
+ {
+ topsizer->Add( buttonSizer, 0, wxEXPAND | wxALL, wxLARGESMALL(10,0) );
+ }
+ else
+ {
+ topsizer->AddSpacer( wxLARGESMALL(15,0) );
+ delete buttonSizer;
+ }
+
+ SetSizer( topsizer );
+
+ topsizer->SetSizeHints( this );
+ topsizer->Fit( this );
+
+ if ( styleDlg & wxCENTRE )
+ Centre(wxBOTH);
+
+ m_listbox->SetFocus();
+
+ return true;
+}
+
+bool wxAnyChoiceDialog::Create(wxWindow *parent,
+ const wxString& message,
+ const wxString& caption,
+ const wxArrayString& choices,
+ long styleDlg,
+ const wxPoint& pos,
+ long styleLbox)
+{
+ wxCArrayString chs(choices);
+ return Create(parent, message, caption, chs.GetCount(), chs.GetStrings(),
+ styleDlg, pos, styleLbox);
+}
+
+wxListBoxBase *wxAnyChoiceDialog::CreateList(int n, const wxString *choices, long styleLbox)
+{
+ return new wxListBox( this, wxID_LISTBOX,
+ wxDefaultPosition, wxDefaultSize,
+ n, choices,
+ styleLbox );
+}
+
+// ----------------------------------------------------------------------------