home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / INTEXPT.PAS < prev    next >
Pascal/Delphi Source File  |  1997-01-16  |  2KB  |  105 lines

  1. unit intexpt;
  2. interface
  3.  
  4. uses
  5.  sharemem, SysUtils, VirtIntf, ExptIntf, ToolIntf,Windows,Dialogs;
  6. procedure HandleException;
  7.  
  8. type
  9.   TClasspert = class(TIExpert)
  10.     function GetName: string; override;
  11.     function GetStyle: TExpertStyle; override;
  12.     function GetState: TExpertState; override;
  13.     function GetIDString: string; override;
  14.     function GetMenuText: string; override;
  15.     function GetAuthor: string; override;
  16.     function GetComment: string;override;
  17.     function GetPage: string; override;
  18.     function GetGlyph: HICON;override;
  19.     procedure Execute; override;
  20.   end;
  21.  
  22. implementation
  23.  
  24. uses Forms, Controls,clssdlph;
  25.  
  26.  
  27. procedure HandleException;
  28. { Raise exception within the context of the IDE }
  29. begin
  30.   ToolServices.RaiseException(ReleaseException);
  31. end;
  32.  
  33. function TClasspert.GetGlyph: HICON;
  34. begin
  35.   // needs to be overridden
  36. end;
  37.  
  38. function TClasspert.GetPage: string;
  39. begin
  40.   // needs to be overridden
  41. end;
  42.  
  43. function TClasspert.GetComment: string;
  44. begin
  45.   // needs to be overridden
  46. end;
  47.  
  48. function TClasspert.GetAuthor: string;
  49. begin
  50.   // needs to be overridden
  51. end;
  52.  
  53.  
  54. function TClasspert.GetName: string;
  55. { Return name of expert }
  56. begin
  57.   Result := 'Classpert';
  58. end;
  59.  
  60. function TClasspert.GetStyle: TExpertStyle;
  61. { Return the style of the expert.  This one is standard. }
  62. begin
  63.   Result := esStandard;
  64. end;
  65.  
  66. function TClasspert.GetState: TExpertState;
  67. { This expert is always enabled on the menu }
  68. begin
  69.   Result := [esEnabled];
  70. end;
  71.  
  72. function TClasspert.GetIDString: String;
  73. { Return the unique Vendor.Product name of expert }
  74. begin
  75.   Result := 'Borland.VCL Class Viewer';
  76. end;
  77.  
  78. function TClasspert.GetMenuText: string;
  79. { Return text for Help menu }
  80. begin
  81.   Result := 'VCL Class Viewer';
  82. end;
  83.  
  84. procedure TClasspert.Execute;
  85. { Called when expert name is selected from Help menu of IDE. }
  86. { This function invokes the expert }
  87. begin
  88.   try
  89.     if not Assigned(MainDlg) then begin         // if not created...
  90.       MainDlg := TMainDlg.Create(Application); // create it
  91.       MainDlg.Show;                            // show it
  92.     end
  93.     else with MainDlg do begin                  // if created...
  94.       if WindowState = wsMinimized then
  95.         WindowState := wsNormal;                 // restore window
  96.       SetFocus;                                  // show it
  97.     end;
  98.   except
  99.     HandleException;
  100.   end;
  101.   end;
  102. end.
  103.  
  104.  
  105.