Fix displaying wxSpinCtrlDouble values with default precision

For the sake of consistency with native wxGTK implementation,
spin control value should be displayed with fixed precision.

See #17085.
This commit is contained in:
Artur Wieczorek 2020-05-18 20:23:41 +02:00
parent 19da5f61bb
commit edc553870f
2 changed files with 2 additions and 2 deletions

View File

@ -420,7 +420,7 @@ private:
void Init()
{
m_digits = 0;
m_format = wxS("%g");
m_format = "%0.0f";
}
wxString m_format;

View File

@ -199,7 +199,7 @@ void SpinCtrlDoubleTestCase::Increment()
#if wxUSE_UIACTIONSIMULATOR
CPPUNIT_ASSERT_EQUAL(1.0, m_spin->GetIncrement());
m_spin->SetDigits(1); // GTK would fail without this.
m_spin->SetDigits(1);
m_spin->SetIncrement(0.1);
CPPUNIT_ASSERT_EQUAL(0.1, m_spin->GetIncrement());