]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl...
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 27 Jul 2004 08:53:10 +0000 (08:53 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 27 Jul 2004 08:53:10 +0000 (08:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 7b1bffec796c4faae4ad1f991874f6af693d686d..6e989ae648d2f18c2d5c2ca56b0697a0ddcfef08 100644 (file)
@@ -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();