zoukankan      html  css  js  c++  java
  • TdxBarButton的FASTSCRIPT封装

    TdxBarButton的FASTSCRIPT封装

    // cxg 2017-2-13

    unit fs_dev;

    interface
    {$i fs.inc}
    uses
    fs_iinterpreter, fs_itools, fs_ievents,
    fs_iclassesrtti, Variants,
    dxBar, cxClasses
    ;

    type
    TdxBarButtonRTTI = class(TdxBarButton); // fake component

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

    type
    TdevFunctions = 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;

    implementation

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

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

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

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

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

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

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

    end.

  • 相关阅读:
    __attribute__ 总结
    linux文件夹打包命令
    学习ARM的一些基本知识,个人整理
    备忘录之 —— .bashrc(IC工具篇)
    GitHub的基本使用
    02: SocketServer服务
    01: socket模块
    08: python基础练习题
    07: 高阶函数&异常处理
    06: 面向对象
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392383.html
Copyright © 2011-2022 走看看