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.

  • 相关阅读:
    delphi 时间格式操作
    Sleep函数的真正用意
    delphi公共函数 UMyPubFuncFroc--版权所有 (C) 2008 勇者工作室
    delphi override、overload、reintroduce的区别-0613.txt
    8、显示程序占用内存多少.txt
    可逆加密解密单元文件和调用方法
    Delphi7 客户端调用WebService(天气预报)
    操作TAB文件和TStringGrid赋值;
    3、利用SuperObject 循环处理Json深层次的值
    4、delphi record数组复制
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392365.html
Copyright © 2011-2022 走看看