Split single/multi line behaviour in Qt wxTextCtrl

Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
This commit is contained in:
Richard Smith
2018-11-29 13:13:10 +00:00
committed by Vadim Zeitlin
parent 3b6fcbab6d
commit 0fbf87d11b
5 changed files with 468 additions and 173 deletions

View File

@@ -45,17 +45,25 @@ void TextEntryTestCase::TextChangeEvents()
wxTextEntry * const entry = GetTestEntry();
// notice that SetValue() generates an event even if the text didn't change
#ifndef __WXQT__
entry->SetValue("");
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
#else
WARN("Events are only sent when text changes in WxQt");
#endif
entry->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
#ifndef __WXQT__
entry->SetValue("foo");
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
#else
WARN("Events are only sent when text changes in WxQt");
#endif
entry->SetValue("");
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );