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:
@@ -1046,7 +1046,12 @@ void wxTextCtrl::WriteText( const wxString &text )
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
||||
if ( text.empty() )
|
||||
{
|
||||
// We don't need to actually do anything, but we still need to generate
|
||||
// an event expected from this call.
|
||||
SendTextUpdatedEvent(this);
|
||||
return;
|
||||
}
|
||||
|
||||
// we're changing the text programmatically
|
||||
DontMarkDirtyOnNextChange();
|
||||
|
Reference in New Issue
Block a user