[翻译]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 ...
随机推荐
- Netty私有协议栈 读书笔记
1.数据结构定义 1)netty消息:NettyMessage package com.cherry.netty.demo.protocolstack.pojo; import com.cherry. ...
- 收藏的一些github开源项目,在这里记录一下
1.在windows系统上在命令行中执行rm -fr */*.file 会报错, rimraf这个项目提供了跨平台支持rm命令,github地址: https://github.com/isaacs/ ...
- kernel_task high cpu usage
# Find the model $ system_profiler -detailLevel mini | grep "Model Identifier:" Model Iden ...
- Oracle Block Change Tracking功能(转)
from:http://space.itpub.net/?uid-25744374-action-viewspace-itemid-732091 通过使用block change tracking功能 ...
- Python的设计哲学
Beautiful is better than ugly. 优美胜于丑陋 Explicit is better than implicit. 明了胜于晦涩 Simple is better than ...
- 用jquery操作字体颜色覆盖当前页面的css设置
直接使用css操作color的时候,!important一直不生效,记录下,使用下面的可以起作用 用jquery操作字体颜色覆盖当前页面的css设置 $('a[href="?p=home&a ...
- C#实现图片文件到数据流再到图片文件的转换
//----引入必要的命名空间using System.IO;using System.Drawing.Imaging; //----代码部分----// private byte[] photo;/ ...
- VB.NET条码机打印设置纸张大小的方法
Imports System.Drawing.PrintingImports System.Runtime.InteropServices Public Class Page <Runti ...
- [ShaderStaff] 圆角矩形效果实现
操作系统:Windows8.1 显卡:Nivida GTX965M 开发工具:Unity2017.3 | Shader 最近在制作一款APP,其中需要对矩形图片资源的展现进行圆角化,看了一下网上的方案 ...
- jsp编译器指令errorPage的用法
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"% ...