X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/59bd9598bc9a092dd51cbd8cfc1aa37299a8cd61..90b22acaa8a8673e9a6749aa5e5322d2c8913a85:/src/generic/choicdgg.cpp diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index 2e0df746a8..c56105fb18 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -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; @@ -194,7 +195,8 @@ void *wxGetSingleChoiceData( const wxString& message, bool WXUNUSED(centre), int WXUNUSED(width), int WXUNUSED(height) ) { - wxSingleChoiceDialog dialog(parent, message, caption, n, choices, (char **)client_data); + wxSingleChoiceDialog dialog(parent, message, caption, n, choices, + (char **)client_data); void *data; if ( dialog.ShowModal() == wxID_OK ) data = dialog.GetSelectionClientData(); @@ -204,6 +206,25 @@ void *wxGetSingleChoiceData( const wxString& message, return data; } +void *wxGetSingleChoiceData( const wxString& message, + const wxString& caption, + const wxArrayString& aChoices, + void **client_data, + wxWindow *parent, + int x, int y, + bool centre, + int width, int height) +{ + wxString *choices; + int n = ConvertWXArrayToC(aChoices, &choices); + void *res = wxGetSingleChoiceData(message, caption, n, choices, + client_data, parent, + x, y, centre, width, height); + delete [] choices; + + return res; +} + #ifdef WXWIN_COMPATIBILITY_2 // Overloaded for backward compatibility void *wxGetSingleChoiceData( const wxString& message,