From 41bff877cec3da87cf7e90ae95ea5d2bb11cb1b3 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 9 Apr 2011 09:48:18 +0000 Subject: [PATCH] Do not steal focus from tree when clicking a table, only when creating a new table or whatever. Fixes issue #2289. --- source/helpers.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/helpers.pas b/source/helpers.pas index eca41e9e..face4281 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -2289,10 +2289,12 @@ begin Mainform.UpdateEditorTab; Screen.Cursor := crHourglass; MainForm.SetupSynEditors; - // Enable user to start typing immediately - editName := FindComponent('editName') as TWinControl; - if Assigned(editName) and editName.CanFocus then - editName.SetFocus; + // Enable user to start typing immediately when creating a new object + if DBObject.Name = '' then begin + editName := FindComponent('editName') as TWinControl; + if Assigned(editName) and editName.CanFocus then + editName.SetFocus; + end; end; function TDBObjectEditor.DeInit: TModalResult;