home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / D5 / MSystemInfo.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2002-04-05  |  2.6 KB  |  124 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       MiTeC System Information Component              }
  5. {           version 7.6 for Delphi 5,6                  }
  6. {                                                       }
  7. {       Copyright ⌐ 1997,2002 Michal Mutl               }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. {$INCLUDE MITEC_DEF.INC}
  12.  
  13. unit MSystemInfo;
  14.  
  15. interface
  16.  
  17. uses
  18.   MSI_Console,
  19.   MSI_GUI,
  20.   MSI_CPUUsage,
  21.  
  22.   MiTeC_AccountsNT,
  23.   MiTeC_AdvAPI,
  24.   MiTeC_Enums9x,
  25.   MiTeC_EnumsNT,
  26.   MiTeC_EventLogNT,
  27.   MiTeC_JobsNT,
  28.   MiTeC_NetAPI32,
  29.   MiTeC_PerfLib9x,
  30.   MiTeC_PerfLibNT,
  31.   MiTeC_PsAPI,
  32.   MiTeC_ServerNT,
  33.   MiTeC_Shares,
  34.   MiTeC_SvrAPI,
  35.   MiTeC_ToolHelp32,
  36.   MiTeC_WkstaNT,
  37.   MiTeC_WnASPI32,
  38.   MiTeC_IpHlpAPI,
  39.  
  40.   MiTeC_Params,
  41.   MiTeC_Routines,
  42.   MiTeC_Datetime,
  43.   MiTeC_StrUtils,
  44.   MiTeC_Dialogs,
  45.   MiTeC_CtrlRtns,
  46.  
  47.   Classes,
  48.   {$IFDEF D6PLUS}
  49.   DesignIntf, DesignEditors
  50.   {$ELSE}
  51.   DsgnIntf
  52.   {$ENDIF}
  53.   ;
  54.  
  55. type
  56.   TMSI_PropertyEditor = class(TStringProperty)
  57.   public
  58.     function GetAttributes: TPropertyAttributes; override;
  59.     procedure Edit; override;
  60.   end;
  61.  
  62.   TMSI_ComponentEditor = class(TComponentEditor)
  63.   public
  64.     function GetVerbCount: Integer; override;
  65.     function GetVerb(Index: Integer): String; override;
  66.     procedure ExecuteVerb(Index: Integer); override;
  67.     procedure Edit; override;
  68.   end;
  69.  
  70. procedure Register;
  71.  
  72. implementation
  73.  
  74. uses Forms;
  75.  
  76. procedure Register;
  77. begin
  78.   RegisterComponents('MiTeC',[TMCPUUsage]);
  79.   RegisterComponents('MiTeC',[TMSystemInfo]);
  80.   RegisterPropertyEditor(TypeInfo(string),TMSystemInfo,'About',TMSI_PropertyEditor);
  81.   RegisterComponentEditor(TMSystemInfo,TMSI_ComponentEditor);
  82. end;
  83.  
  84. { TMSI_ComponentEditor }
  85.  
  86. procedure TMSI_ComponentEditor.Edit;
  87. begin
  88.   TMSystemInfo(Self.Component).ShowModalOverviewWithAbout;
  89. end;
  90.  
  91. procedure TMSI_ComponentEditor.ExecuteVerb(Index: Integer);
  92. begin
  93.   if Index=0 then
  94.     Edit;
  95. end;
  96.  
  97. function TMSI_ComponentEditor.GetVerb(Index: Integer): String;
  98. begin
  99.   if Index=0 then
  100.     Result:='System Overview...'
  101.   else
  102.     Result:=inherited GetVerb(Index-1);
  103. end;
  104.  
  105. function TMSI_ComponentEditor.GetVerbCount: Integer;
  106. begin
  107.   Result:=inherited GetVerbCount+1;
  108. end;
  109.  
  110. { TMSI_PropertyEditor }
  111.  
  112. procedure TMSI_PropertyEditor.Edit;
  113. begin
  114.   TMSystemInfo(Self.GetComponent(0)).ShowModalOverviewWithAbout;
  115. end;
  116.  
  117. function TMSI_PropertyEditor.GetAttributes: TPropertyAttributes;
  118. begin
  119.   Result:=[paDialog, paReadOnly];
  120. end;
  121.  
  122. end.
  123.  
  124.