From 1f0ff39229305d1aeb698ff847d6a2f5a7f9974f Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 3 Feb 2011 22:23:54 +0000 Subject: [PATCH] Set focus in name input box of object editors at start, so users can start typing immediately. Fixes issue #2289. --- source/helpers.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/helpers.pas b/source/helpers.pas index 68739611..83769018 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -2229,6 +2229,8 @@ begin end; procedure TDBObjectEditor.Init(Obj: TDBObject); +var + editName: TWinControl; begin Mainform.ShowStatusMsg('Initializing editor ...'); Mainform.LogSQL(Self.ClassName+'.Init, using object "'+Obj.Name+'"', lcDebug); @@ -2237,6 +2239,10 @@ 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; end; function TDBObjectEditor.DeInit: TModalResult;