FastReport VCL报表控件开发者手册一:"TfrxComponent"基类

"TfrxComponent"是所有FastReport组件的基类,这种类型的对象拥有“coordinates”, “size”, “font” ,“visibility” 以及一系列子对象。该类用过多种方法,允许保存和恢复对象状态。本文主要介绍FastReport VCL报表的的类层次结构中的"TfrxComponent"基类。

TfrxComponent = class(TComponent)
protected
procedure SetParent(AParent: TfrxComponent); virtual;
procedure SetLeft(Value: Extended); virtual;
procedure SetTop(Value: Extended); virtual;
procedure SetWidth(Value: Extended); virtual;
procedure SetHeight(Value: Extended); virtual;
procedure SetFont(Value: TFont); virtual;
procedure SetParentFont(Value: Boolean); virtual;
procedure SetVisible(Value: Boolean); virtual;
procedure FontChanged(Sender: TObject); virtual;
public
constructor Create(AOwner: TComponent); override;
procedure Assign(Source: TPersistent); override;
procedure Clear; virtual;
procedure CreateUniqueName;
procedure LoadFromStream(Stream: TStream); virtual;
procedure SaveToStream(Stream: TStream); virtual;
procedure SetBounds(ALeft, ATop, AWidth, AHeight: Extended);
function FindObject(const AName: String): TfrxComponent;
class function GetDescription: String; virtual;

property Objects: TList readonly;
property AllObjects: TList readonly;
property Parent: TfrxComponent;
property Page: TfrxPage readonly;
property Report: TfrxReport readonly;
property IsDesigning: Boolean;
property IsLoading: Boolean;
property IsPrinting: Boolean;
property BaseName: String;
property Left: Extended;
property Top: Extended;
property Width: Extended;
property Height: Extended;
property AbsLeft: Extended readonly;
property AbsTop: Extended readonly;
property Font: TFont;
property ParentFont: Boolean;
property Restrictions: TfrxRestrictions;
property Visible: Boolean;
end;

  • Clear:清除对象内容,并删除它的所有子对象
  • CreateUniqueName:创建对象的唯一名称
  • LoadFromStream:加载对象以及流中的所有子对象
  • SaveToStream:保存对象到流
  • SetBounds:设定对象的坐标和大小
  • FindObject:在子对象中搜索指定了名称的对象
  • GetDescription:返回对象描述

当你修改相应的属性时候,会调用下列方法。如何你需要额外处理,你需要覆盖它们。

- SetParent
- SetLeft
- SetTop
- SetWidth
- SetHeight
- SetFont
- SetParentFont
- SetVisible
- FontChanged

在“TfrxComponent”类中定义了以下属性:

  • Objects:list of child objects
  • AllObjects:list of all subordinate objects
  • Parent: link to parent object
  • Page:link to report page on which object resides
  • Report link:to report in which object appears
  • IsDesigning: “True” if designer is running
  • IsLoading :“True” if object is being loaded from stream
  • IsPrinting :“True” if object is being printed out
  • BaseName: object base name; this value is used in “CreateUniqueName” method
  • Left object: X-coordinate (relative to parent)
  • Top :object Y-coordinate (relative to parent)
  • Width: object width
  • Height :object height
  • AbsLeft :object absolute X-coordinate
  • AbsTop :object absolute Y-coordinate
  • Font :object font
  • ParentFont: if “True” then uses parent object font settings
  • Restrictionsset of flags which restricts one or more object operations
  • Visible :object visibility

 

转载于:https://www.cnblogs.com/FastReport/archive/2012/11/28/2792160.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值