diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 9b12b2eb71..45cdf1c395 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1568,6 +1568,7 @@ public: wxRect& rect, int flags ); +#if WXWIN_COMPATIBILITY_3_0 /** Standardized double-to-string conversion. */ static const wxString& DoubleToString( wxString& target, @@ -1575,6 +1576,7 @@ public: int precision, bool removeZeroes, wxString* precTemplate = NULL ); +#endif // WXWIN_COMPATIBILITY_3_0 /** Call this from wxPGProperty::OnEvent() to cause property value to be diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 4f6940be06..19295211fb 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -62,6 +62,7 @@ #endif #include "wx/odcombo.h" +#include "wx/numformatter.h" // ----------------------------------------------------------------------- @@ -361,7 +362,7 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper // Min/Max check wxFloatProperty::DoValidation(property, v_d, NULL, mode); - wxPropertyGrid::DoubleToString(s, v_d, 6, true, NULL); + s = wxNumberFormatter::ToString(v_d, -1, wxNumberFormatter::Style_None); } else { diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index c79faae159..8aba9bd222 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -52,6 +52,7 @@ #include "wx/filename.h" #include "wx/propgrid/propgrid.h" +#include "wx/numformatter.h" #define wxPG_CUSTOM_IMAGE_WIDTH 20 // for wxColourProperty etc. @@ -667,6 +668,7 @@ wxFloatProperty::wxFloatProperty( const wxString& label, wxFloatProperty::~wxFloatProperty() { } +#if WXWIN_COMPATIBILITY_3_0 // This helper method provides standard way for floating point-using // properties to convert values to string. const wxString& wxPropertyGrid::DoubleToString(wxString& target, @@ -738,6 +740,7 @@ const wxString& wxPropertyGrid::DoubleToString(wxString& target, return target; } +#endif // WXWIN_COMPATIBILITY_3_0 wxString wxFloatProperty::ValueToString( wxVariant& value, int argFlags ) const @@ -745,11 +748,9 @@ wxString wxFloatProperty::ValueToString( wxVariant& value, wxString text; if ( !value.IsNull() ) { - wxPropertyGrid::DoubleToString(text, - value, - m_precision, - !(argFlags & wxPG_FULL_VALUE), - NULL); + text = wxNumberFormatter::ToString(value.GetDouble(), m_precision, + argFlags & wxPG_FULL_VALUE ? wxNumberFormatter::Style_None + : wxNumberFormatter::Style_NoTrailingZeroes); } return text; }