home *** CD-ROM | disk | FTP | other *** search
/ Best of German Only 1 / romside_best_of_german_only_1.iso / wissen / dos / wgraph / entpack.exe / WGBSP!.EXE / GINFO.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-12  |  2KB  |  78 lines

  1. {$A+,B-,D-,E-,F+,I-,L-,N-,O+,R-,S-,V-}
  2. UNIT GInfo;
  3.  
  4. INTERFACE
  5.  
  6. USES GDecl,
  7.      GViews,
  8.      GDlg,
  9.      GDrivers,
  10.      Graph;
  11.  
  12.  
  13. type PMemoryInfo=^TMemoryInfo;
  14.      TMemoryInfo=object(TWindow)
  15.        procedure SetPalette; virtual;
  16.        procedure InitBackground; virtual;
  17.      end;
  18.  
  19.      PMemoryInfoBgrd=^TMemoryInfoBgrd;
  20.      TMemoryInfoBgrd=object(TBackground)
  21.        procedure Draw;virtual;
  22.      end;
  23.  
  24. IMPLEMENTATION
  25.  
  26.  
  27. {Implementation TMemoryInfo}
  28.  
  29. procedure TMemoryInfo.SetPalette;
  30. begin
  31.   Palette:=Pal[palGreen];
  32. end;
  33.  
  34. procedure TMemoryInfo.InitBackground;
  35. var R:TRect;
  36. begin
  37.   R:=Frame^.Area;
  38.   Bgrd:=new(PMemoryInfoBgrd, Init(R));
  39.   List^.InsertItem(Bgrd);
  40. end;
  41.  
  42. {Implementation TMemoryInfoBgrd}
  43.  
  44. procedure TMemoryInfoBgrd.Draw;
  45. var z:string;
  46.     EMS:PEMS;
  47.     HD:PHardDisk;
  48. begin
  49.   with Border do
  50.    begin
  51.      SetFillStyle(SolidFill,GetPalColor(7));
  52.      Bar(A.x,A.y,B.x,B.y);
  53.      str(MemAvail:8,z);
  54.      SetColor(Red);
  55.      OutTextXY(A.x+10,A.y+25,'Hauptspeicher');
  56.      OutTextXY(A.x+10,A.y+100,'Expanded Memory');
  57.      OutTextXY(A.x+10,A.y+160,'Festplatte C');
  58.      SetColor(Blue);
  59.      OutTextXY(A.x+10,A.y+45,'Freier RAM (Heap)           : '+z+' Byte');
  60.      str(MaxAvail:8,z);
  61.      OutTextXY(A.x+10,A.y+65,'Größter zusammenhängender');
  62.      OutTextXY(A.x+10,A.y+75,'freier Speicherblock        : '+z+' Byte');
  63.      EMS:=new(PEMS, Init(Border));
  64.      str(EMS^.FreeMemory:8,z);
  65.      OutTextXY(A.x+10,A.y+120,'verfügbarer Speicher        : '+z+' Byte');
  66.      str(EMS^.FreeMemory div 16384:8,z);
  67.      OutTextXY(A.x+10,A.y+140,'verfügbare Seiten           : '+z+' Seiten');
  68.      dispose(EMS, Done);
  69.      HD:=new(PHardDisk, Init(Border));
  70.      str(HD^.FreeMemory:8,z);
  71.      OutTextXY(A.x+10,A.y+180,'verfügbare Plattenkapazität : '+z+' Byte');
  72.      dispose(HD, Done);
  73.    end;
  74. end;
  75.  
  76.  
  77.  
  78. END.