English 中文(简体)
2010年代菲与工具登记习惯 复印件
原标题:Register custom form in delphi 2010 with ToolsApi

我有来自图瓦卢的习俗。 我使用工具Api来登记海关模块,并将其添加到存放处。 迄今情况良好。 但是,当我点击档案和特案时,新我可以看一看我的习惯形式,但残疾。 Icon受到注意,我无法选择它来从菜单中创造我的习惯形式,并将其添加到项目上。

你们是否有任何建议和暗示什么是错的,我应当做些什么?

Click here to transfer my source Code...

提前感谢。

<><>Edit>:

此外,我认为有必要列入法典:

unit CustomFormFrame_Design;    

interface

{$Include jvcl.inc}

uses Windows, Classes, ToolsAPI;

type
    TPoCustomFormWizard = class(TNotifierObject, IOTAWizard, IOTARepositoryWizard,    
    IOTAFormWizard, IOTACreator, IOTAModuleCreator,    
    IOTARepositoryWizard60   
    {$IFDEF COMPILER8_UP}, IOTARepositoryWizard80 {$ENDIF COMPILER8_UP}   
    {$IFDEF COMPILER10_UP}, IOTAProjectWizard100 {$ENDIF COMPILER10_UP})   
  private
     FUnitIdent: string;
     FClassName: string;
     FFileName: string;
  protected
    // IOTAWizard methods
    function GetIDString: string;
    function GetName: string;
    function GetState: TWizardState;
    procedure Execute;
    // IOTARepositoryWizard / IOTAFormWizard methods
    function GetAuthor: string;
    function GetComment: string;
    function GetPage: string;
    function GetGlyph: Cardinal;
    // IOTACreator methods
    function GetCreatorType: string;
    function GetExisting: Boolean;
    function GetFileSystem: string;
    function GetOwner: IOTAModule;
    function GetUnnamed: Boolean;
    // IOTAModuleCreator methods
    function GetAncestorName: string;
    function GetImplFileName: string;
    function GetIntfFileName: string;
    function GetFormName: string;
    function GetMainForm: Boolean;
    function GetShowForm: Boolean;
    function GetShowSource: Boolean;
    function NewFormFile(const FormIdent, AncestorIdent: string): IOTAFile;
    function NewImplSource(const ModuleIdent, FormIdent,
    AncestorIdent: string): IOTAFile;
    function NewIntfSource(const ModuleIdent, FormIdent,
    AncestorIdent: string): IOTAFile;
    procedure FormCreated(const FormEditor: IOTAFormEditor);

    { IOTARepositoryWizard60 }
    function GetDesigner: string;

    {$IFDEF COMPILER8_UP}
    { IOTARepositoryWizard80 }
    function GetGalleryCategory: IOTAGalleryCategory; virtual;
    function GetPersonality: string; virtual;
    {$ENDIF COMPILER8_UP}

    {$IFDEF COMPILER10_UP}
    { IOTAProjectWizard100 }
    function IsVisible(Project: IOTAProject): Boolean;
    {$ENDIF COMPILER10_UP}

    {$IFDEF COMPILER8_UP}
    property Personality: string read GetPersonality;
    {$ENDIF}


    end;

    procedure Register;    

implementation

  uses Forms, PoCustomForm,  SysUtils, DesignIntf, DesignEditors;

  {$R *.res}

type
  TBaseFile = class(TInterfacedObject)
  private
    FModuleName: string;
    FFormName: string;
    FAncestorName: string;
  public
    constructor Create(const ModuleName, FormName, AncestorName: string);
  end;

  TUnitFile = class(TBaseFile, IOTAFile)
  protected
    function GetSource: string;
    function GetAge: TDateTime;
  end;

  TFormFile = class(TBaseFile, IOTAFile)
  protected
    function GetSource: string;
    function GetAge: TDateTime;
  end;

 procedure Register;
 begin
   RegisterCustomModule(TPoCustomForm, TCustomModule);
   RegisterPackageWizard(TPoCustomFormWizard.Create);
 end;

{ TBaseFile }
constructor TBaseFile.Create(const ModuleName, FormName, AncestorName: string);
begin
  inherited Create;
  FModuleName := ModuleName;
  FFormName := FormName;
  FAncestorName := AncestorName;
end;

{ TUnitFile }
function TUnitFile.GetSource: string;
var
  Text: string;
  ResInstance: THandle;
  HRes: HRSRC;
begin
  ResInstance := FindResourceHInstance(HInstance);
  HRes := FindResource(ResInstance,  CODEGEN , RT_RCDATA);
  Text := PChar(LockResource(LoadResource(ResInstance, HRes)));
  SetLength(Text, SizeOfResource(ResInstance, HRes));
  Result := Format(Text, [FModuleName, FFormName, FAncestorName]);
end;

function TUnitFile.GetAge: TDateTime;
begin
Result := -1;
end;

{ TFormFile }
function TFormFile.GetSource: string;
const FormText =  object %0:s: T%0:s #13#10 end ;
begin
  Result := Format(FormText, [FFormName]);
end;

function TFormFile.GetAge: TDateTime;
begin
  Result := -1;
end;

{ TAppBarWizard }

{ TAppBarWizard.IOTAWizard }
function TPoCustomFormWizard.GetIDString: string;
begin
  Result :=  XFORM.PoCustomForm ;
end;

function TPoCustomFormWizard.GetName: string;
begin
  Result :=  XFORM PoCustom Form Wizard ;
end;

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

procedure TPoCustomFormWizard.Execute;
begin
  (BorlandIDEServices as IOTAModuleServices).GetNewModuleAndClassName(
   PoCustomForm , FUnitIdent, FClassName, FFileName);
  (BorlandIDEServices as IOTAModuleServices).CreateModule(Self);
end;

{ TPoCustomFormWizard.IOTARepositoryWizard / TPoCustomFormWizard.IOTAFormWizard }
function TPoCustomFormWizard.GetGlyph: Cardinal;
begin
  Result := 0; // use standard icon
end;


function TPoCustomFormWizard.GetPage: string;
begin
  Result :=  XFORM ;
end;

function TPoCustomFormWizard.GetAuthor: string;
begin
  Result :=  XFORM ;
end;

function TPoCustomFormWizard.GetComment: string;
begin
  Result :=  Creates a new PoCustom form. 
end;

{ TPoCustomFormWizard.IOTACreator }
function TPoCustomFormWizard.GetCreatorType: string;
begin
  Result :=   ;
end;

function TPoCustomFormWizard.GetDesigner: string;
begin
  Result := dVCL;
end;

{$IFDEF COMPILER8_UP}
function TPoCustomFormWizard.GetGalleryCategory: IOTAGalleryCategory;
begin
  Result := (BorlandIDEServices as IOTAGalleryCategoryManager).FindCategory( Borland.Delphi.New.Expert );
end;

function TPoCustomFormWizard.GetPersonality: string;
begin
  Result := sDelphiPersonality;
end;
{$ENDIF COMPILER8_UP}

{$IFDEF COMPILER10_UP}
function TPoCustomFormWizard.IsVisible(Project: IOTAProject): Boolean;
begin
  Result := True;
end;
{$ENDIF COMPILER10_UP}

function TPoCustomFormWizard.GetExisting: Boolean;
begin
  Result := False;
end;

function TPoCustomFormWizard.GetFileSystem: string;
begin
  Result :=   ;
end;

function TPoCustomFormWizard.GetOwner: IOTAModule;
var
  I: Integer;
  ModServ: IOTAModuleServices;
  Module: IOTAModule;
  ProjGrp: IOTAProjectGroup;
begin
  Result := nil;
  ModServ := BorlandIDEServices as IOTAModuleServices;
  for I := 0 to ModServ.ModuleCount - 1 do
  begin
    Module := ModSErv.Modules[I];
    // find current project group
    if CompareText(ExtractFileExt(Module.FileName),  .bpg ) = 0 then
    if Module.QueryInterface(IOTAProjectGroup, ProjGrp) = S_OK then
    begin
      // return active project of group
     Result := ProjGrp.GetActiveProject;
     Exit;
   end;
  end;
end;

function TPoCustomFormWizard.GetUnnamed: Boolean;
begin
  Result := True;
end;

{ TPoCustomFormWizard.IOTAModuleCreator }
function TPoCustomFormWizard.GetAncestorName: string;
begin
  Result :=  TPoCustomForm ;
end;

function TPoCustomFormWizard.GetImplFileName: string;
var
CurrDir: array[0..MAX_PATH] of Char;
begin
  // Note: full path name required!
  GetCurrentDirectory(SizeOf(CurrDir), CurrDir);
  Result := Format( %s\%s.pas , [CurrDir, FUnitIdent,  .pas ]);
end;

function TPoCustomFormWizard.GetIntfFileName: string;
begin
  Result :=   ;
end;

function TPoCustomFormWizard.GetFormName: string;
begin
  Result := FClassName;
end;

function TPoCustomFormWizard.GetMainForm: Boolean;
begin
  Result := False;
end;

function TPoCustomFormWizard.GetShowForm: Boolean;
begin
  Result := True;
end;

function TPoCustomFormWizard.GetShowSource: Boolean;
begin
  Result := True;
end;

function TPoCustomFormWizard.NewFormFile(const FormIdent,
AncestorIdent: string): IOTAFile;
begin
  Result := TFormFile.Create(  , FormIdent, AncestorIdent);
end;

function TPoCustomFormWizard.NewImplSource(const ModuleIdent, FormIdent,
AncestorIdent: string): IOTAFile;
begin
  Result := TUnitFile.Create(ModuleIdent, FormIdent, AncestorIdent);
end;

function TPoCustomFormWizard.NewIntfSource(const ModuleIdent, FormIdent,
AncestorIdent: string): IOTAFile;
begin
  Result := nil;
end;

procedure TPoCustomFormWizard.FormCreated(const FormEditor: IOTAFormEditor);
begin
// do nothing
end;

end.
问题回答

http://forms.embarcadero.com/forms 通过禁运。

我给你这个联系,而不是仅仅回答,是因为我把一个以上问题与你的法典联系起来,你们可以通过白皮书阅读。 长期以来,我们赢得了你们的胜利,因此,我们提出了 de,不仅会解决这个问题,而且会解决你在与《奥斯陆行动计划》打交道时可能遇到的大多数问题。





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签