Merge branch 'ui-locale'

Add wxUILocale class providing functionality which can be implemented
portably for all major platforms, including macOS, and doesn't force
the change of the global C locale, unlike wxLocale.

See https://github.com/wxWidgets/wxWidgets/pull/2464
This commit is contained in:
Vadim Zeitlin
2021-08-26 15:49:57 +02:00
41 changed files with 1978 additions and 655 deletions

View File

@@ -41,6 +41,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxSpinDoubleEvent, wxNotifyEvent);
#if wxUSE_SPINBTN
#include "wx/numformatter.h"
#include "wx/valnum.h"
#include "wx/valtext.h"
@@ -764,12 +765,12 @@ void wxSpinCtrlDouble::DoSendEvent()
bool wxSpinCtrlDouble::DoTextToValue(const wxString& text, double *val)
{
return text.ToDouble(val);
return wxNumberFormatter::FromString(text, val);
}
wxString wxSpinCtrlDouble::DoValueToText(double val)
{
return wxString::Format(m_format, val);
return wxNumberFormatter::ToString(val, m_digits);
}
void wxSpinCtrlDouble::SetIncrement(double inc)
@@ -812,8 +813,6 @@ void wxSpinCtrlDouble::DoSetDigitsAndUpdate(unsigned digits)
void wxSpinCtrlDouble::DoSetDigits(unsigned digits)
{
m_digits = digits;
m_format.Printf(wxT("%%0.%ulf"), digits);
}
void wxSpinCtrlDouble::ResetTextValidator()