home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnat / examples / windows.ads < prev   
Text File  |  2000-07-19  |  2KB  |  67 lines

  1. --::::::::::
  2. --windows.ads
  3. --::::::::::
  4. with Screen;
  5. package Windows is
  6.  
  7.   -- manager for simple, nonoverlapping screen windows
  8.   -- Michael Feldman, The George Washington University
  9.   -- July, 1995
  10.  
  11.   type Window is private;
  12.  
  13.   function Open (UpperLeft: Screen.Position;
  14.                  Height   : Screen.Height;
  15.                  Width    : Screen.Width) return Window;
  16.   -- Pre:  W, Height, and Width are defined
  17.   -- Post: returns a Window with the given upper-left corner,
  18.   --   height, and width
  19.  
  20.   procedure Title (W     : in out Window;
  21.                    Name  : in String;
  22.                    Under : in Character);
  23.   -- Pre:  W, Name, and Under are defined
  24.   -- Post: Name is displayed at the top of the window W, underlined
  25.   -- with the character Under. 
  26.  
  27.   procedure Borders (W                    : in out Window;
  28.                      Corner, Down, Across : in Character);
  29.   -- Pre:  All parameters are defined
  30.   -- Post: Draw border around current writable area in window with 
  31.   -- characters specified.  Call this BEFORE Title.  
  32.  
  33.   procedure MoveCursor (W : in out Window;
  34.                         P : in Screen.Position);
  35.   -- Pre:  W and P are defined, and P lies within the area of W
  36.   -- Post: Cursor is moved to the specified position.
  37.   --   Coordinates are relative to the
  38.   --   upper left corner of W, which is (1, 1) 
  39.  
  40.   procedure Put (W  : in out Window;
  41.                  Ch : in Character);
  42.   -- Pre:  W and Ch are defined.
  43.   -- Post: Ch is displayed in the window at 
  44.   --   the next available position.
  45.   --   If end of column, go to the next row.
  46.   --   If end of window, go to the top of the window. 
  47.  
  48.   procedure Put (W : in out Window;
  49.                  S : in String);
  50.   -- Pre:  W and S are defined
  51.   -- Post: S is displayed in the window, "line-wrapped" if necessary
  52.  
  53.   procedure New_Line (W : in out Window);
  54.   -- Pre:  W is defined
  55.   -- Post: Cursor moves to beginning of next line of W;
  56.   --   line is not blanked until next character is written  
  57.  
  58. private
  59.   type Window is record
  60.     First  : Screen.Position; -- coordinates of upper left
  61.     Last   : Screen.Position; -- coordinates of lower right
  62.     Current: Screen.Position; -- current cursor position
  63.   end record;
  64.  
  65. end Windows;
  66.  
  67.