[翻译]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 单元
[翻译]Component Registration in Script System 在脚本系统中注册组件的更多相关文章
- Vue Component Registration All In One
Vue Component Registration All In One Vue 注册自定义组件 <template> <div class="back-to-top-c ...
- arcgis python arcpy add data script添加数据脚本
arcgis python arcpy add data script添加数据脚本mxd = arcpy.mapping.MapDocument("CURRENT")... df ...
- [转]Script标签和脚本执行顺序
Script标签和脚本执行顺序 这里详细聊聊和script标签相关的脚本执行顺序. Script标签的默认行为 几个首要特性: script标签(不带defer或async属性)的会阻止文档渲染.相关 ...
- XFS: Cross Frame Script (跨框架脚本) 攻击。
一.Cross Frame Script (跨框架脚本) 攻击什么是Cross Frame Script?很简单,做个实验就知道了.把下面的这段HTML代码另存为一个html文件,然后用ie浏览器打开 ...
- Cross Frame Script (跨框架脚本) 攻击
一.Cross Frame Script (跨框架脚本) 攻击 什么是Cross Frame Script? 很简单,做个实验就知道了.把下面的这段HTML代码另存为一个html文件,然后用ie浏览器 ...
- 深入比特币原理(四)——锁定脚本(locking script)与解锁脚本(unlocking script)
通常比特币都是以虚拟货币的概念出现在大众眼前,实际上比特币是第一个真正的区块链"平台",利用它去中心化.不可篡改.可追溯等特点不光可以实现多种交易模式(如点对点交易.多重签名交易等 ...
- script标签引入脚本的引入位置与效果
用script标签引入脚本的引入位置大致有两种情况: 1,在head中引入: 2,在body末尾引入: 浏览器由上到下解析代码,正常情况下,先解析head中的代码,在解析body中的代码:放在head ...
- unity 在脚本B中调用脚本A的函数
一,在脚本B中调用脚本A的函数. 脚本A: //myFuncs.cs using UnityEngine;using System.Collections; namespace myFuncs{ ...
- Bash 脚本编程语言中的美学与哲学
我承认,我再一次地当了标题党.但是不可否认,这一定是一篇精华随笔.在这一篇中,我将探讨 Bash 脚本语言中的美学与哲学. 这不是一篇 Bash 脚本编程的教程,但是却能让人更加深入地了解 Bash ...
随机推荐
- 黄聪:Wordpress程序Mysql查询导致CPU100%,页面错误增量飙高解决方案
最近做的网站,访客一多,CPU就会飙到100%,找了网上很多解决方案,用了下面的方法进行优化: 1.mysql开启慢查询方法: 在my.ini的[mysqld]添加如下语句: log-slow-que ...
- Mysql插入数据报错java.sql.SQLException: Incorrect string value: '\xF0\x9F\x93\x8D\xE6\x88...'
今天读取solr里面的数据,往mysql插入时报错, Incorrect string value: '\xF0\x9F\x93\x8D\xE8\x88...' for column 'title' ...
- SpringBoot入门篇--使用IDEA创建一个SpringBoot项目
随着技术的更新对于开发速度的追求,我们越来越不能忍受的是Spring框架对于集成开发以后大量的配置问题.所以SprigBoot应运而生,SpringBoot框架其实就是在Spring框架的外边包裹上了 ...
- selenium+python在mac环境上的搭建
前言 mac自带了python2.7的环境,所以在mac上安装selenium环境是非常简单的,输入2个指令就能安装好 需要安装的软件: 1.pip 2.selenium2.53.6 3.Firefo ...
- django-模板,过滤器
for…in…:跟python中的for…in…是一样的用法 {% for m in modules %} {{ forloop.cpunter }} {{ m }} {% end %} forloo ...
- 关于json_encode转义斜杠的问题
加上参数 JSON_UNESCAPED_SLASHES即可 echo json_encode($data,JSON_UNESCAPED_SLASHES);
- (翻译)React Container Components
原文:Container Components Container Components 在 React 模式上对我的代码有最深远影响的一个模式叫 container component 模式. 在 ...
- Pthreads 信号量,路障,条件变量
▶ 使用信号量来进行线程间信息传递 ● 代码 #include <stdio.h> #include <pthread.h> #include <semaphore.h& ...
- Rhythmk 学习 Hibernate 01 - maven 创建Hibernate 项目之 增删改查入门
1.环境: Maven :3.1.1 开发工具:Spring Tool Suite 数据库 : Mysql 5.6 2.项目文件结构 文件代码: 2.1 .pom.xml <project x ...
- StrConv 内码转换
StrConv(string,conversion,LCID) string,预转换的字符串了(也可以使用byte数组). Conversion: 是一个整数,只决定转换方式,VB里定义了一些常量,如 ...