zoukankan      html  css  js  c++  java
  • [翻译]Component Registration in Script System 在脚本系统中注册组件

    Component Registration in Script System 在脚本系统中注册组件

    To refer to our component from a script, the class, its properties and methods must first be registered in the script system. You may place the registration code in a file with the same name as the component code file, with an added 'RTTI' suffix (frxBitBtnRTTI.pas in our case). See more about classes, registration, methods and properties in the FastScript script library documentation.

    要从脚本中引用我们的自己写的组件,该组件的类,属性和方法必须先注册在脚本系统中。你可以把注册代码放在相同名称的文件中作为组件的代码文件,添加的RTTI的后缀(frxbitbtnrtti.pas在我们这个例子中)。更多关于类,注册,方法和属性,请查看FastScript 脚本库文档。

    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);

    finalization
      fsRTTIModules.Remove(TFunctions);

    end.

    可以参考 fs_imenusrtti.pas 单元

  • 相关阅读:
    ios-表视图-demo4-内容自己适应高度
    ios-表视图-demo3-单选
    应用管理的实现
    初识MVC和KVC
    Xcode的常用快捷键
    UI基础--手写代码实现汤姆猫动画
    UI基础--UIView常见属性之frame、center、bounds、transframe属性
    UI基础--UIButton、懒加载
    ios多线程
    ios多线程简介
  • 原文地址:https://www.cnblogs.com/moon25/p/5530875.html
Copyright © 2011-2022 走看看