home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / APIEXAM / PHIL / WINDOWS.ADS < prev   
Text File  |  1996-06-03  |  2KB  |  64 lines

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