創建一個簡單的"專家"

這個單元可以編譯到一個包中,之後它可以出現在Delphi的幫助菜單中。

注:在Interface的uses 語句中加入ToolsApi.

**type
** TSDCSimpleExpert = class (TNotifierObject, IOTAMenuWizard, IOTAWizard)
**public
function ** GetIDString: string ;
function GetName: string ;
function GetState: TWizardState;
procedure Execute;
function GetMenuText: string ;
end ;

procedure Register ;

**implementation

uses ** Dialogs;

procedure Register ;
begin _
_ RegisterPackageWizard(TSDCSimpleExpert.Create _); { 注冊"專家 }
_ end ;

_{ TSDCSimpleExpert } "}

_ procedure TSDCSimpleExpert.Execute;
**begin
** _{當單擊菜單項時,執行這段代碼}
_ ShowMessage('Hello SwissDelphiCenter Simple Expert.');
end ;

function TSDCSimpleExpert.GetIDString: string ;
**begin
** _{唯一"專家"標識符}
_ Result := 'SwissDelphiCenter.SimpleExpert';
end ;

function TSDCSimpleExpert.GetMenuText: string ;
**begin
** _{菜單項的標題}
_ Result := 'SwissDelphiCenter Simple Expert';
end ;

function TSDCSimpleExpert.GetName: string ;
**begin
** _{“專家”的名字}
_ Result := 'SwissDelphiCenter Simple Expert';
end ;

function TSDCSimpleExpert.GetState: TWizardState;
**begin
** Result := [wsEnabled];
end ;

Published At
Categories with Web编程
Tagged with
comments powered by Disqus