16,748
社区成员
发帖
与我相关
我的任务
分享
unit Web;
interface
uses
Classes, SysUtils, Windows, ToolsApi, DCCStrs;
Type
TWeb = class(TInterfacedObject, IOTAWizard, IOTARepositoryWizard, IOTAProjectWizard, IOTACreator, IOTAProjectCreator, IOTAProjectCreator50, IOTAProjectCreator80) //
public
end;
TWebPage = Class(TInterfacedObject, IOTACreator, IOTAModuleCreator)
public
end;
procedure RegWeb;
implementation
uses WebConst, NewPageForms, Controls;
const
DLLName = 'NewDLL.dpr';
var
ModuleName: string;
procedure RegWeb;
begin
RegisterPackageWizard(TWeb.Create as IOTAWizard);
end;
{ TWeb }
procedure TWeb.Execute;
begin
(BorlandIDEServices as IOTAModuleServices).CreateModule(self);
end;
function TWeb.GetCreatorType: string;
begin
Result := sLibrary;
end;
function TWeb.GetPage: string;
begin
Result := PageName;
end;
function TWeb.GetState: TWizardState;
begin
Result := [wsEnabled];
end;
procedure TWeb.NewDefaultModule;
begin
(BorlandIDEServices as IOTAModuleServices).CreateModule(TWebPage.Create);
end;
function TWeb.NewProjectSource(const ProjectName: string): IOTAFile;
var
SB: TCRLFStringBuilder;
begin
SB := TCRLFStringBuilder.Create;
with SB do
begin
append('library ' + ProjectName + ';');
append;
append('uses');
append(' System.Sharemem,');
append(' System.SysUtils,');
append(' System.Classes;');
append;
append('exports GetClass;');
append;
append('begin ');
append('end.');
end;
Result := StringToIOTAFile(SB.ToString);
end;
{ TWebPage }
function TWebPage.GetCreatorType: string;
begin
Result := sUnit;
end;
function TWebPage.NewImplSource(const ModuleIdent, FormIdent, AncestorIdent: string): IOTAFile;
begin
Result := StringToIOTAFile(GetSource(ModuleName, 'T' + ModuleName));
end;
end.