diff --git a/interface/wx/spinctrl.h b/interface/wx/spinctrl.h index f7b1749a99..080d7b3c9b 100644 --- a/interface/wx/spinctrl.h +++ b/interface/wx/spinctrl.h @@ -136,6 +136,10 @@ public: /** Returns the text in the text entry part of the control. + @note In wxQt, setting an empty string in the control is exactly the same + as calling SetValue(GetMin()). So this function always returns a non-empty + string under this platform. + @since 3.1.6 */ wxString GetTextValue() const; @@ -189,6 +193,8 @@ public: @note Setting a range including negative values is silently ignored if current base is set to 16. + + @note In wxQt @a minVal must be less than @a maxVal. */ void SetRange(int minVal, int maxVal); @@ -362,6 +368,10 @@ public: /** Returns the text in the text entry part of the control. + @note In wxQt, setting an empty string in the control is exactly the same + as calling SetValue(GetMin()). So this function always returns a non-empty + string under this platform. + @since 3.1.6 */ wxString GetTextValue() const; @@ -393,6 +403,8 @@ public: /** Sets range of allowable values. + + @note In wxQt @a minVal must be less than @a maxVal. */ void SetRange(double minVal, double maxVal); diff --git a/tests/controls/spinctrldbltest.cpp b/tests/controls/spinctrldbltest.cpp index 0543e4d704..1491d79b85 100644 --- a/tests/controls/spinctrldbltest.cpp +++ b/tests/controls/spinctrldbltest.cpp @@ -143,11 +143,13 @@ TEST_CASE_METHOD(SpinCtrlDoubleTestCase, CHECK( m_spin->GetMin() == -10.0 ); CHECK( m_spin->GetMax() == 10.0 ); +#ifndef __WXQT__ //Test backwards ranges m_spin->SetRange(75.0, 50.0); CHECK( m_spin->GetMin() == 75.0 ); CHECK( m_spin->GetMax() == 50.0 ); +#endif } TEST_CASE_METHOD(SpinCtrlDoubleTestCase, @@ -182,7 +184,11 @@ TEST_CASE_METHOD(SpinCtrlDoubleTestCase, CHECK( updatedText.GetCount() == 0 ); m_spin->SetValue(""); +#ifndef __WXQT__ CHECK( m_spin->GetTextValue() == "" ); +#else + CHECK( m_spin->GetTextValue() == "0.00" ); // the control automatically displays minVal +#endif CHECK( m_spin->GetValue() == 0 ); CHECK( updatedSpin.GetCount() == 0 ); diff --git a/tests/controls/spinctrltest.cpp b/tests/controls/spinctrltest.cpp index 5c22c62817..6226849b6e 100644 --- a/tests/controls/spinctrltest.cpp +++ b/tests/controls/spinctrltest.cpp @@ -253,11 +253,13 @@ TEST_CASE_METHOD(SpinCtrlTestCase2, "SpinCtrl::Range", "[spinctrl]") CHECK(m_spin->GetBase() == 10); +#ifndef __WXQT__ //Test backwards ranges m_spin->SetRange(75, 50); CHECK(m_spin->GetMin() == 75); CHECK(m_spin->GetMax() == 50); +#endif } TEST_CASE_METHOD(SpinCtrlTestCase2, "SpinCtrl::Value", "[spinctrl]") @@ -291,7 +293,11 @@ TEST_CASE_METHOD(SpinCtrlTestCase2, "SpinCtrl::Value", "[spinctrl]") CHECK(updatedText.GetCount() == 0); m_spin->SetValue(""); +#ifndef __WXQT__ CHECK( m_spin->GetTextValue() == "" ); +#else + CHECK( m_spin->GetTextValue() == "0" ); // the control automatically displays minVal +#endif CHECK( m_spin->GetValue() == 0 ); CHECK(updatedSpin.GetCount() == 0);