FastReport VCL报表控件开发者手册四:构件注册

若要从脚本中访问组件,首先需要在脚本系统中对组件类,属性和方法进行注册。你可以将注册码存放在一个与组件码同名的后缀名为 'RTTI'的文件夹中。本文就主要介绍如何在脚本系统(Script System)中进行构件注册。

uses fs_iinterpreter, frxBitBtn, frxClassRTTI;
type
TFunctions = class(TfsRTTIModule)
public
constructor Create(AScript: TfsScript); override;
end;
constructor TFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do
begin
{ register class and then define its parent }
AddClass(TfrxBitBtnControl, 'TfrxDialogControl');
{ if there are several common controls in your unit,
they can be registered here;
for example, AddClass(TfrxAnotherControl, 'TfrxDialogControl'); }
end;
end;
initialization
fsRTTIModules.Add(TFunctions);
end.

posted @ 2012-12-05 10:45  LeamonAB  阅读(451)  评论(0编辑  收藏  举报