• unigui控件的FASTSCRIPT封装


    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.

  • 相关阅读:
    zookeeper部署
    Hadoop集群的构建和安装
    numpy ndarray求其最值的索引
    两数之和
    盛最多水的容器
    mysql 单表卡死
    Leetcode 258. Add Digits
    Matlab中添加路径与去除路径
    Leetcode 136 Single Number
    Leetcode 485. Max Consecutive Ones
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392365.html
Copyright © 2020-2023  润新知