zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    链表的相关操作
    【回溯】旅行商问题
    【回溯】图的m着色问题
    奶牛卧室_待解决
    阶乘问题
    子数整数
    hihoCoder week4 Trie图
    hihoCoder week3 KMP算法
    hihoCoder week2 Trie树
    hihoCoder week1 最长回文子串
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392365.html
Copyright © 2011-2022 走看看