Send event when clearing wxTextCtrl in wxGTK again

This was broken by 1c946a469a and resulted
in test failures in OwnerDrawnComboBoxTestCase::TextChangeEvents() unit
test because wxOwnerDrawnComboBox::Clear() used SetValue("") and didn't
generate any events any more.

Fix this regression by explicitly sending an event if we're returning
early and add a unit test explicitly checking that SetValue("") does
generate an event.
This commit is contained in:
Vadim Zeitlin
2017-11-07 03:06:03 +01:00
parent 3069167dd4
commit 13163fb315
2 changed files with 9 additions and 0 deletions

View File

@@ -57,6 +57,10 @@ void TextEntryTestCase::TextChangeEvents()
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
entry->SetValue("");
CPPUNIT_ASSERT_EQUAL( 1, updated.GetCount() );
updated.Clear();
entry->ChangeValue("bar");
CPPUNIT_ASSERT_EQUAL( 0, updated.GetCount() );