home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / Demos / GUI / DeviceProps.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-28  |  1.3 KB  |  63 lines

  1. unit DeviceProps;
  2.  
  3. interface
  4.  
  5. uses 
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, MSI_Devices, StdCtrls, ExtCtrls;
  8.  
  9. type
  10.   TpropDevice = class(TFrame)
  11.     pc: TPageControl;
  12.     tsGeneral: TTabSheet;
  13.     Image1: TImage;
  14.     Bevel3: TBevel;
  15.     lMfg: TLabel;
  16.     lType: TLabel;
  17.     lLocation: TLabel;
  18.     stName: TEdit;
  19.     stMfg: TStaticText;
  20.     stType: TStaticText;
  21.     stLocation: TStaticText;
  22.     Bevel1: TBevel;
  23.     Label1: TLabel;
  24.     Label2: TLabel;
  25.     Label3: TLabel;
  26.     stDriverDate: TStaticText;
  27.     stDriverProv: TStaticText;
  28.     stDriverVer: TStaticText;
  29.   private
  30.     FDevice: TObject;
  31.   public
  32.     property Device: TObject read FDevice write FDevice;
  33.     procedure Refresh;
  34.   end;
  35.  
  36. implementation
  37.  
  38. {$R *.DFM}
  39.  
  40. { TpropDevice }
  41.  
  42. procedure TpropDevice.Refresh;
  43. begin
  44.   pc.ActivePage:=tsGeneral;
  45.   with PDevice(Device)^ do begin
  46.     if Trim(FriendlyName)='' then
  47.       stName.Text:=Description
  48.     else
  49.       stName.Text:=FriendlyName;
  50.     if Trim(ClassDesc)='' then
  51.       stType.Caption:=ClassName
  52.     else
  53.       stType.Caption:=ClassDesc;
  54.     stMfg.Caption:=Manufacturer;
  55.     stLocation.caption:=Location;
  56.     stDriverprov.Caption:=Driverprovider;
  57.     stDriverdate.Caption:=Driverdate;
  58.     stDriverVer.Caption:=DriverVersion;
  59.   end;
  60. end;
  61.  
  62. end.
  63.