home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { MiTeC System Information Component }
- { version 7.6 for Delphi 5,6 }
- { }
- { Copyright ⌐ 1997,2002 Michal Mutl }
- { }
- {*******************************************************}
-
- {$INCLUDE MITEC_DEF.INC}
-
- unit MSystemInfo;
-
- interface
-
- uses
- MSI_Console,
- MSI_GUI,
- MSI_CPUUsage,
-
- MiTeC_AccountsNT,
- MiTeC_AdvAPI,
- MiTeC_Enums9x,
- MiTeC_EnumsNT,
- MiTeC_EventLogNT,
- MiTeC_JobsNT,
- MiTeC_NetAPI32,
- MiTeC_PerfLib9x,
- MiTeC_PerfLibNT,
- MiTeC_PsAPI,
- MiTeC_ServerNT,
- MiTeC_Shares,
- MiTeC_SvrAPI,
- MiTeC_ToolHelp32,
- MiTeC_WkstaNT,
- MiTeC_WnASPI32,
- MiTeC_IpHlpAPI,
-
- MiTeC_Params,
- MiTeC_Routines,
- MiTeC_Datetime,
- MiTeC_StrUtils,
- MiTeC_Dialogs,
- MiTeC_CtrlRtns,
-
- Classes,
- {$IFDEF D6PLUS}
- DesignIntf, DesignEditors
- {$ELSE}
- DsgnIntf
- {$ENDIF}
- ;
-
- type
- TMSI_PropertyEditor = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure Edit; override;
- end;
-
- TMSI_ComponentEditor = class(TComponentEditor)
- public
- function GetVerbCount: Integer; override;
- function GetVerb(Index: Integer): String; override;
- procedure ExecuteVerb(Index: Integer); override;
- procedure Edit; override;
- end;
-
- procedure Register;
-
- implementation
-
- uses Forms;
-
- procedure Register;
- begin
- RegisterComponents('MiTeC',[TMCPUUsage]);
- RegisterComponents('MiTeC',[TMSystemInfo]);
- RegisterPropertyEditor(TypeInfo(string),TMSystemInfo,'About',TMSI_PropertyEditor);
- RegisterComponentEditor(TMSystemInfo,TMSI_ComponentEditor);
- end;
-
- { TMSI_ComponentEditor }
-
- procedure TMSI_ComponentEditor.Edit;
- begin
- TMSystemInfo(Self.Component).ShowModalOverviewWithAbout;
- end;
-
- procedure TMSI_ComponentEditor.ExecuteVerb(Index: Integer);
- begin
- if Index=0 then
- Edit;
- end;
-
- function TMSI_ComponentEditor.GetVerb(Index: Integer): String;
- begin
- if Index=0 then
- Result:='System Overview...'
- else
- Result:=inherited GetVerb(Index-1);
- end;
-
- function TMSI_ComponentEditor.GetVerbCount: Integer;
- begin
- Result:=inherited GetVerbCount+1;
- end;
-
- { TMSI_PropertyEditor }
-
- procedure TMSI_PropertyEditor.Edit;
- begin
- TMSystemInfo(Self.GetComponent(0)).ShowModalOverviewWithAbout;
- end;
-
- function TMSI_PropertyEditor.GetAttributes: TPropertyAttributes;
- begin
- Result:=[paDialog, paReadOnly];
- end;
-
- end.
-
-