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.

  • 相关阅读:
    Asp.net Vnext 模块化实现
    Asp.net Vnext 实现IView
    Asp.net Vnext TagHelpers
    MVC 源码调试
    Asp.net Vnext 中间件实现基本验证
    Azure SQL Federation(联合)
    Microsoft Azure 配置负载均衡
    Asp.net Vnext 调试源码
    阅读文献总结笔记9
    阅读文献总结笔记4
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392383.html
Copyright © 2011-2022 走看看