X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1eb65c24668845888c1be5d701e32e216c79af3..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/include/wx/gtk1/dataform.h diff --git a/include/wx/gtk1/dataform.h b/include/wx/gtk1/dataform.h index 5d143ed9aa..ad27104edd 100644 --- a/include/wx/gtk1/dataform.h +++ b/include/wx/gtk1/dataform.h @@ -20,9 +20,16 @@ public: wxDataFormat(); wxDataFormat( wxDataFormatId type ); - wxDataFormat( const wxString &id ); wxDataFormat( NativeFormat format ); + // we have to provide all the overloads to allow using strings instead of + // data formats (as a lot of existing code does) + wxDataFormat( const wxString& id ) { InitFromString(id); } + wxDataFormat( const char *id ) { InitFromString(id); } + wxDataFormat( const wchar_t *id ) { InitFromString(id); } + wxDataFormat( const wxCStrData& id ) { InitFromString(id); } + + wxDataFormat& operator=(const wxDataFormat& format) { m_type = format.m_type; m_format = format.m_format; return *this; } wxDataFormat& operator=(NativeFormat format) @@ -56,6 +63,9 @@ public: void SetType( wxDataFormatId type ); private: + // common part of ctors from format name + void InitFromString(const wxString& id); + wxDataFormatId m_type; NativeFormat m_format;