+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+#define wxID_LISTBOX 3000
+
+// ----------------------------------------------------------------------------
+// private functions
+// ----------------------------------------------------------------------------
+
+// convert wxArrayString into a wxString[] which must be delete[]d by caller
+static int ConvertWXArrayToC(const wxArrayString& aChoices, wxString **choices);
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// helpers
+// ----------------------------------------------------------------------------
+
+int ConvertWXArrayToC(const wxArrayString& aChoices, wxString **choices)
+{
+ int n = aChoices.GetCount();
+ *choices = new wxString[n];
+
+ for ( int i = 0; i < n; i++ )
+ {
+ (*choices)[i] = aChoices[i];
+ }
+
+ return n;
+}
+
+// ----------------------------------------------------------------------------
+// wrapper functions
+// ----------------------------------------------------------------------------
+
+wxString wxGetSingleChoice( 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) )
+{
+ wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ wxString choice;
+ if ( dialog.ShowModal() == wxID_OK )
+ choice = dialog.GetStringSelection();
+
+ return choice;
+}
+
+wxString wxGetSingleChoice( 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);
+ wxString res = wxGetSingleChoice(message, caption, n, choices, parent,
+ x, y, centre, width, height);
+ delete [] choices;
+
+ return res;
+}
+
+int wxGetSingleChoiceIndex( 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) )
+{
+ wxSingleChoiceDialog dialog(parent, message, caption, n, choices);
+ int choice;
+ if ( dialog.ShowModal() == wxID_OK )
+ choice = dialog.GetSelection();
+ else
+ choice = -1;
+
+ return choice;
+}
+
+int wxGetSingleChoiceIndex( 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 = wxGetSingleChoiceIndex(message, caption, n, choices, parent,
+ x, y, centre, width, height);
+ delete [] choices;
+
+ return res;
+}