X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5dbe15d0bacde245539f54c4d97af6b4696f01f..86ac84b8ce086e6bbda58f422d41f84268606e35:/include/wx/cmndata.h?ds=inline diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 5aa5f102f7..31269412d8 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -26,11 +26,18 @@ class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase; -class WXDLLEXPORT wxColourData: public wxObject +class WXDLLIMPEXP_CORE wxColourData : public wxObject { public: + // number of custom colours we store + enum + { + NUM_CUSTOM = 16 + }; + wxColourData(); wxColourData(const wxColourData& data); + wxColourData& operator=(const wxColourData& data); virtual ~wxColourData(); void SetChooseFull(bool flag) { m_chooseFull = flag; } @@ -39,22 +46,27 @@ public: const wxColour& GetColour() const { return m_dataColour; } wxColour& GetColour() { return m_dataColour; } - // Array of 16 custom colours + // SetCustomColour() modifies colours in an internal array of NUM_CUSTOM + // custom colours; void SetCustomColour(int i, const wxColour& colour); - wxColour GetCustomColour(int i); + wxColour GetCustomColour(int i) const; - void operator=(const wxColourData& data); + // Serialize the object to a string and restore it from it + wxString ToString() const; + bool FromString(const wxString& str); + + // public for backwards compatibility only: don't use directly public: wxColour m_dataColour; - wxColour m_custColours[16]; + wxColour m_custColours[NUM_CUSTOM]; bool m_chooseFull; private: DECLARE_DYNAMIC_CLASS(wxColourData) }; -class WXDLLEXPORT wxFontData : public wxObject +class WXDLLIMPEXP_CORE wxFontData : public wxObject { public: wxFontData(); @@ -77,17 +89,20 @@ public: wxFontData& operator=(const wxFontData& data) { - wxObject::operator=(data); - m_fontColour = data.m_fontColour; - m_showHelp = data.m_showHelp; - m_allowSymbols = data.m_allowSymbols; - m_enableEffects = data.m_enableEffects; - m_initialFont = data.m_initialFont; - m_chosenFont = data.m_chosenFont; - m_minSize = data.m_minSize; - m_maxSize = data.m_maxSize; - m_encoding = data.m_encoding; - m_encodingInfo = data.m_encodingInfo; + if (&data != this) + { + wxObject::operator=(data); + m_fontColour = data.m_fontColour; + m_showHelp = data.m_showHelp; + m_allowSymbols = data.m_allowSymbols; + m_enableEffects = data.m_enableEffects; + m_initialFont = data.m_initialFont; + m_chosenFont = data.m_chosenFont; + m_minSize = data.m_minSize; + m_maxSize = data.m_maxSize; + m_encoding = data.m_encoding; + m_encodingInfo = data.m_encodingInfo; + } return *this; } @@ -168,7 +183,7 @@ enum wxPrintBin const int wxPRINTMEDIA_DEFAULT = 0; -class WXDLLEXPORT wxPrintData: public wxObject +class WXDLLIMPEXP_CORE wxPrintData: public wxObject { public: wxPrintData(); @@ -213,7 +228,7 @@ public: wxString GetFilename() const { return m_filename; } void SetFilename( const wxString &filename ) { m_filename = filename; } - void operator=(const wxPrintData& data); + wxPrintData& operator=(const wxPrintData& data); char* GetPrivData() const { return m_privData; } int GetPrivDataLen() const { return m_privDataLen; } @@ -261,7 +276,7 @@ private: * from the dialog. */ -class WXDLLEXPORT wxPrintDialogData: public wxObject +class WXDLLIMPEXP_CORE wxPrintDialogData: public wxObject { public: wxPrintDialogData(); @@ -336,7 +351,7 @@ private: // Compatibility with old name #define wxPageSetupData wxPageSetupDialogData -class WXDLLEXPORT wxPageSetupDialogData: public wxObject +class WXDLLIMPEXP_CORE wxPageSetupDialogData: public wxObject { public: wxPageSetupDialogData();