unigui控件的FASTSCRIPT封装

unit fs_uniControl;

interface
{$i fs.inc}
uses
fs_iinterpreter, fs_itools, fs_ievents,
fs_iclassesrtti,System.Variants,
uniMainMenu,uniPageControl;

type
TuniMenuItemRTTI = class(TUniMenuItem); // fake component

TfsNotifyEvent = class(TfsCustomEvent)
public
procedure DoEvent(Sender:TObject);
function GetMethod: Pointer; override;
end;

type
TuniFunctions = class(TfsRTTIModule)
private
function CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
function GetProp(Instance: TObject; ClassType: TClass;
const PropName: String): Variant;
procedure SetProp(Instance: TObject; ClassType: TClass;
const PropName: String; Value: Variant);
public
constructor Create(AScript: TfsScript); override;
end;
VAR uniFunctions:TuniFunctions;
implementation
{ TFunctions }

procedure TfsNotifyEvent.DoEvent(Sender: TObject);
begin
CallHandler([Sender]);
end;

function TfsNotifyEvent.GetMethod: Pointer;
begin
Result := @TfsNotifyEvent.DoEvent;
end;

constructor TuniFunctions.Create(AScript: TfsScript);
begin
inherited Create(AScript);
with AScript do
begin
with AddClass(TUniMenuItem, 'TUniMenuItem') do
begin
AddEvent('OnClick', TfsNotifyEvent);
end;

with AddClass(TUniTabSheet, 'TUniTabSheet') do
begin

end;
end;
end;

function TuniFunctions.CallMethod(Instance: TObject; ClassType: TClass;
const MethodName: String; Caller: TfsMethodHelper): Variant;
begin
end;

function TuniFunctions.GetProp(Instance: TObject; ClassType: TClass;
const PropName: String): Variant;
begin
end;

procedure TuniFunctions.SetProp(Instance: TObject; ClassType: TClass;
const PropName: String; Value: Variant);
begin
end;

initialization
fsRTTIModules.Add(TuniFunctions);
finalization
fsRTTIModules.Remove(TuniFunctions);

end.

unigui控件的FASTSCRIPT封装的更多相关文章

  1. IP编辑控件(因为封装的是系统自带控件,所以也使用了CreateSubClass,不过为啥要封装CN_COMMAND和CN_NOTIFY不是很明白)

    最近需要用一个IP输入控件,网上找了几个,都不符合效果,有些还有一些奇怪的Bug.后来发现原来系统已经提供了IP地址编辑控件,只是系统提供的控件不能设置只读效果.网上找了下资料,封装了一下,自己迂回一 ...

  2. 【NET】Winform用户控件的初步封装之编辑控件

    编辑控件 public abstract partial class TEditorBase <TEntity, TRepository, TSqlStrConstruct> : User ...

  3. Android-PickerView【仿iOS的PickerView控件,并封装了时间选择和选项选择这两种选择器】使用

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 本文主要演示Android-PickerView的选项选择器.时间选择器的简单运用.由于每一个版本略有不用,所以实际使用方式以git ...

  4. Jedi项目,还真得好好看看,有许多控件和新封装的API(Delphi里面没有)

    以前没有重视 http://www.delphi-jedi.org/ https://github.com/project-jedi https://sourceforge.net/projects/ ...

  5. 【NET】Winform用户控件的初步封装之列表页控件

    public abstract partial class TListPager<TEntity, TRepository, TSqlStrConstruct> : UserControl ...

  6. 控件使用经验-MVP模式+控件封装

    项目背景 几年前参与了一个面向学校的人事管理软件的开发,基于WinForm平台.今天主要想谈一谈其中关于控件的使用经验.这个项目我们大量使用了第三方控件.由于这个产品的生命周期很长,我们在设计时要考虑 ...

  7. [转]Oracle分页之二:自定义web分页控件的封装

    本文转自:http://www.cnblogs.com/scy251147/archive/2011/04/16/2018326.html 上节中,讲述的就是Oracle存储过程分页的使用方式,但是如 ...

  8. Delphi对于控件的SuperClassing(封装并扩展Button,使之变成TButton)

    写博客写了这么久,但是一直不知道应该怎么样写函数之间的调用关系和执行顺序,因为不停的跳来跳去的,但是写的时候却只能顺序写调用关系,直到今天发现这种写法很不错: TButton创建窗口是在CreateW ...

  9. 将webkit内核封装为duilib的浏览器控件

    转载请说明出处,谢谢~~ 原本的duilib是自带浏览器控件的,但是使用了IE内核,我在做仿酷狗音乐播放器时,在右侧乐库要用到浏览器控件,而我使用自带的IE控件却发现了不少缺点,这也是duilib一直 ...

随机推荐

  1. luogu1441 砝码称重

    搜索+背包就是了 #include <iostream> #include <cstring> #include <cstdio> using namespace ...

  2. Java学习笔记3---unable to launch

    环境配置好后,在eclipse下编写HelloWorld程序: ①创建新工程 ②创建.java文件,命名为HelloWorld ③在源文件中添加main方法,代码如下: public void mai ...

  3. [uiautomator篇][1] 官网译文

    http://www.jianshu.com/p/7718860ec657 2016.07.25 20:59 字数 3675 Android UIAutomator浅谈 --------------- ...

  4. Z-Score数据标准化处理(python代码)

    #/usr/bin/python def Z_Score(data): lenth = len(data) total = sum(data) ave = float(total)/lenth tem ...

  5. 【Luogu】P2155沙拉公主的困惑(数论)

    题目链接 数论果然是硬伤qwq 还是智商上的硬伤 我们来讲两个道理 No.1 求1~i!中与i!互质的数的个数 实际上就是求i!的欧拉函数 有如下递推式: f[1]=1 if(i为合数) f[i]=f ...

  6. 周赛Problem 1021: 分蛋糕(埃拉托斯特尼筛法)

    Problem 1021: 分蛋糕 Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format:  %lld  ...

  7. LibreOJ2044 - 「CQOI2016」手机号码

    Portal Description 给出两个十一位数\(L,R\),求\([L,R]\)内所有满足以下两个条件的数的个数. 出现至少\(3\)个相邻的相同数字: 不能同时出现\(4\)和\(8\). ...

  8. BZOJ1499 [NOI2005]瑰丽华尔兹 【单调队列优化dp】

    题目 你跳过华尔兹吗?当音乐响起,当你随着旋律滑动舞步,是不是有一种漫步仙境的惬意?众所周知,跳华尔兹时,最重要的是有好的音乐.但是很少有几个人知道,世界上最伟大的钢琴家一生都漂泊在大海上,他的名字叫 ...

  9. windows命令总结

    工作中还是经常使用windows系统,将windows中常用的命令进行总结. 1. 从命令行打开资源管理器,即文件夹 start . 2. 查看端口占用情况 比如查看3000端口的占用情况 netst ...

  10. 关于console.log() 打印得引用类型得数据得相关问题

    console.log()打印出来得是这个引用类型最终得结果,而不是在打印得时候当前得值 ,b:} console.log(json) json.a = ; 如上  ,打印得将是  {a:3,b:2} ...