From a03df130f14722a89f90075685d235c0a79073c1 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 13 Apr 2010 22:52:24 +0200 Subject: UI Designer: Single click in Object Inspector sets focus to actual edit widget. --- uidesigner/newformdesigner.pas | 2 ++ uidesigner/vfdprops.pas | 12 ++++++++++++ uidesigner/vfdwidgetclass.pas | 6 ++++++ 3 files changed, 20 insertions(+) (limited to 'uidesigner') diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index 87feed33..b974d262 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -839,6 +839,8 @@ begin NameDrag := False else inherited; + if (Editor <> nil) and (Editor.Visible) then + Editor.SetFocus; end; procedure TwgPropertyList.HandleMouseScroll(x, y: integer; diff --git a/uidesigner/vfdprops.pas b/uidesigner/vfdprops.pas index 99e932a5..687254ea 100644 --- a/uidesigner/vfdprops.pas +++ b/uidesigner/vfdprops.pas @@ -115,6 +115,7 @@ type procedure StoreStrValue(wg: TfpgWidget); procedure LoadFloatValue(wg: TfpgWidget); procedure StoreFloatValue(wg: TfpgWidget); + procedure SetFocus; override; end; @@ -124,6 +125,7 @@ type procedure CreateLayout; override; procedure LoadValue(wg: TfpgWidget); override; procedure StoreValue(wg: TfpgWidget); override; + procedure SetFocus; override; end; @@ -398,6 +400,11 @@ begin end; end; +procedure TGeneralPropertyEditor.SetFocus; +begin + Edit.SetFocus; +end; + procedure TGeneralPropertyEditor.StoreValue(wg: TfpgWidget); begin case etype of @@ -692,6 +699,11 @@ begin SetEnumProp(wg, prop.Name, chl.Text); end; +procedure TChoicePropertyEditor.SetFocus; +begin + chl.SetFocus; +end; + { TBooleanPropertyEditor } procedure TBooleanPropertyEditor.LoadValue(wg: TfpgWidget); diff --git a/uidesigner/vfdwidgetclass.pas b/uidesigner/vfdwidgetclass.pas index 51513dd5..059aaf79 100644 --- a/uidesigner/vfdwidgetclass.pas +++ b/uidesigner/vfdwidgetclass.pas @@ -47,6 +47,7 @@ type procedure CreateLayout; virtual; procedure LoadValue(wg: TfpgWidget); virtual; procedure StoreValue(wg: TfpgWidget); virtual; + procedure SetFocus; virtual; end; @@ -239,5 +240,10 @@ begin // if PPropInfo^.PropType^.name = end; +procedure TVFDPropertyEditor.SetFocus; +begin + // do nothing +end; + end. -- cgit v1.2.3-70-g09d2