|
@@ -56,9 +56,9 @@ type
|
|
|
);
|
|
|
TFresnelLabelStates = set of TFresnelLabelState;
|
|
|
|
|
|
- { TFresnelLabel }
|
|
|
+ { TCustomFresnelLabel }
|
|
|
|
|
|
- TFresnelLabel = class(TFresnelReplacedElement)
|
|
|
+ TCustomFresnelLabel = class(TFresnelReplacedElement)
|
|
|
private
|
|
|
class var FFresnelLabelTypeID: TCSSNumericalID;
|
|
|
class constructor InitFresnelLabelClass;
|
|
@@ -86,6 +86,13 @@ type
|
|
|
property RenderedCaption: String read FRenderedCaption write FRenderedCaption;
|
|
|
end;
|
|
|
|
|
|
+ { TFresnelLabel }
|
|
|
+
|
|
|
+ TFresnelLabel = class(TCustomFresnelLabel)
|
|
|
+ published
|
|
|
+ property Caption;
|
|
|
+ end;
|
|
|
+
|
|
|
{ TFresnelBody }
|
|
|
|
|
|
TFresnelBody = class(TFresnelElement)
|
|
@@ -268,14 +275,14 @@ begin
|
|
|
FCSSAttributes[fcaPosition]:='absolute';
|
|
|
end;
|
|
|
|
|
|
-{ TFresnelLabel }
|
|
|
+{ TCustomFresnelLabel }
|
|
|
|
|
|
-class constructor TFresnelLabel.InitFresnelLabelClass;
|
|
|
+class constructor TCustomFresnelLabel.InitFresnelLabelClass;
|
|
|
begin
|
|
|
FFresnelLabelTypeID:=RegisterCSSType(CSSTypeName);
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelLabel.ComputeMinCaption;
|
|
|
+procedure TCustomFresnelLabel.ComputeMinCaption;
|
|
|
// create FMinCaption from FCaption by putting every word on a line of its own
|
|
|
var
|
|
|
LineBreakLen, SrcP, l, StartP, WordLen, TargetP: Integer;
|
|
@@ -319,7 +326,7 @@ begin
|
|
|
SetLength(FMinCaption,TargetP-1);
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelLabel.SetCaption(const AValue: String);
|
|
|
+procedure TCustomFresnelLabel.SetCaption(const AValue: String);
|
|
|
begin
|
|
|
if FCaption=AValue then Exit;
|
|
|
FCaption:=AValue;
|
|
@@ -327,7 +334,7 @@ begin
|
|
|
FLabelStates:=FLabelStates-[flsMinCaptionValid,flsMinWidthValid,flsSizeValid];
|
|
|
end;
|
|
|
|
|
|
-function TFresnelLabel.GetMinWidthIntrinsicContentBox: TFresnelLength;
|
|
|
+function TCustomFresnelLabel.GetMinWidthIntrinsicContentBox: TFresnelLength;
|
|
|
var
|
|
|
p: TFresnelPoint;
|
|
|
begin
|
|
@@ -344,7 +351,7 @@ begin
|
|
|
Result:=FMinWidth;
|
|
|
end;
|
|
|
|
|
|
-function TFresnelLabel.GetPreferredContentBox_MaxWidth(MaxWidth: TFresnelLength
|
|
|
+function TCustomFresnelLabel.GetPreferredContentBox_MaxWidth(MaxWidth: TFresnelLength
|
|
|
): TFresnelPoint;
|
|
|
begin
|
|
|
if not (flsSizeValid in FLabelStates) then
|
|
@@ -358,7 +365,7 @@ begin
|
|
|
Result:=Font.TextSizeMaxWidth(FCaption,MaxWidth);
|
|
|
end;
|
|
|
|
|
|
-function TFresnelLabel.GetCSSInitialAttribute(const AttrID: TCSSNumericalID
|
|
|
+function TCustomFresnelLabel.GetCSSInitialAttribute(const AttrID: TCSSNumericalID
|
|
|
): TCSSString;
|
|
|
var
|
|
|
Attr: TFresnelCSSAttribute;
|
|
@@ -373,24 +380,24 @@ begin
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelLabel.ClearCSSValues;
|
|
|
+procedure TCustomFresnelLabel.ClearCSSValues;
|
|
|
begin
|
|
|
inherited ClearCSSValues;
|
|
|
FCSSAttributes[fcaDisplayOutside]:='inline';
|
|
|
end;
|
|
|
|
|
|
-procedure TFresnelLabel.UpdateRenderedAttributes;
|
|
|
+procedure TCustomFresnelLabel.UpdateRenderedAttributes;
|
|
|
begin
|
|
|
inherited UpdateRenderedAttributes;
|
|
|
FRenderedCaption:=Caption;
|
|
|
end;
|
|
|
|
|
|
-class function TFresnelLabel.CSSTypeID: TCSSNumericalID;
|
|
|
+class function TCustomFresnelLabel.CSSTypeID: TCSSNumericalID;
|
|
|
begin
|
|
|
Result:=FFresnelLabelTypeID;
|
|
|
end;
|
|
|
|
|
|
-class function TFresnelLabel.CSSTypeName: TCSSString;
|
|
|
+class function TCustomFresnelLabel.CSSTypeName: TCSSString;
|
|
|
begin
|
|
|
Result:='label';
|
|
|
end;
|