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 单元

[翻译]Component Registration in Script System 在脚本系统中注册组件的更多相关文章

  1. Vue Component Registration All In One

    Vue Component Registration All In One Vue 注册自定义组件 <template> <div class="back-to-top-c ...

  2. arcgis python arcpy add data script添加数据脚本

    arcgis python arcpy add data script添加数据脚本mxd = arcpy.mapping.MapDocument("CURRENT")... df ...

  3. [转]Script标签和脚本执行顺序

    Script标签和脚本执行顺序 这里详细聊聊和script标签相关的脚本执行顺序. Script标签的默认行为 几个首要特性: script标签(不带defer或async属性)的会阻止文档渲染.相关 ...

  4. XFS: Cross Frame Script (跨框架脚本) 攻击。

    一.Cross Frame Script (跨框架脚本) 攻击什么是Cross Frame Script?很简单,做个实验就知道了.把下面的这段HTML代码另存为一个html文件,然后用ie浏览器打开 ...

  5. Cross Frame Script (跨框架脚本) 攻击

    一.Cross Frame Script (跨框架脚本) 攻击 什么是Cross Frame Script? 很简单,做个实验就知道了.把下面的这段HTML代码另存为一个html文件,然后用ie浏览器 ...

  6. 深入比特币原理(四)——锁定脚本(locking script)与解锁脚本(unlocking script)

    通常比特币都是以虚拟货币的概念出现在大众眼前,实际上比特币是第一个真正的区块链"平台",利用它去中心化.不可篡改.可追溯等特点不光可以实现多种交易模式(如点对点交易.多重签名交易等 ...

  7. script标签引入脚本的引入位置与效果

    用script标签引入脚本的引入位置大致有两种情况: 1,在head中引入: 2,在body末尾引入: 浏览器由上到下解析代码,正常情况下,先解析head中的代码,在解析body中的代码:放在head ...

  8. unity 在脚本B中调用脚本A的函数

    一,在脚本B中调用脚本A的函数. 脚本A: //myFuncs.cs using UnityEngine;using System.Collections; namespace myFuncs{    ...

  9. Bash 脚本编程语言中的美学与哲学

    我承认,我再一次地当了标题党.但是不可否认,这一定是一篇精华随笔.在这一篇中,我将探讨 Bash 脚本语言中的美学与哲学. 这不是一篇 Bash 脚本编程的教程,但是却能让人更加深入地了解 Bash ...

随机推荐

  1. Call to your teacher

    链接:https://www.nowcoder.net/acm/contest/76/F来源:牛客网 Call to your teacher 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/ ...

  2. HDU 4762 Cut the Cake(高精度)

    Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  3. Ngnix常用的操作

    Nginx的常用参数如下: # /usr/local/nginx/sbin/nginx -h nginx version: nginx/0.7.63 Usage: nginx [-?hvVt] [-s ...

  4. jemalloc内存分配器详解

    前言 C 中动态内存分配malloc 函数的背后实现有诸派:dlmalloc 之于 bionic:ptmalloc 之于 glibc:allocation zones 之于 mac os x/ios: ...

  5. Introduction to Spring Data MongoDB

    Introduction to Spring Data MongoDB I just announced the new Spring 5 modules in REST With Spring: & ...

  6. django-model的元类Meta

    Meta类存在model类里面 模型元选项 文档有更多Meta类的配置属性: English:https://docs.djangoproject.com/en/1.11/ref/models/opt ...

  7. OpenCL 使用函数 clCreateProgramWithBinary 来创建程序

    ▶ 函数 clCreateProgramWithSource 接收 OpenCL 代码(设备无关)来创建程序,而函数 clCreateProgramWithBinary 接收已经经过函数 clBuil ...

  8. Selenium Webdriver——处理Table

    html table是由 table 元素以及一个或多个 tr.th 或 td 元素组成.如下: HTML源码如下: <html> <head> <meta http-e ...

  9. 路由的分发include实现

    在主程序里面的URL.py 中 from django.conf.urls import url, include urlpatterns = [ url(r'^cmdb/', include('ap ...

  10. 1 数据库开发--MySQL介绍

    1.数据库管理软件 C/S 并发.锁 :SQL语句.语法 基本管理和语法学习 一.介绍: mysql数据库管理软件: 套接字:服务端,客户端:客户端可访问服务端得数据 1.支持并发:操作得是共享得数据 ...