Translation Component registration in script system to register components

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.