fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl item (patch 978403)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-06-23 18:26:49 +00:00
parent ce192630a3
commit 2b4f324ae2

View File

@@ -407,12 +407,14 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
switch ( event.m_keyCode )
{
case WXK_RETURN:
if ( !AcceptChanges() )
if ( AcceptChanges() )
{
// vetoed by the user, don't disappear
break;
// Close the text control, changes were accepted
Finish();
}
//else: fall through
// else do nothing, do not accept and do not close
break;
case WXK_ESCAPE:
Finish();