]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
check better before overwriting files (patch 951868)
[wxWidgets.git] / src / generic / treectlg.cpp
index 2883e57b14994efd299b8febd30038635ed38798..69094f0757b5d7beb736019e2fb5df91d659a0a0 100644 (file)
@@ -440,7 +440,7 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event )
             sx = parentSize.x - myPos.x;
         if (mySize.x > sx)
             sx = mySize.x;
-        SetSize(sx, wxDefaultSize.y);
+        SetSize(sx, wxDefaultCoord);
     }
 
     event.Skip();
@@ -448,16 +448,17 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event )
 
 void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &event )
 {
-    if ( m_finished )
-    {
-        event.Skip();
-        return;
-    }
-
-    if ( AcceptChanges() )
+    if ( !m_finished )
     {
+        AcceptChanges();
+        // We must finish regardless of success, otherwise we'll get
+        // focus problems:
         Finish();
     }
+
+    // We must let the native text control handle focus, too, otherwise
+    // it could have problems with the cursor (e.g., in wxGTK):
+    event.Skip();
 }
 
 // -----------------------------------------------------------------------------