home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPW73.ZIP / TPW73.TXT < prev   
Encoding:
Text File  |  1989-07-11  |  18.5 KB  |  595 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                                     TPW73
  11.                              MULTI-LEVEL WINDOWS
  12.                           FOR BORLANDS TURBO PASCAL
  13.                                  Version 7.3
  14.                                 July 11, 1989
  15.  
  16.  
  17.                                     FILES
  18.                      In this version, TPW73.ZIP contains
  19.  
  20.                     TPW73.PAS   -  Turbo Pascal Unit source code
  21.                     TPW73.OBJ   -  Object file for TPU
  22.                     TPD73.PAS   -  Demonstration program
  23.                     TPW73.TXT   -  This document file.
  24.                     LMENUTP.TXT -  Text file used by demo program.
  25.  
  26.  
  27.                            WARRANTY AND DISCLAIMER
  28.  
  29.               The author make no warranties, expressed or implied,
  30.           as to the quality or performance of these programs.  The
  31.           author will not be held liable for any direct, indirect,
  32.           incidental or consequential damages resulting from the use
  33.           of these programs.  Your use of these programs constitute
  34.           your agreement to this disclaimer and your release of the
  35.           author from any form of liability or litigation.
  36.  
  37.  
  38.               If you are using TPW and find it of value a
  39.           contribution ($20.00) to the author is suggested.  This
  40.           will enable and encourage the further development of TPW.
  41.  
  42.  
  43.  
  44.           Rick Fothergill               BBS - (413) 499-7245
  45.           141 Oak Hill Road             300-1200-2400 baud 8-N-1
  46.           Pittsfield, MA  01201
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  63.  
  64.                                      - 1 -
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           DEFINITIONS OF CONST, TYPES AND VARIABLES USED IN THE
  74.           PROCEDURE AND FUNCTION DESCRIPTIONS:
  75.  
  76.  
  77.           ATTR    - integer value for the foreground and
  78.                     background color. See ATTR.
  79.  
  80.           BACK    - integer value representing any one of PASCAL'S
  81.                     background colors.  Valid numbers are 0 - 8.
  82.  
  83.           BATTR   - integer value representing the border color
  84.                     attribute.
  85.           
  86.           BORDER  - integer value representing the desired border
  87.                     type.  Valid selections are 0 - 16.  Additional
  88.                     border selections may be added by changing the
  89.                     CONST defined in the unit source code TPW71.PAS.
  90.  
  91.           COL     - integer value representing the screen column,
  92.                     should be in the range of 2 - 79
  93.  
  94.           COLS    - integer value representing the number of columns
  95.                     wide.
  96.           
  97.           FORE    - integer value representing any one of PASCAL's
  98.                     foreground colors.  Valid numbers are 0 - 31.
  99.  
  100.           ROW     - integer value representing the screen row,
  101.                     should be in the range of 2 - 23.
  102.  
  103.           ROWS    - integer value representing the number of rows
  104.                     long.
  105.  
  106.           SATTR   - integer value representing the shadow color
  107.                     attribute.
  108.  
  109.           SHADOW  - integer value representing the desired shadow
  110.                     type.  Valid selections are:
  111.  
  112.                       0    - No shadow         1,2  - Reattribute
  113.                       3,4  - Solid Block       5,6  - Light Hatch
  114.                       7,8  - Medium Hatch      9,10 - Heavy Hatch
  115.                            Odd - Left  Even - Right
  116.  
  117.           STRDAT  - string data.
  118.  
  119.           WATTR   - integer value representing the window color
  120.                     attribute.
  121.  
  122.           WINSPEED - word variable used to control the rate of
  123.                      zooming for those type windows
  124.  
  125.  
  126.  
  127.  
  128.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  129.  
  130.                                      - 2 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           VMENUREC - user type defined as a record:
  140.                       item:itemlist - string array of menu
  141.                                       selections
  142.                       liveitem:string[itemcount] - a string of
  143.                                       0's and 1's indicating those
  144.                                       items in a menu which are
  145.                                       active(1) or inactive(0)
  146.                       itemcount     - no. of items in menu
  147.                       startpos      - starting position for
  148.                                       selection bar
  149.                       curntpos      - current position of highlight
  150.                                       bar
  151.                       hlattr        - color attribute of highlight
  152.                                       bar
  153.                       flattr        - color attribute of the first
  154.                                       letter of each menu selection
  155.                       noattr        - color attribute of inactive
  156.                                       items in the menu
  157.                       flon          - boolean value indicating
  158.                                       whether first letter selection
  159.                                       is active
  160.                       bartype       - type of highlight bar, current
  161.                                       selections are:
  162.                                         0 - no visible bar
  163.                                         1 - full width bar
  164.                                         2 - string width bar
  165.                                         3 - pointer
  166.  
  167.           HMENUREC - user type defined as a record:
  168.                       item:itemlist - string array of menu
  169.                                       selections
  170.                       subitem:string[mi] - a string of 0's and 1's
  171.                                       corresponding to the menu
  172.                                       selections indicating whether
  173.                                       a pulldown vertical menu
  174.                                       exists for that selection
  175.                       itemcount     - no. of items in menu
  176.                       startpos      - starting position for
  177.                                       selection bar
  178.                       curntpos      - current position of highlight
  179.                                       bar
  180.                       hlattr        - color attribute of highlight
  181.                                       bar
  182.                       flattr        - color attribute of the first
  183.                                       letter of each menu selection
  184.                       flon          - boolean value indicating
  185.                                       whether first letter selection
  186.                                       is active
  187.                       menuspaces    - integer value indicating how
  188.                                       many spaces to add between
  189.                                       items in the menu
  190.                       barloc        - integer value representing the
  191.                                       row within the window you want
  192.                                       the menu to appear on.
  193.  
  194.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  195.  
  196.                                      - 3 -
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           ---------------------------------------------------------
  206.           ATTR                                            function
  207.           ---------------------------------------------------------
  208.  
  209.           Purpose:  Calculate the color attribute given the fore
  210.                     and background colors.  Returns an integer
  211.                     value.
  212.  
  213.           Syntax:  ATTR(FORE,BACK)
  214.  
  215.  
  216.           ---------------------------------------------------------
  217.           CLOSEWIN                                       procedure
  218.           ---------------------------------------------------------
  219.  
  220.           Purpose:  To remove the last window opened with OpenWin
  221.                     from the screen, restore the area under the
  222.                     window and restore the cursor position.
  223.  
  224.           Syntax:  CLOSEWIN
  225.  
  226.  
  227.           ---------------------------------------------------------
  228.           CURDISPLAY                                      function
  229.           ---------------------------------------------------------
  230.  
  231.           Purpose:  Returns a byte value representing the type of
  232.                     the active monitor.
  233.  
  234.                       0 - MONO        3 - MCGA
  235.                       1 - CGA         4 - VGA
  236.                       2 - EGA
  237.  
  238.           Syntax:  CURDISPLAY
  239.  
  240.  
  241.           ---------------------------------------------------------
  242.           CURVIDEO                                        function
  243.           ---------------------------------------------------------
  244.  
  245.           Purpose:  Returns a byte value representing the current
  246.                     video mode.
  247.  
  248.           Syntax:  CURVIDEO
  249.  
  250.  
  251.           ---------------------------------------------------------
  252.           CURSOROFF                                      procedure
  253.           ---------------------------------------------------------
  254.  
  255.           Purpose:  Turns off the cursor.
  256.  
  257.           Syntax:  CURSOROFF
  258.  
  259.  
  260.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  261.  
  262.                                      - 4 -
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ---------------------------------------------------------
  272.           CURSORON                                       procedure
  273.           ---------------------------------------------------------
  274.  
  275.           Purpose:  Turns on the cursor.
  276.  
  277.           Syntax:  CURSORON
  278.  
  279.  
  280.  
  281.           ---------------------------------------------------------
  282.           MAKEHMENU                                      procedure
  283.           ---------------------------------------------------------
  284.  
  285.           Purpose:  Presents a horizontal (123 type) menu in a
  286.           previously opened window.  Returns the position of the
  287.           highlighted bar in an integer variable called CURNTPOS
  288.           when the user makes a selection.
  289.  
  290.           Syntax:  MAKEHMENU(HMENU)
  291.  
  292.           Note:  HMENU is a record of type HMENUREC.  See the notes
  293.                  above and the demo program for a more detailed
  294.                  description of how to use this procedure.
  295.           
  296.  
  297.  
  298.           ---------------------------------------------------------
  299.           MAKEVMENU                                      procedure
  300.           ---------------------------------------------------------
  301.  
  302.           Purpose:  Presents a vertical menu in a previously opened
  303.           window.  Returns the position of the highlighted bar in an
  304.           integer variable called CURNTPOS when the user makes a
  305.           selection.
  306.  
  307.           Syntax:  MAKEVMENU(VMENU)
  308.  
  309.           Note:  VMENU is a record of type VMENUREC.  See the notes
  310.                  above and the demo program for a more detailed
  311.                  description of how to use this procedure.
  312.  
  313.  
  314.  
  315.           ---------------------------------------------------------
  316.           SCROLLWIN                                      procedure
  317.           ---------------------------------------------------------
  318.  
  319.           Purpose:  Scroll the current window either Up or Down.
  320.  
  321.           Syntax:  SCROLLWIN(DIR)
  322.  
  323.           Note:  DIR can be either 'U' for up or 'D' for down.
  324.  
  325.  
  326.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  327.  
  328.                                      - 5 -
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ---------------------------------------------------------
  338.           OPENWIN / FAKEWIN                              procedure
  339.           ---------------------------------------------------------
  340.  
  341.           Purpose:  Open a text window on the screen and stores the
  342.                     area under the window in memory.  FakeWin does
  343.                     the same except the area under the box is not
  344.                     saved and therefore can not be restored.
  345.  
  346.           Syntax:  OPENWIN(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER
  347.                               SATTR,SHADOW,ZOOM)
  348.  
  349.           Unique Variables:
  350.  
  351.             ZOOM   - A "switch" to indicate if the window should
  352.                      zoom onto the screen.
  353.                        0 - No, normal pop-up window.
  354.                        1 - Yes, zoom to size.
  355.  
  356.  
  357.           ---------------------------------------------------------
  358.           PRINTWIN                                       procedure
  359.           ---------------------------------------------------------
  360.  
  361.           Purpose:  Display text in the current window using the
  362.                     current attributes and window coordinates.
  363.  
  364.           Syntax:  PRINTWIN(ROW,COL,STRDAT)
  365.  
  366.           Note:  ROW and COL refer to positions inside the window.
  367.                  ROW 1, COL 1 refers to upper left corner of the
  368.                  window.
  369.           
  370.  
  371.  
  372.           ---------------------------------------------------------
  373.           PRINTCWIN                                      procedure
  374.           ---------------------------------------------------------
  375.  
  376.           Purpose:  Display text centered in the window on the ROW
  377.                     specified using the current attributes and
  378.                     window coordinates.
  379.  
  380.           Syntax:  PRINTCWIN(ROW,STRDAT)
  381.  
  382.           Note:  ROW refers to the row in the window.  ROW 1 refers
  383.                  to the first row inside the border.
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  393.  
  394.                                      - 6 -
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ---------------------------------------------------------
  404.           SCOLOR                                         procedure
  405.           ---------------------------------------------------------
  406.  
  407.           Purpose:  To change the color attributes of a specified
  408.                     area of the screen.
  409.  
  410.           Syntax:  SCOLOR(ROW,COL,ROWS,COLS,ATTR)
  411.  
  412.           
  413.  
  414.           ---------------------------------------------------------
  415.           SFILL                                          procedure
  416.           ---------------------------------------------------------
  417.  
  418.           Purpose:  Fills a specified area of the screen with a
  419.                     specified character and color attribute.
  420.  
  421.           Syntax:  SFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)
  422.  
  423.           Unique Variables:
  424.  
  425.             CHAR - The integer value of the character you want
  426.                    displayed.
  427.  
  428.  
  429.  
  430.           ---------------------------------------------------------
  431.           SPRINT                                         procedure
  432.           ---------------------------------------------------------
  433.  
  434.           Purpose:  Displays string data at a specified location
  435.                     with a specified color attribute.
  436.  
  437.           Syntax:  SPRINT(ROW,COL,STRDAT,ATTR)
  438.  
  439.  
  440.           
  441.           ---------------------------------------------------------
  442.           SPRINTC                                        procedure
  443.           ---------------------------------------------------------
  444.  
  445.           Purpose:  Displays string data center within specified
  446.                     columns and on a specified row with a specified
  447.                     color attribute.
  448.  
  449.           Syntax:  SPRINTC(ROW,COLL,COLR,STRDAT,ATTR)
  450.  
  451.           Unique Variables:
  452.  
  453.             COLL and COLR refer to the left and right columns
  454.             between which you want you data centered.
  455.  
  456.  
  457.  
  458.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  459.  
  460.                                      - 7 -
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           ---------------------------------------------------------
  470.           TITLEWIN                                       procedure
  471.           ---------------------------------------------------------
  472.  
  473.           Purpose:  To print a title in the border of a window using
  474.                     a specified color attribute at a specified
  475.                     location.
  476.  
  477.           Syntax:  TITLEWIN(LOC,ATTR,STRDAT)
  478.  
  479.           Unique Variables:
  480.  
  481.             LOC - Specifies the location of the title
  482.                     1 - Upper Left Corner
  483.                     2 - Upper Center
  484.                     3 - Upper Right Corner
  485.                     4 - Lower Left Corner
  486.                     5 - Lower Center
  487.                     6 - Lower Right Corner
  488.  
  489.  
  490.  
  491.           ---------------------------------------------------------
  492.           MAKELMENU                                       function
  493.           ---------------------------------------------------------
  494.  
  495.           Purpose:  Presents a vertical list within a previously
  496.                     open window.  Returns an integer value which
  497.                     indicates the selection made.  The list can be
  498.                     longer than the window with the direction keys
  499.                     controlling movement.
  500.  
  501.           Syntax:  MAKELMENU(RECARR,RECS,STARTPOS,HLATTR)
  502.  
  503.           Unique Variables:
  504.  
  505.               RECARR - A single dimension string array
  506.                        representing the list selections
  507.  
  508.               RECS - An integer value representing the total number
  509.                      of elements in the array.
  510.  
  511.               STARTPOS - An integer value representing the starting
  512.                          position within the array.
  513.  
  514.               HLATTR - An integer value representing the color
  515.                        attribute of the selection bar.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  525.  
  526.                                      - 8 -
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.                              TPW QUICK REFERENCE
  536.  
  537.  
  538.           
  539.                 OpenWin(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
  540.                               Sattr,Shadow,Zoom)
  541.           
  542.                 FakeWin(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
  543.                               Sattr,Shadow,Zoom)
  544.  
  545.                              TitleWin(Loc,Title)
  546.  
  547.                                    CloseWin
  548.  
  549.                            PrintWin(Row,Col,StrDat)
  550.  
  551.                             PrintCWin(Row,StrDat)
  552.  
  553.                                 Scrollwin(Dir)
  554.  
  555.                                Attr(Fore,Back)
  556.  
  557.                                    CursorOn
  558.  
  559.                                   CursorOff
  560.  
  561.                                   CurDisplay
  562.  
  563.                          SPrint(Row,Col,StrDat,Attr)
  564.  
  565.                   SPrintC(Row,ColLeft,ColRight,StrDat,Attr)
  566.  
  567.                       SFill(Row,Col,Rows,Cols,Char,Attr)
  568.  
  569.                         SColor(Row,Col,Rows,Cols,Attr)
  570.  
  571.                              Makevmenu(Vmenurec)
  572.  
  573.                              Makehmenu(Hmenurec)
  574.  
  575.                     Makelmenu(Recarr,Recs,Startpos,Hlattr)
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                 TPW73 Copyright (c) 1989 Richard D. Fothergill
  591.  
  592.                                      - 9 -
  593.  
  594.  
  595.