home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Demos / ToolsAPI / PackageDemo / WIZMAIN.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  1.5 KB  |  88 lines

  1. unit WizMain;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ToolsAPI, Forms, Dialogs, FrmMain, SysUtils, Graphics;
  7.  
  8. type
  9.   TMenuIOTATest = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard)
  10.   public
  11.     function GetMenuText: string;
  12.     function GetIDString: string;
  13.     function GetName: string;
  14.     function GetState: TWizardState;
  15.     procedure Execute;
  16.   end;
  17.  
  18. procedure Register;
  19.  
  20. var
  21.   PackageTest: IOTAPackageServices;
  22.   PackageForm: TForm2;
  23.  
  24. implementation
  25.  
  26. procedure Register;
  27. begin
  28.   RegisterPackageWizard(TMenuIOTATest.create as IOTAWizard);
  29. end;
  30.  
  31. procedure InitExpert;
  32. begin
  33.   PackageTest := (BorlandIDEServices as IOTAPackageServices);
  34. end;
  35.  
  36. procedure DoneExpert;
  37. begin
  38.   { stubbed out }
  39. end;
  40.  
  41. { TMenuIOTATest }
  42.  
  43. procedure TMenuIOTATest.Execute;
  44. var
  45.   i: Integer;
  46.   
  47. begin
  48.   if BorlandIDEServices <> nil then
  49.   begin
  50.    PackageForm := TForm2.create(Nil);
  51.    with PackageForm do
  52.      {Package information}
  53.      for i := 0 to PackageTest.GetPackageCount-1 do
  54.        ListBox1.Items.Add(PackageTest.GetPackageName(i));
  55.  
  56.    PackageForm.ShowModal;
  57.    PackageForm.Free;
  58.   end;
  59. end;
  60.  
  61. function TMenuIOTATest.GetIDString: string;
  62. begin
  63.   Result := 'PackageInfoMenuId';
  64. end;
  65.  
  66. function TMenuIOTATest.GetMenuText: string;
  67. begin
  68.   Result := 'Packa&ge Info';
  69. end;
  70.  
  71. function TMenuIOTATest.GetName: string;
  72. begin
  73.   Result := 'PackageInfoMenu';
  74. end;
  75.  
  76. function TMenuIOTATest.GetState: TWizardState;
  77. begin
  78.   Result := [wsEnabled];
  79. end;
  80.  
  81. initialization
  82.   InitExpert;
  83.  
  84. finalization
  85.   DoneExpert;
  86.  
  87. end.
  88.