Component Registration in Script System
To refer to our component from script, it is necessary to register its class, its properties, and methods in the script system. Register code, according to FastReport requirements, it may be placed in a file with the same name as component code file, adding RTTI suffix (for example, frxBitBtnRTTI.pas in our case). See more about classes
registration, their methods and properties in FastScript script library documentation.
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 right here }
{ for example, AddClass(TfrxAnotherControl, 'TfrxDialogControl'); }
end;
end;
initialization
fsRTTIModules.Add(TFunctions);
end.