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

@@ -268,6 +268,17 @@ TEST_CASE_METHOD(SpinCtrlTestCase2, "SpinCtrl::Value", "[spinctrl]")
// 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() == "100" );
m_spin->SetValue("57");
CHECK( m_spin->GetTextValue() == "57" );
CHECK( m_spin->GetValue() == 57 );
m_spin->SetValue("");
CHECK( m_spin->GetTextValue() == "" );
CHECK( m_spin->GetValue() == 57 );
}
TEST_CASE_METHOD(SpinCtrlTestCase2, "SpinCtrl::Base", "[spinctrl]")