diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index d8b3675531..2a6d719ed0 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -76,13 +76,23 @@ public: wxPGChoices m_boolChoices; + // Some shared variants +#if WXWIN_COMPATIBILITY_3_0 wxVariant m_vEmptyString; wxVariant m_vZero; wxVariant m_vMinusOne; wxVariant m_vTrue; wxVariant m_vFalse; +#else + const wxVariant m_vEmptyString; + const wxVariant m_vZero; + const wxVariant m_vMinusOne; + const wxVariant m_vTrue; + const wxVariant m_vFalse; +#endif // WXWIN_COMPATIBILITY_3_0 // Cached constant strings +#if WXWIN_COMPATIBILITY_3_0 wxPGCachedString m_strstring; wxPGCachedString m_strlong; wxPGCachedString m_strbool; @@ -93,6 +103,19 @@ public: wxPGCachedString m_strMax; wxPGCachedString m_strUnits; wxPGCachedString m_strHint; +#else + const wxString m_strstring; + const wxString m_strlong; + const wxString m_strbool; + const wxString m_strlist; + + const wxString m_strDefaultValue; + const wxString m_strMin; + const wxString m_strMax; + const wxString m_strUnits; + const wxString m_strHint; +#endif // WXWIN_COMPATIBILITY_3_0 + #if wxPG_COMPATIBILITY_1_4 wxPGCachedString m_strInlineHelp; #endif diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index d48bd8757f..02221c1b76 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -279,8 +279,9 @@ typedef int (*wxPGSortCallback)(wxPropertyGrid* propGrid, wxPGProperty* p2); - +#if WXWIN_COMPATIBILITY_3_0 typedef wxString wxPGCachedString; +#endif /** @} */ diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 59941d159b..3d8ee2612c 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -182,6 +182,25 @@ wxPGGlobalVarsClass* wxPGGlobalVars = NULL; wxPGGlobalVarsClass::wxPGGlobalVarsClass() + // Prepare some shared variants + : m_vEmptyString(wxString()) + , m_vZero((long)0) + , m_vMinusOne((long)-1) + , m_vTrue(true) + , m_vFalse(false) + // Prepare cached string constants + , m_strstring(wxS("string")) + , m_strlong(wxS("long")) + , m_strbool(wxS("bool")) + , m_strlist(wxS("list")) + , m_strDefaultValue(wxS("DefaultValue")) + , m_strMin(wxS("Min")) + , m_strMax(wxS("Max")) + , m_strUnits(wxS("Units")) + , m_strHint(wxS("Hint")) +#if wxPG_COMPATIBILITY_1_4 + , m_strInlineHelp(wxS("InlineHelp")) +#endif { wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING); @@ -198,29 +217,6 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass() m_extraStyle = 0; - wxVariant v; - - // Prepare some shared variants - m_vEmptyString = wxString(); - m_vZero = (long) 0; - m_vMinusOne = (long) -1; - m_vTrue = true; - m_vFalse = false; - - // Prepare cached string constants - m_strstring = wxS("string"); - m_strlong = wxS("long"); - m_strbool = wxS("bool"); - m_strlist = wxS("list"); - m_strDefaultValue = wxS("DefaultValue"); - m_strMin = wxS("Min"); - m_strMax = wxS("Max"); - m_strUnits = wxS("Units"); - m_strHint = wxS("Hint"); -#if wxPG_COMPATIBILITY_1_4 - m_strInlineHelp = wxS("InlineHelp"); -#endif - m_warnings = 0; }