From ca219eca4b74d315daa2cd7379dbdca2479e6b67 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Tue, 5 Dec 2023 12:18:27 +0100 Subject: [PATCH] LCL/TLabeledEdit: Allow to change TLabeledEdit.EditLabel.Layout, publush TLabeledEdit.EditLabel.Alignment (see https://forum.lazarus.freepascal.org/index.php/topic,65452.msg498672.html) --- lcl/extctrls.pp | 3 ++- lcl/include/boundlabel.inc | 2 ++ lcl/include/customlabelededit.inc | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index b7cd8a925e..22404bd2b1 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -973,6 +973,7 @@ type constructor Create(TheOwner: TComponent); override; property FocusControl; published + property Alignment; property AnchorSideLeft stored False; property AnchorSideTop stored False; property AnchorSideRight stored False; @@ -991,7 +992,7 @@ type property PopupMenu; property ShowAccelChar; property ShowHint; - property Layout; + property Layout default tlCenter; property WordWrap; property OnClick; property OnDblClick; diff --git a/lcl/include/boundlabel.inc b/lcl/include/boundlabel.inc index f4be10b0fd..deea8fbce9 100644 --- a/lcl/include/boundlabel.inc +++ b/lcl/include/boundlabel.inc @@ -19,6 +19,8 @@ constructor TBoundLabel.Create(TheOwner: TComponent); begin inherited Create(TheOwner); Name := 'SubLabel'; + Alignment := taLeftJustify; + Layout := tlCenter; SetSubComponent(True); if Assigned(TheOwner) then Caption := TheOwner.Name; diff --git a/lcl/include/customlabelededit.inc b/lcl/include/customlabelededit.inc index d3c7e05d05..047bb2987c 100644 --- a/lcl/include/customlabelededit.inc +++ b/lcl/include/customlabelededit.inc @@ -77,12 +77,10 @@ begin lpLeft : begin FEditLabel.AnchorToCompanion(akRight,FLabelSpacing,Self); - FEditLabel.AnchorVerticalCenterTo(Self); end; lpRight: begin FEditLabel.AnchorToCompanion(akLeft,FLabelSpacing,Self); - FEditLabel.AnchorVerticalCenterTo(Self); end; end; if Parent<>nil then