|
@@ -72,6 +72,7 @@ type
|
|
FSize: TFresnelPoint; // width+height of Caption
|
|
FSize: TFresnelPoint; // width+height of Caption
|
|
procedure ComputeMinCaption; virtual;
|
|
procedure ComputeMinCaption; virtual;
|
|
procedure SetCaption(const AValue: String); virtual;
|
|
procedure SetCaption(const AValue: String); virtual;
|
|
|
|
+ procedure SetName(const NewName: TComponentName); override;
|
|
public
|
|
public
|
|
function GetMinWidthIntrinsicContentBox: TFresnelLength; override;
|
|
function GetMinWidthIntrinsicContentBox: TFresnelLength; override;
|
|
function GetPreferredContentBox_MaxWidth(MaxWidth: TFresnelLength): TFresnelPoint;
|
|
function GetPreferredContentBox_MaxWidth(MaxWidth: TFresnelLength): TFresnelPoint;
|
|
@@ -335,6 +336,19 @@ begin
|
|
DomChanged;
|
|
DomChanged;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCustomLabel.SetName(const NewName: TComponentName);
|
|
|
|
+var
|
|
|
|
+ ChangeCaption: Boolean;
|
|
|
|
+begin
|
|
|
|
+ if Name=NewName then exit;
|
|
|
|
+ ChangeCaption :=
|
|
|
|
+ not (csLoading in ComponentState)
|
|
|
|
+ and (Name = Caption)
|
|
|
|
+ and ((Owner = nil) or not (csLoading in Owner.ComponentState));
|
|
|
|
+ inherited SetName(NewName);
|
|
|
|
+ if ChangeCaption then Caption := NewName;
|
|
|
|
+end;
|
|
|
|
+
|
|
function TCustomLabel.GetMinWidthIntrinsicContentBox: TFresnelLength;
|
|
function TCustomLabel.GetMinWidthIntrinsicContentBox: TFresnelLength;
|
|
var
|
|
var
|
|
p: TFresnelPoint;
|
|
p: TFresnelPoint;
|