X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e5cfb314ae1cadac46cc50d37d9f6d15d8260a29..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/include/wx/generic/choicdgg.h diff --git a/include/wx/generic/choicdgg.h b/include/wx/generic/choicdgg.h index 505a63b3a5..39ac21ef33 100644 --- a/include/wx/generic/choicdgg.h +++ b/include/wx/generic/choicdgg.h @@ -106,39 +106,112 @@ public: const wxString& caption, int n, const wxString *choices, - char **clientData = (char **)NULL, + void **clientData = NULL, long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); + const wxPoint& pos = wxDefaultPosition) + { + Create(parent, message, caption, n, choices, clientData, style, pos); + } + wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, const wxArrayString& choices, - char **clientData = (char **)NULL, + void **clientData = NULL, long style = wxCHOICEDLG_STYLE, - const wxPoint& pos = wxDefaultPosition); + const wxPoint& pos = wxDefaultPosition) + { + Create(parent, message, caption, choices, clientData, style, pos); + } bool Create(wxWindow *parent, const wxString& message, const wxString& caption, int n, const wxString *choices, - char **clientData = (char **)NULL, + void **clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition); bool Create(wxWindow *parent, const wxString& message, const wxString& caption, const wxArrayString& choices, - char **clientData = (char **)NULL, + void **clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition); void SetSelection(int sel); int GetSelection() const { return m_selection; } wxString GetStringSelection() const { return m_stringSelection; } + void* GetSelectionData() const { return m_clientData; } + +#if WXWIN_COMPATIBILITY_2_8 + // Deprecated overloads taking "char**" client data. + wxDEPRECATED_CONSTRUCTOR + ( + wxSingleChoiceDialog(wxWindow *parent, + const wxString& message, + const wxString& caption, + int n, + const wxString *choices, + char **clientData, + long style = wxCHOICEDLG_STYLE, + const wxPoint& pos = wxDefaultPosition) + ) + { + Create(parent, message, caption, n, choices, + (void**)clientData, style, pos); + } - // obsolete function (NB: no need to make it return wxChar, it's untyped) - char *GetSelectionClientData() const { return (char *)m_clientData; } + wxDEPRECATED_CONSTRUCTOR + ( + wxSingleChoiceDialog(wxWindow *parent, + const wxString& message, + const wxString& caption, + const wxArrayString& choices, + char **clientData, + long style = wxCHOICEDLG_STYLE, + const wxPoint& pos = wxDefaultPosition) + ) + { + Create(parent, message, caption, choices, + (void**)clientData, style, pos); + } + + wxDEPRECATED_INLINE + ( + bool Create(wxWindow *parent, + const wxString& message, + const wxString& caption, + int n, + const wxString *choices, + char **clientData, + long style = wxCHOICEDLG_STYLE, + const wxPoint& pos = wxDefaultPosition), + return Create(parent, message, caption, n, choices, + (void**)clientData, style, pos); + ) + + wxDEPRECATED_INLINE + ( + bool Create(wxWindow *parent, + const wxString& message, + const wxString& caption, + const wxArrayString& choices, + char **clientData, + long style = wxCHOICEDLG_STYLE, + const wxPoint& pos = wxDefaultPosition), + return Create(parent, message, caption, choices, + (void**)clientData, style, pos); + ) + + // NB: no need to make it return wxChar, it's untyped + wxDEPRECATED_ACCESSOR + ( + char* GetSelectionClientData() const, + (char*)GetSelectionData() + ) +#endif // WXWIN_COMPATIBILITY_2_8 // implementation from now on void OnOK(wxCommandEvent& event); @@ -235,7 +308,8 @@ WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message, const wxString& caption, @@ -245,7 +319,20 @@ WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); + +WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message, + const wxString& caption, + const wxArrayString& choices, + int initialSelection, + wxWindow *parent = NULL); + +WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message, + const wxString& caption, + int n, const wxString *choices, + int initialSelection, + wxWindow *parent = NULL); // Same as above but gets position in list of strings, instead of string, // or -1 if no selection @@ -257,7 +344,8 @@ WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, @@ -267,9 +355,22 @@ WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); + +WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message, + const wxString& caption, + const wxArrayString& choices, + int initialSelection, + wxWindow *parent = NULL); + +WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message, + const wxString& caption, + int n, const wxString *choices, + int initialSelection, + wxWindow *parent = NULL); -// Return client data instead or NULL if cancelled +// Return client data instead or NULL if canceled WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, const wxString& caption, const wxArrayString& choices, @@ -279,7 +380,8 @@ WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, const wxString& caption, @@ -290,7 +392,23 @@ WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, - int height = wxCHOICE_HEIGHT); + int height = wxCHOICE_HEIGHT, + int initialSelection = 0); + +WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, + const wxString& caption, + const wxArrayString& choices, + void **client_data, + int initialSelection, + wxWindow *parent = NULL); + + +WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message, + const wxString& caption, + int n, const wxString *choices, + void **client_data, + int initialSelection, + wxWindow *parent = NULL); // fill the array with the indices of the chosen items, it will be empty // if no items were selected or Cancel was pressed - return the number of