X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0b4e4c3937371a1404c0847b3e355a2dd6063d6b..58f8c1df488cbc9b836121a8ba9903e1ac1e230d:/src/propgrid/props.cpp diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 27cb584949..c6e5d13527 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -95,7 +95,9 @@ wxString wxStringProperty::ValueToString( wxVariant& value, if ( GetChildCount() && HasFlag(wxPG_PROP_COMPOSED_VALUE) ) { // Value stored in m_value is non-editable, non-full value - if ( (argFlags & wxPG_FULL_VALUE) || (argFlags & wxPG_EDITABLE_VALUE) ) + if ( (argFlags & wxPG_FULL_VALUE) || + (argFlags & wxPG_EDITABLE_VALUE) || + !s.length() ) { // Calling this under incorrect conditions will fail wxASSERT_MSG( argFlags & wxPG_VALUE_IS_CURRENT, @@ -186,8 +188,10 @@ wxNumericPropertyValidator:: { arr.Add(wxS("+")); arr.Add(wxS("-")); - arr.Add(wxS(".")); arr.Add(wxS("e")); + + // Use locale-specific decimal point + arr.Add(wxString::Format("%g", 1.1)[1]); } SetIncludes(arr); @@ -666,11 +670,11 @@ wxFloatProperty::~wxFloatProperty() { } // This helper method provides standard way for floating point-using // properties to convert values to string. -void wxPropertyGrid::DoubleToString(wxString& target, - double value, - int precision, - bool removeZeroes, - wxString* precTemplate) +const wxString& wxPropertyGrid::DoubleToString(wxString& target, + double value, + int precision, + bool removeZeroes, + wxString* precTemplate) { if ( precision >= 0 ) { @@ -722,7 +726,7 @@ void wxPropertyGrid::DoubleToString(wxString& target, for ( ; i != target.end(); i++ ) { - if ( *i != wxS('0') && *i != wxS('.') ) + if ( *i != wxS('0') && *i != wxS('.') && *i != wxS(',') ) { isZero = false; break; @@ -732,6 +736,8 @@ void wxPropertyGrid::DoubleToString(wxString& target, if ( isZero ) target.erase(target.begin()); } + + return target; } wxString wxFloatProperty::ValueToString( wxVariant& value,