








                                    TPW73
                             MULTI-LEVEL WINDOWS
                          FOR BORLANDS TURBO PASCAL
                                 Version 7.3
                                July 11, 1989


                                    FILES
                     In this version, TPW73.ZIP contains

                    TPW73.PAS   -  Turbo Pascal Unit source code
                    TPW73.OBJ   -  Object file for TPU
                    TPD73.PAS   -  Demonstration program
                    TPW73.TXT   -  This document file.
                    LMENUTP.TXT -  Text file used by demo program.


                           WARRANTY AND DISCLAIMER

              The author make no warranties, expressed or implied,
          as to the quality or performance of these programs.  The
          author will not be held liable for any direct, indirect,
          incidental or consequential damages resulting from the use
          of these programs.  Your use of these programs constitute
          your agreement to this disclaimer and your release of the
          author from any form of liability or litigation.


              If you are using TPW and find it of value a
          contribution ($20.00) to the author is suggested.  This
          will enable and encourage the further development of TPW.



          Rick Fothergill               BBS - (413) 499-7245
          141 Oak Hill Road             300-1200-2400 baud 8-N-1
          Pittsfield, MA  01201















                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 1 -








          DEFINITIONS OF CONST, TYPES AND VARIABLES USED IN THE
          PROCEDURE AND FUNCTION DESCRIPTIONS:


          ATTR    - integer value for the foreground and
                    background color. See ATTR.

          BACK    - integer value representing any one of PASCAL'S
                    background colors.  Valid numbers are 0 - 8.

          BATTR   - integer value representing the border color
                    attribute.
          
          BORDER  - integer value representing the desired border
                    type.  Valid selections are 0 - 16.  Additional
                    border selections may be added by changing the
                    CONST defined in the unit source code TPW71.PAS.

          COL     - integer value representing the screen column,
                    should be in the range of 2 - 79

          COLS    - integer value representing the number of columns
                    wide.
          
          FORE    - integer value representing any one of PASCAL's
                    foreground colors.  Valid numbers are 0 - 31.

          ROW     - integer value representing the screen row,
                    should be in the range of 2 - 23.

          ROWS    - integer value representing the number of rows
                    long.

          SATTR   - integer value representing the shadow color
                    attribute.

          SHADOW  - integer value representing the desired shadow
                    type.  Valid selections are:

                      0    - No shadow         1,2  - Reattribute
                      3,4  - Solid Block       5,6  - Light Hatch
                      7,8  - Medium Hatch      9,10 - Heavy Hatch
                           Odd - Left  Even - Right

          STRDAT  - string data.

          WATTR   - integer value representing the window color
                    attribute.

          WINSPEED - word variable used to control the rate of
                     zooming for those type windows




                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 2 -








          VMENUREC - user type defined as a record:
                      item:itemlist - string array of menu
                                      selections
                      liveitem:string[itemcount] - a string of
                                      0's and 1's indicating those
                                      items in a menu which are
                                      active(1) or inactive(0)
                      itemcount     - no. of items in menu
                      startpos      - starting position for
                                      selection bar
                      curntpos      - current position of highlight
                                      bar
                      hlattr        - color attribute of highlight
                                      bar
                      flattr        - color attribute of the first
                                      letter of each menu selection
                      noattr        - color attribute of inactive
                                      items in the menu
                      flon          - boolean value indicating
                                      whether first letter selection
                                      is active
                      bartype       - type of highlight bar, current
                                      selections are:
                                        0 - no visible bar
                                        1 - full width bar
                                        2 - string width bar
                                        3 - pointer

          HMENUREC - user type defined as a record:
                      item:itemlist - string array of menu
                                      selections
                      subitem:string[mi] - a string of 0's and 1's
                                      corresponding to the menu
                                      selections indicating whether
                                      a pulldown vertical menu
                                      exists for that selection
                      itemcount     - no. of items in menu
                      startpos      - starting position for
                                      selection bar
                      curntpos      - current position of highlight
                                      bar
                      hlattr        - color attribute of highlight
                                      bar
                      flattr        - color attribute of the first
                                      letter of each menu selection
                      flon          - boolean value indicating
                                      whether first letter selection
                                      is active
                      menuspaces    - integer value indicating how
                                      many spaces to add between
                                      items in the menu
                      barloc        - integer value representing the
                                      row within the window you want
                                      the menu to appear on.

                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 3 -








          ---------------------------------------------------------
          ATTR                                            function
          ---------------------------------------------------------

          Purpose:  Calculate the color attribute given the fore
                    and background colors.  Returns an integer
                    value.

          Syntax:  ATTR(FORE,BACK)


          ---------------------------------------------------------
          CLOSEWIN                                       procedure
          ---------------------------------------------------------

          Purpose:  To remove the last window opened with OpenWin
                    from the screen, restore the area under the
                    window and restore the cursor position.

          Syntax:  CLOSEWIN


          ---------------------------------------------------------
          CURDISPLAY                                      function
          ---------------------------------------------------------

          Purpose:  Returns a byte value representing the type of
                    the active monitor.

                      0 - MONO        3 - MCGA
                      1 - CGA         4 - VGA
                      2 - EGA

          Syntax:  CURDISPLAY


          ---------------------------------------------------------
          CURVIDEO                                        function
          ---------------------------------------------------------

          Purpose:  Returns a byte value representing the current
                    video mode.

          Syntax:  CURVIDEO


          ---------------------------------------------------------
          CURSOROFF                                      procedure
          ---------------------------------------------------------

          Purpose:  Turns off the cursor.

          Syntax:  CURSOROFF


                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 4 -








          ---------------------------------------------------------
          CURSORON                                       procedure
          ---------------------------------------------------------

          Purpose:  Turns on the cursor.

          Syntax:  CURSORON



          ---------------------------------------------------------
          MAKEHMENU                                      procedure
          ---------------------------------------------------------

          Purpose:  Presents a horizontal (123 type) menu in a
          previously opened window.  Returns the position of the
          highlighted bar in an integer variable called CURNTPOS
          when the user makes a selection.

          Syntax:  MAKEHMENU(HMENU)

          Note:  HMENU is a record of type HMENUREC.  See the notes
                 above and the demo program for a more detailed
                 description of how to use this procedure.
          


          ---------------------------------------------------------
          MAKEVMENU                                      procedure
          ---------------------------------------------------------

          Purpose:  Presents a vertical menu in a previously opened
          window.  Returns the position of the highlighted bar in an
          integer variable called CURNTPOS when the user makes a
          selection.

          Syntax:  MAKEVMENU(VMENU)

          Note:  VMENU is a record of type VMENUREC.  See the notes
                 above and the demo program for a more detailed
                 description of how to use this procedure.



          ---------------------------------------------------------
          SCROLLWIN                                      procedure
          ---------------------------------------------------------

          Purpose:  Scroll the current window either Up or Down.

          Syntax:  SCROLLWIN(DIR)

          Note:  DIR can be either 'U' for up or 'D' for down.


                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 5 -








          ---------------------------------------------------------
          OPENWIN / FAKEWIN                              procedure
          ---------------------------------------------------------

          Purpose:  Open a text window on the screen and stores the
                    area under the window in memory.  FakeWin does
                    the same except the area under the box is not
                    saved and therefore can not be restored.

          Syntax:  OPENWIN(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER
                              SATTR,SHADOW,ZOOM)

          Unique Variables:

            ZOOM   - A "switch" to indicate if the window should
                     zoom onto the screen.
                       0 - No, normal pop-up window.
                       1 - Yes, zoom to size.


          ---------------------------------------------------------
          PRINTWIN                                       procedure
          ---------------------------------------------------------

          Purpose:  Display text in the current window using the
                    current attributes and window coordinates.

          Syntax:  PRINTWIN(ROW,COL,STRDAT)

          Note:  ROW and COL refer to positions inside the window.
                 ROW 1, COL 1 refers to upper left corner of the
                 window.
          


          ---------------------------------------------------------
          PRINTCWIN                                      procedure
          ---------------------------------------------------------

          Purpose:  Display text centered in the window on the ROW
                    specified using the current attributes and
                    window coordinates.

          Syntax:  PRINTCWIN(ROW,STRDAT)

          Note:  ROW refers to the row in the window.  ROW 1 refers
                 to the first row inside the border.








                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 6 -








          ---------------------------------------------------------
          SCOLOR                                         procedure
          ---------------------------------------------------------

          Purpose:  To change the color attributes of a specified
                    area of the screen.

          Syntax:  SCOLOR(ROW,COL,ROWS,COLS,ATTR)

          

          ---------------------------------------------------------
          SFILL                                          procedure
          ---------------------------------------------------------

          Purpose:  Fills a specified area of the screen with a
                    specified character and color attribute.

          Syntax:  SFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)

          Unique Variables:

            CHAR - The integer value of the character you want
                   displayed.



          ---------------------------------------------------------
          SPRINT                                         procedure
          ---------------------------------------------------------

          Purpose:  Displays string data at a specified location
                    with a specified color attribute.

          Syntax:  SPRINT(ROW,COL,STRDAT,ATTR)


          
          ---------------------------------------------------------
          SPRINTC                                        procedure
          ---------------------------------------------------------

          Purpose:  Displays string data center within specified
                    columns and on a specified row with a specified
                    color attribute.

          Syntax:  SPRINTC(ROW,COLL,COLR,STRDAT,ATTR)

          Unique Variables:

            COLL and COLR refer to the left and right columns
            between which you want you data centered.



                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 7 -








          ---------------------------------------------------------
          TITLEWIN                                       procedure
          ---------------------------------------------------------

          Purpose:  To print a title in the border of a window using
                    a specified color attribute at a specified
                    location.

          Syntax:  TITLEWIN(LOC,ATTR,STRDAT)

          Unique Variables:

            LOC - Specifies the location of the title
                    1 - Upper Left Corner
                    2 - Upper Center
                    3 - Upper Right Corner
                    4 - Lower Left Corner
                    5 - Lower Center
                    6 - Lower Right Corner



          ---------------------------------------------------------
          MAKELMENU                                       function
          ---------------------------------------------------------

          Purpose:  Presents a vertical list within a previously
                    open window.  Returns an integer value which
                    indicates the selection made.  The list can be
                    longer than the window with the direction keys
                    controlling movement.

          Syntax:  MAKELMENU(RECARR,RECS,STARTPOS,HLATTR)

          Unique Variables:

              RECARR - A single dimension string array
                       representing the list selections

              RECS - An integer value representing the total number
                     of elements in the array.

              STARTPOS - An integer value representing the starting
                         position within the array.

              HLATTR - An integer value representing the color
                       attribute of the selection bar.








                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 8 -








                             TPW QUICK REFERENCE


          
                OpenWin(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
                              Sattr,Shadow,Zoom)
          
                FakeWin(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
                              Sattr,Shadow,Zoom)

                             TitleWin(Loc,Title)

                                   CloseWin

                           PrintWin(Row,Col,StrDat)

                            PrintCWin(Row,StrDat)

                                Scrollwin(Dir)

                               Attr(Fore,Back)

                                   CursorOn

                                  CursorOff

                                  CurDisplay

                         SPrint(Row,Col,StrDat,Attr)

                  SPrintC(Row,ColLeft,ColRight,StrDat,Attr)

                      SFill(Row,Col,Rows,Cols,Char,Attr)

                        SColor(Row,Col,Rows,Cols,Attr)

                             Makevmenu(Vmenurec)

                             Makehmenu(Hmenurec)

                    Makelmenu(Recarr,Recs,Startpos,Hlattr)














                TPW73 Copyright (c) 1989 Richard D. Fothergill

                                     - 9 -


