]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/choicdgg.cpp
corrected wxIsAbsolutePath for new Mac Path notation
[wxWidgets.git] / src / generic / choicdgg.cpp
index 99d5079b4f1411cbc5b7ca9cd2bbb08d70f4f49a..4f47ab48eaa4ae41eaf9898a232cac3f215ca4f3 100644 (file)
@@ -81,9 +81,10 @@ 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];
+        (*choices)[i] = aChoices[i];   
     }
 
     return n;
@@ -166,6 +167,23 @@ int wxGetSingleChoiceIndex( const wxString& message,
     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;
+}
+
 #ifdef WXWIN_COMPATIBILITY_2
 // Overloaded for backward compatibility
 int wxGetSingleChoiceIndex( const wxString& message,
@@ -258,6 +276,10 @@ size_t wxGetMultipleChoices(wxArrayInt& selections,
                             int WXUNUSED(width), int WXUNUSED(height))
 {
     wxMultiChoiceDialog dialog(parent, message, caption, n, choices);
+
+    if ( !selections.IsEmpty() )
+        dialog.SetSelections(selections);
+
     if ( dialog.ShowModal() == wxID_OK )
         selections = dialog.GetSelections();
     else