Component registration in script system to register components
To refer to We component from a script, the class, its properties and methods must first being registered in the script Syst Em. The registration code in a file with the same name as the component code file, with an added ' RTTI ' suffix ( Frxbitbtnrtti.pas in We case). See more on classes, registration, methods and properties in the Fastscript Script Library documentation.
To reference our own written component from the script, the class, properties, and methods of the component must first be registered in the scripting system. You can put the registration code in a file of the same name as the component's code file, add the Rtti suffix (frxbitbtnrtti.pas in our example). For more information on classes, registrations, methods and properties, see the 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 is several common controls in your Unit,they can is registered here;
For example, AddClass (Tfrxanothercontrol, ' Tfrxdialogcontrol '); }
End
End
Initialization
Fsrttimodules.add (tfunctions);
Finalization
Fsrttimodules.remove (tfunctions);
End.
Refer to the Fs_imenusrtti.pas unit
Translation Component registration in script system to register components