]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed sending 2 events (normal and bogus cancel one) when ending to edit a tree ctrl...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jun 2004 18:26:49 +0000 (18:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 23 Jun 2004 18:26:49 +0000 (18:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp

index d6a9c14aeba8cf914391940ab3eb24c166e95090..5dede2bf17856cab073f40d92c85cc865244dfe4 100644 (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();