Linces
2008-02-22 12:43:32 UTC
Hi..
How i create a Main Menu item in the Delphi IDE "Like GExperts do", i do
like code below, but dont work, plz look:
---------------------------------
unit ENDSISWizard;
interface
uses
ToolsAPI, Windows, SysUtils, Classes, Forms, Messages, Menus;
type
TADPCHStickerWizard = class(TNotifierObject, IOTAWizard, IOTAMenuWizard)
public
{ IOTAWizard }
function GetIDString: string;
function GetName: string;
function GetState: TWizardState;
procedure Execute;
{ IOTAMenuWizard }
function GetMenuText: string;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterPackageWizard(TADPCHStickerWizard.Create);
end;
procedure TADPCHStickerWizard.Execute;
var
i : integer;
MainMenu: TMainMenu;
MenuPrincipal: TMenuItem;
begin
inherited Create;
MainMenu := (BorlandIDEServices as INTAServices).MainMenu;
MenuPrincipal := TMenuItem.Create(nil);
MenuPrincipal.Caption := 'E&ndsis Wizard';
MenuPrincipal.Name := 'EndsisWizard';
// Insert menu in the IDE.
MainMenu.Items.Insert(9, MenuPrincipal);
end;
function TADPCHStickerWizard.GetIDString: string;
begin
Result := 'EndSis.EndsisWizard';
Execute;
end;
function TADPCHStickerWizard.GetMenuText: string;
begin
Result := 'E&ndsis Wizard';
end;
function TADPCHStickerWizard.GetName: string;
begin
Result := 'EndSis.EndsisWizard';
end;
function TADPCHStickerWizard.GetState: TWizardState;
begin
Result := [wsEnabled];
end;
procedure InitWizard;
begin
// nothing needed
end;
procedure DoneWizard;
begin
// Remove
end;
initialization
InitWizard;
finalization
DoneWizard;
end.
--------------------
Thanks
How i create a Main Menu item in the Delphi IDE "Like GExperts do", i do
like code below, but dont work, plz look:
---------------------------------
unit ENDSISWizard;
interface
uses
ToolsAPI, Windows, SysUtils, Classes, Forms, Messages, Menus;
type
TADPCHStickerWizard = class(TNotifierObject, IOTAWizard, IOTAMenuWizard)
public
{ IOTAWizard }
function GetIDString: string;
function GetName: string;
function GetState: TWizardState;
procedure Execute;
{ IOTAMenuWizard }
function GetMenuText: string;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterPackageWizard(TADPCHStickerWizard.Create);
end;
procedure TADPCHStickerWizard.Execute;
var
i : integer;
MainMenu: TMainMenu;
MenuPrincipal: TMenuItem;
begin
inherited Create;
MainMenu := (BorlandIDEServices as INTAServices).MainMenu;
MenuPrincipal := TMenuItem.Create(nil);
MenuPrincipal.Caption := 'E&ndsis Wizard';
MenuPrincipal.Name := 'EndsisWizard';
// Insert menu in the IDE.
MainMenu.Items.Insert(9, MenuPrincipal);
end;
function TADPCHStickerWizard.GetIDString: string;
begin
Result := 'EndSis.EndsisWizard';
Execute;
end;
function TADPCHStickerWizard.GetMenuText: string;
begin
Result := 'E&ndsis Wizard';
end;
function TADPCHStickerWizard.GetName: string;
begin
Result := 'EndSis.EndsisWizard';
end;
function TADPCHStickerWizard.GetState: TWizardState;
begin
Result := [wsEnabled];
end;
procedure InitWizard;
begin
// nothing needed
end;
procedure DoneWizard;
begin
// Remove
end;
initialization
InitWizard;
finalization
DoneWizard;
end.
--------------------
Thanks