"TfrxComponent" is the base class for all FastReport components. Objects of this type have attributes such as “coordinates”, “size”, “font” and “visibility” and have lists of subordinate objects. The class also has methods which allow for the saving and restoration of the object state to or from a stream.

"TfrxComponent" 是所有FastReport组件的基类。该类型的对象具有属性如"coordinates","size","font" 和"visibility" 并且有从属的对象列表。该类同

时提供方法允许对象的状态保存到流或从流中恢复。

 

- Clear    clears object contents and deletes all its child objects  //清除对象内容并删除所有包含的子对象

- CreateUniqueName    creates unique name for object placed into report  //为对象放置在报表中创建唯一的名称

- LoadFromStream    loads object and all its child objects from stream     //从流中加载对象和所有子对象

- SaveToStream    saves object to stream   //对象保存到流中

- SetBounds    sets object coordinates and size  //设置对象的坐标和大小

- FindObject    searches for object with specified name among child objects  //按名字在子对象列表中查找对象

- GetDescription    returns object’s description   //返回对象的描述

 

The following methods are called when modifying the corresponding properties. If additional handling is needed, you can override them:

以下方法被调用,当修改相应的属性时,如果需要额外的处理,你可以重写它们:

- SetParent

- SetLeft

- SetTop

- SetWidth

- SetHeight

- SetFont

- SetParentFont

- SetVisible

- FontChanged

 

The following properties are defined in the “TfrxComponent” class:

下面的属性被定义在"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)   // 对象的x坐标(相对于父容器)

- Top    object Y-coordinate (relative to parent)   // 对象的y坐标(相对于父容器)

- Width   object width 

- Height    object height

- AbsLeft    object absolute X-coordinate   //对象的绝对x坐标

- AbsTop    object absolute Y-coordinate

- Font    object font

- ParentFont    if “True” then uses parent object font settings

- Restrictions    set of flags which restricts one or more object operations //限制一个或多个对象操作的标志集

- Visible    object visibility   //对象的可见性

 

The next base class is “TfrxReportComponent”. Objects of this type can be placed into a report design. This class has the “Draw” method for drawing the object and also the “BeforePrint/GetData/AfterPrint” methods, which are called when the report is running.

下一个基类是"TfrxReportComponent".这种类型的对象可以被放在一个设计的报表中。该类有Draw方法绘制对象,同时还有BeforePrint/GetData/AfterPrint,报表运行时调用这些方法。

TfrxReportComponent = class(TfrxComponent)

public

procedure Draw(Canvas: TCanvas;ScaleX, ScaleY, OffsetX, OffsetY: Extended); virtual; abstract;

procedure BeforePrint; virtual;

procedure GetData; virtual;

procedure AfterPrint; virtual;

function GetComponentText: String; virtual;

property OnAfterPrint: TfrxNotifyEvent;

property OnBeforePrint: TfrxNotifyEvent;

end;

The "Draw" method is called to draw the object, with parameters:

Draw方法绘制对象,参数是:

- Canvas    on canvas

- Scale    scaling along the X- and Y-axes    //沿X轴和Y轴的缩放

- Offset    offset relative to canvas edges    //相对于画布边缘的偏移

 

The "BeforePrint" method is called immediately before object handling (during the report building process). This method saves the object state.   //处理前调用,保存对象状态

The "GetData" method is called to load data into the object.   //将数据加载到对象

The "AfterPrint" method is called after object handling. This method restores the object state.  //对象处理完成后调用,恢复对象状态。

 

"TfrxDialogComponent" is the base class for writing non-visual components that can be used in dialogue forms in a report.

类"TfrxDialogComponent"是编写非可视化类组件的基类,用在报表中的对话框形式。

TfrxDialogComponent = class(TfrxReportComponent)

public

property Bitmap: TBitmap;

property Component: TComponent;

published

property Left;

property Top;

end;

 

“TfrxDialogControl” is the base class for writing common controls that can be used in dialogue forms in a report. This class has a large number of general properties and events shared by most of the common controls.

类"TfrxDialogControl"是编写可视化公共控件的基类,用在报表中的对话框形式。该类有大多数公共控件共有的一般属性和事件。

TfrxDialogControl = class(TfrxReportComponent)

protected

procedure InitControl(AControl: TControl);

public

property Caption: String;

property Color: TColor;

property Control: TControl;

property OnClick: TfrxNotifyEvent;

property OnDblClick: TfrxNotifyEvent;

property OnEnter: TfrxNotifyEvent;

property OnExit: TfrxNotifyEvent;

property OnKeyDown: TfrxKeyEvent;

property OnKeyPress: TfrxKeyPressEvent;

property OnKeyUp: TfrxKeyEvent;

property OnMouseDown: TfrxMouseEvent;

property OnMouseMove: TfrxMouseMoveEvent;

property OnMouseUp: TfrxMouseEvent;

published

property Left;

property Top;

property Width;

property Height;

property Font;

property ParentFont;

property Enabled: Boolean;

property Visible;

end;

When writing your own custom control, you should inherit from this class, move the required properties to the “published” section, and then add new properties for your common control. The writing of custom controls will be discussed in detail in the next chapter.

当写自己的控件时,你应该从这个类继承,把需要的属性移到published区,并添加你自己新的属性。自定义控件的编写将在下一章中详细讨论。

 

"TfrxView" is the base class for most components that can be placed on the report design page. Objects of this class have attributes such as “Frame” and “Filling” and can also be connected to a data source. Most FastReport standard objects inherit from this class.

类"TfrxView"是大多在报表设计页上放置的组件的基类。此类对象有属性如Frame ,Filling,并且可以连接到一个数据源。多数FastReport标准对象继承自该类。

TfrxView = class(TfrxReportComponent)

protected

FX, FY, FX1, FY1, FDX, FDY, FFrameWidth: Integer;

FScaleX, FScaleY: Extended;

FCanvas: TCanvas;

procedure BeginDraw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); virtual;

procedure DrawBackground;

procedure DrawFrame;

procedure DrawLine(x, y, x1, y1, w: Integer);

public

function IsDataField: Boolean;

property BrushStyle: TBrushStyle;

property Color: TColor;

property DataField: String;

property DataSet: TfrxDataSet;

property Frame: TfrxFrame;

published

property Align: TfrxAlign;

property Printable: Boolean;

property ShiftMode: TfrxShiftMode;

property TagStr: String;

property Left;

property Top;

property Width;

property Height;

property Restrictions;

property Visible;

property OnAfterPrint;

property OnBeforePrint;

end;

The following methods are defined in this class:

- BeginDraw    called by the “Draw” method; calculates integer-valued coordinates and size of drawing area.

Calculated values are exposed as FX, FY, FX1, FY1, FDX and FDY variables. Frame width (exposed as FFrameWidth) is also calculated

调用Draw方法,计算区域的坐标和大小。

- DrawBackground    draws object background  //绘制对象背景

- DrawFrame    draws object frame   //绘制对象边框

- DrawLine    draws line with specified coordinates and width   //绘制具有指定坐标和宽度的行

- IsDataField    returns “True” if DataSet and DataField properties contain non-empty values

One can refer to the following properties after calling the “BeginDraw” method:

- FX, FY, FX1, FY1,FDX, FDY,

FFrameWidth    the object frame coordinates, sizes and width calculated using the Scale and Offset parameters

- FscaleX,FScaleY    X & Y-scaling, which are copies of the ScaleX and ScaleY parameters from the Draw method

- FCanvas    the canvas, which is a copy of the Canvas parameter from the Draw method

The class defines the following properties, which are found in most report objects:

类定义了大多数报表对象中的下列属性:

- BrushStyle    object fill style

- Color    object fill color

- DataField    name of data field to which object is connected

- DataSet    data source

- Frame    object frame

- Align    object alignment relative to its parent

- Printable    defines whether given object can be printed out  //定义给定的对象是否可以打印出来

- ShiftMode    shift mode of object in cases when a stretchable object is placed above it  //换档模式对象的情况时,可延伸的对象放在上面

- TagStr    field for storing user information  //存储用户信息的字段(用户可以自己使用,类似Tag)

 

"TfrxStretcheable" is the base class for writing components which modify their height depending on the data placed in them.

类"TfrxStretcheable"是编写那些高度由数据内容的高度决定的组件的基类。(意即组件高度是动态的)

TfrxStretcheable = class(TfrxView)

public

function CalcHeight: Extended; virtual;

function DrawPart: Extended; virtual;

procedure InitPart; virtual;

published

property StretchMode: TfrxStretchMode;

end;

Objects of this class can be stretched vertically and also split into smaller pieces when the objects don't have sufficient width on the output page. The objects are split enough times to fit all of their data into the available space.

此类型的对象可以垂直拉伸和分裂成更小的片段,当对象在输出页上没有足够的宽度时。该对象被分割足够的时间,以适应所有的数据到可用的空间。

The following methods are defined in this class:

- CalcHeight    calculates and returns object height according to the data placed in it  //根据所放置的数据计算并返回对象高度

- InitPart    called before object splitting  //对象分割前调用

- DrawPart    draws next data chunk placed in object “Return value” is the amount of unused space where it was impossible to display data

//绘制对象的下一个数据块,返回值是无法显示的数据未使用空间的量。

 

以上是FastReport报表中几个重要的基类,以及类中重要的方法,属性。

TfrxComponent
TfrxReportComponent
TfrxDialogComponent
TfrxDialogControl
TfrxView
TfrxStretcheable

[翻译] FastReport Class Hierarchy (FastReport 组件类层次结构)的更多相关文章

  1. Swing学习笔记1-----Swing组件类的层次

    1.  从结构上划分 Swing 组件类分为两种,一种是JComponent类,一种是Windows类.其中windows类包含的是一些可以独立显示的组件,而JComponent类包含的是不可以独立显 ...

  2. 12 哈希表相关类——Live555源码阅读(一)基本组件类

    12 哈希表相关类--Live555源码阅读(一)基本组件类 这是Live555源码阅读的第一部分,包括了时间类,延时队列类,处理程序描述类,哈希表类这四个大类. 本文由乌合之众 lym瞎编,欢迎转载 ...

  3. ExtJs中xtype与组件类的对应表

    from:http://blog.163.com/jx_dream/blog/static/117056627201223091021410/ 核心提示:我们在使用 ExtJs 创建组件时最容易理解的 ...

  4. WPF类层次结构

    WPF类层次结构 System.Threading.DispatcherObject类 WPF应用程序使用STA(Single Thread Affinity)模型,整个用户界面由一个单独的线程拥有, ...

  5. [react 基础篇]——React.createClass()方法同时创建多个组件类

    react 组件 React 允许将代码封装成组件(component),然后像插入普通 HTML 标签一样,在网页中插入这个组件.React.createClass 方法就用于生成一个组件类 一个组 ...

  6. 在JavaScript里写类层次结构?别那么做!

    从理论上讲,JavaScript并没有类.在实践中,下面的代码片段被广泛认为是JavaScript“类”的一个例子: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 fu ...

  7. iBATIS 框架主要的类层次结构

    iBATIS 框架主要的类层次结构 总体来说 iBATIS 的系统结构还是比较简单的,它主要完成两件事情: 根据 JDBC 规范建立与数据库的连接: 通过反射打通 Java 对象与数据库参数交互之间相 ...

  8. [No0000171]wpf 类层次结构Class Hierarchy

    1.DispatcherObject类表示具有相关联的对象分派器.调度程序处理要在特定线程上执行工作的请求队列.它能够在其关联的线程上调用方法. DispatcherObject是对象的基类,用于跟踪 ...

  9. [翻译]Writing Component Editors 编写组件的编辑器

    Writing Component Editors  编写组件的编辑器   All common control editors (opened from a control's context me ...

随机推荐

  1. 关于hashmap的排序

    刚学java不久 之前在学习hashmap的时候 无意间发现,诶?怎么结果是排序的,然后重新输入了好多次,握草,原来java 1.8都实现了hashmap的排序 天真的我没有去网上查,没有去想java ...

  2. Python调用R语言

    网络上经常看到有人问数据分析是学习Python好还是R语言好,还有一些争论Python好还是R好的文章.每次看到这样的文章我都会想到李舰和肖凯的<数据科学中的R语言>,书中一直强调,工具不 ...

  3. 设置MySQL重做日志大小

    什么是InnoDB事务日志 你有没有在文本编辑器中使用过撤消或重做的功能,想像一下编辑器在那种场景下的操作?我确信你应该使用过.你相信吗?事务型数据库有同样的功能.可能不完全一样,但原理是相同的. 就 ...

  4. python re示例

    #!/usr/bin/env python # encoding: utf-8 # Date: 2018/5/25import re s = '124311200111155214'ss = re.s ...

  5. mongodb聚合 group

    MongoDB中聚合(aggregate)主要用于处理数据(诸如统计平均值,求和等),并返回计算后的数据结果.有点类似sql语句中的 count(*). 基本语法为:db.collection.agg ...

  6. nginx收到空包问题

    tcpdump有收包,但是nginx的access.log显示post数据为空 可以通过tcpdump监控端口 http://www.cnblogs.com/linn/p/4792468.html 修 ...

  7. python之解析json

    json的格式是一个无序的键值对的集合,对象以{}包含,键值中间用:隔开,两个键值对之间用,隔开,值可以是双引号引起来的字符串(string),数值(number),true,false,null,对 ...

  8. 20165233 Java第二、三章学习总结

    2017-2018-2 <Java程序设计>第二周学习总结 教材学习内容总结 第二.三章 ch2 标识符与关键字 基本数据类型: 逻辑类型:boolean 整数类型:int.byte.sh ...

  9. 七、配置ssh keys连通github跟ssh-agent

    jenkins+github配置完成后,能够实现在提交pull request或者直接push时,能够将提交的代码拉去一份到服务器本地,并自动merge:但是代码拉去下来了,部署环境的时候却需要输入登 ...

  10. padding margin border 和元素大小

    元素占用宽度 = 元素宽度+padding+border+margin 注意margin只是隔开元素,不会使得元素变大,而padding会使得元素变大,也就是说 元素真实宽度=元素宽度+padding ...