- wxComboBox::IsEmpty(), which was previously available in some ports (but not
wxMSW), doesn't exist any more, use either IsListEmpty() or IsTextEmpty().
+- wxSingleChoiceDialog ctors and Create() now have 2 overloaded versions: one
+ taking void** client data and the deprecated one taking char**. This can
+ result in compilation errors due to an ambiguity between them if you pass
+ NULL as client data. To fix this, cast NULL explicitly to "void**".
+
Deprecated methods and their replacements
-----------------------------------------
- Second parameter of wxSlider::SetTickFreq(int n, int pos) is deprecated,
simply remove it from your code and use wxSlider::SetTickFreq(int n) as it
was never used anyhow.
+- wxSingleChoiceDialog ctor and Create() take "void**" client data pointer
+ instead of "char**". As the client data is typically untyped, you should
+ simply remove the casts to "char**" which you probably have in your code if
+ you use these functions.
+
Major new features in this release
----------------------------------
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() { return m_clientData; }
- // obsolete function (NB: no need to make it return wxChar, it's untyped)
- char *GetSelectionClientData() const { return (char *)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);
+ }
+
+ 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(),
+ (char*)GetClientData()
+ )
+#endif // WXWIN_COMPATIBILITY_2_8
// implementation from now on
void OnOK(wxCommandEvent& event);
int initialSelection)
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices,
- (char **)client_data);
+ client_data);
dialog.SetSelection(initialSelection);
void *data;
if ( dialog.ShowModal() == wxID_OK )
- data = dialog.GetSelectionClientData();
+ data = dialog.GetSelectionData();
else
data = NULL;
IMPLEMENT_DYNAMIC_CLASS(wxSingleChoiceDialog, wxDialog)
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- int n,
- const wxString *choices,
- char **clientData,
- long style,
- const wxPoint& WXUNUSED(pos))
-{
- Create(parent, message, caption, n, choices, clientData, style);
-}
-
-wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
- const wxString& message,
- const wxString& caption,
- const wxArrayString& choices,
- char **clientData,
- long style,
- const wxPoint& WXUNUSED(pos))
-{
- Create(parent, message, caption, choices, clientData, style);
-}
-
bool wxSingleChoiceDialog::Create( wxWindow *parent,
const wxString& message,
const wxString& caption,
int n,
const wxString *choices,
- char **clientData,
+ void **clientData,
long style,
const wxPoint& pos )
{
const wxString& message,
const wxString& caption,
const wxArrayString& choices,
- char **clientData,
+ void **clientData,
long style,
const wxPoint& pos )
{