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.

  • 相关阅读:
    vim中实现php代码自动完成功能
    tt安装与配置
    GIT 常用命令
    Git命令行基本操作
    传统的分布式应用集成技术(网摘)
    离线安装IE 11
    Intellij IDEA破解激活
    Win7IE11 For x86&x64离线安装包
    Oracle Instant Client(即时客户端) 安装与配置
    转 [OpenCV]:Visual Studio 2012 搭建 OpenCV2.4.3
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/6392365.html
Copyright © 2011-2022 走看看