From 768276f6ed4267a5768727cf06f636b2777e85da Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 27 Jul 2004 08:53:10 +0000 Subject: [PATCH] fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl item (same thing as patch 978403 for treectlg.cpp) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 7b1bffec79..6e989ae648 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -2074,12 +2074,14 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event ) switch ( event.m_keyCode ) { case WXK_RETURN: - if ( !AcceptChanges() ) + if ( AcceptChanges() ) { - // vetoed by the user code - 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(); -- 2.47.2