home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / textwndw.swg / 0007_WINDOWS4.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  1.1 KB  |  57 lines

  1. { SALIM SAMAHA }
  2.  
  3. Unit Windows;
  4.  
  5. Interface
  6.  
  7. Uses
  8.   Crt;
  9.  
  10. Const
  11.   Max = 3;
  12.  
  13. Type
  14.   ScreenImage = Array [0..1999] of Word;
  15.   FrameRec    = Record
  16.     Upperleft    : Word;
  17.     LowerRight   : Word;
  18.     ScreenMemory : ScreenImage;
  19.   end;
  20.  
  21. Var
  22.   SnapShot   : ^ScreenImage;
  23.   FrameStore : Array [1..10] of ^FrameRec;
  24.   WindowNum  : Byte;
  25.  
  26. Procedure OpenWindow(UpLeftX, UpLeftY, LoRightX, LoRightY : Byte);
  27. Procedure CloseWindow;
  28.  
  29. Implementation
  30.  
  31. Procedure OpenWindow(UpLeftX, UpLeftY, LoRightX, LoRightY : Byte);
  32. begin
  33.   SnapShot := Ptr( $B800, $0000);
  34.   Inc(WindowNum);
  35.   New(FrameStore[WindowNum]);
  36.   With Framestore[WindowNum]^ do
  37.   begin
  38.     ScreenMemory := SnapShot^;
  39.     UpperLeft    := WindMin;
  40.     LowerRight   := WindMax;
  41.   end;
  42.   Window(UpLeftX, UpLeftY, LoRightX, LoRightY);
  43. end;
  44.  
  45. Procedure CloseWindow;
  46. begin
  47.   With Framestore[WindowNum]^ do
  48.   begin
  49.     Snapshot^ := ScreenMemory;
  50.     Window ((Lo(UpperLeft) + 1), (Hi(UpperLeft) + 1),
  51.             (Lo(LowerRight) + 1), (Hi(LowerRight) + 1));
  52.   end;
  53.   Dispose(Framestore[WindowNum]);
  54.   Dec(WindowNum);
  55. end;
  56.  
  57.