Allow using a different text value in wxGTK wxSpinCtrl

Make it possible to use a string value different from the numeric value,
as wxMSW version allows this and some existing code depends on it.

Closes #19140.
This commit is contained in:
Vadim Zeitlin
2021-04-20 00:55:02 +02:00
parent e73a0c23ef
commit ca0cf3ea59
4 changed files with 159 additions and 7 deletions

View File

@@ -168,6 +168,17 @@ TEST_CASE_METHOD(SpinCtrlDoubleTestCase,
// Calling SetValue() shouldn't have generated any events.
CHECK( updatedSpin.GetCount() == 0 );
CHECK( updatedText.GetCount() == 0 );
// Also test that setting the text value works.
CHECK( m_spin->GetTextValue() == "49.10" );
m_spin->SetValue("57.30");
CHECK( m_spin->GetTextValue() == "57.30" );
CHECK( m_spin->GetValue() == 57.3 );
m_spin->SetValue("");
CHECK( m_spin->GetTextValue() == "" );
CHECK( m_spin->GetValue() == 57.3 );
}
#if wxUSE_UIACTIONSIMULATOR