home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPW60.ZIP / TPW60.TXT < prev   
Encoding:
Text File  |  1988-04-28  |  17.6 KB  |  595 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                                                    March 15, 1988
  14.  
  15.  
  16.  
  17.                                     TPW60
  18.                              MULTI-LEVEL WINDOWS
  19.                           FOR BORLANDS TURBO PASCAL
  20.                                  Version 6.0
  21.  
  22.  
  23.                                     FILES
  24.                      In this version, TPW60.ARC contains
  25.  
  26.                     TPW60.TPU  -  Turbo Pascal window unit
  27.                     TPW60.PAS  -  Source for TPW60.TPU
  28.                     TPW60.OBJ  -  Object for TPW60.TPU
  29.                     TPD60.PAS  -  Demonstration program
  30.                     TPW60.TXT  -  This document file.
  31.  
  32.  
  33.  
  34.  
  35.                                 USING TPWINDO
  36.  
  37.               You can either leave the TPW60.TPU unit file as a
  38.           stand-alone unit or put it in the TURBO.TPL library with
  39.           the TPMOVER program.  Include TPW60 in your uses
  40.           statement.
  41.  
  42.               If you are using TPWINDOs and find it of value a
  43.           contribution ($20.00) to the author is suggested.  This
  44.           will enable and encourage the further development of
  45.           TPWINDOs.
  46.  
  47.                            WARRANTY AND DISCLAIMER
  48.  
  49.               The author make no warranties, expressed or implied,
  50.           as to the quality or performance of this program.  The
  51.           author will not be held liable for any direct, indirect,
  52.           incidental or consequential damages resulting from the use
  53.           of this program.  Your use of the program constitutes your
  54.           agreement to this disclaimer and your release of the
  55.           author from any form of liability or litigation.
  56.  
  57.           Rick Fothergill         BBS - (413) 499-7245
  58.           141 Oak Hill Road             300-1200-2400 baud 8-N-1
  59.           Pittsfield, MA  01201         8am - 4pm Eastern
  60.  
  61.  
  62.                 TPW60 Copyright (c) 1988 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:
  88.  
  89.                       1 - single line
  90.                       2 - double line
  91.                       3 - single horizontal, double vertical
  92.                       4 - double horizontal, single vertical
  93.                       5 - solid
  94.                       6 - light hatch
  95.                       7 - medium hatch
  96.                       8 - heavy hatch
  97.           
  98.           COL     - integer value representing the screen column,
  99.                     should be in the range of 2 - 79
  100.  
  101.           COLS    - integer value representing the number of columns
  102.                     wide.
  103.           
  104.           FORE    - integer value representing any one of PASCAL's
  105.                     foreground colors.  Valid numbers are 0 - 31.
  106.  
  107.           HIDECURSOR - constant value used by cursorchange to hide
  108.                        the cursor.
  109.  
  110.           ITEMLIST- an array of string data representing menu
  111.                     selections.
  112.  
  113.           MENUREC - user type defined as a record:
  114.  
  115.                       item:itemlist - string array of menu
  116.                                       selections
  117.                       itemcount     - no. of items in menu
  118.                       startpos      - starting position for
  119.                                       selection bar
  120.                       curntpos      - current position of highlight
  121.                                       bar
  122.                       hlattr        - color attribute of highlight
  123.                                       bar
  124.                       flattr        - color attribute of the first
  125.                                       letter of each menu selection
  126.                       flon          - boolean value indicating
  127.  
  128.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  129.           
  130.                                     - 2 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                       whether first letter selection
  140.                                       is active
  141.                       bartype       - type of highlight bar, current
  142.                                       selections are:
  143.                                         0 - no visible bar
  144.                                         1 - full width bar
  145.                                         2 - string width bar
  146.                                         3 - pointer
  147.  
  148.           MAXITEM - constant value representing the maximum items
  149.                     in a menu.
  150.  
  151.           MW      - constant value representing the maximum windows
  152.                     you will have open.
  153.  
  154.           OLDCURSOR - integer value used to store the old cursor
  155.                       shape.
  156.  
  157.           ROW     - integer value representing the screen row,
  158.                     should be in the range of 2 - 23.
  159.  
  160.           ROWS    - integer value representing the number of rows
  161.                     long.
  162.  
  163.           SATTR   - integer value representing the shadow color
  164.                     attribute.
  165.  
  166.           SHADOW  - integer value representing the desired shadow
  167.                     type.  Valid selections are:
  168.  
  169.                       0    - No shadow
  170.                       1,2  - Reattribute shadow, does not destroy
  171.                       3,4  - Solid Block
  172.                       5,6  - Light Hatch
  173.                       7,8  - Medium Hatch
  174.                       9,10 - Heavy Hatch
  175.                     Odd - Left  Even - Right
  176.  
  177.           STRDAT  - string data.
  178.  
  179.           WATTR   - integer value representing the window color
  180.                     attribute.
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                 TPW60 Copyright (c) 1988 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.  
  218.  
  219.           
  220.           ---------------------------------------------------------
  221.           CLEARWINDOW                                    procedure
  222.           ---------------------------------------------------------
  223.  
  224.           Purpose:  Clears the current window inside the border.
  225.  
  226.           Syntax:  CLEARWINDOW
  227.  
  228.  
  229.  
  230.  
  231.  
  232.           
  233.           ---------------------------------------------------------
  234.           CURSORCHANGE                                   procedure
  235.           ---------------------------------------------------------
  236.  
  237.           Purpose:  Alter the text screen cursor.  Can be used to
  238.                     hide the cursor.
  239.  
  240.           Syntax:  CURSORCHANGE(HIDECURSOR,OLDCURSOR)
  241.  
  242.  
  243.  
  244.  
  245.           
  246.           ---------------------------------------------------------
  247.           EGA43                                          procedure
  248.           ---------------------------------------------------------
  249.  
  250.           Purpose:  Sets the display mode to 80 x 43 line EGA mode.
  251.  
  252.           Syntax:  EGA43
  253.  
  254.           Note:  You can not use Pascals GotoXY command below the
  255.                  25th line.  All of the window routines in this
  256.                  library will work in this mode.  Use TextMode(c80)
  257.                  to return to normal text.
  258.  
  259.  
  260.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  261.           
  262.                                     - 4 -
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ---------------------------------------------------------
  272.           MAKEMENU                                       procedure
  273.           ---------------------------------------------------------
  274.  
  275.           Purpose:  Presents a highlighted bar menu in a previously
  276.                     opened window.  Returns the position of the
  277.                     highlighted bar in an integer variable called
  278.                     CURNTPOS when the user makes a selection.
  279.           
  280.           Syntax:  MAKEMENU(MENU)
  281.  
  282.           Note:  MENU is a record of type MENUREC.  See the notes
  283.                  above and the demo program for a more detailed
  284.                  description of how to use this procedure.
  285.  
  286.           
  287.           ---------------------------------------------------------
  288.           MAKEWINDOW / MAKEBOX                           procedure
  289.           ---------------------------------------------------------
  290.  
  291.           Purpose:  Open a text window on the screen and stores the
  292.                     area under the window in memory.  MakeBox does
  293.                     the same except the area under the box is not
  294.                     saved and therefore can not be restored.
  295.  
  296.           Syntax:  MAKEWINDOW(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER_
  297.                               SATTR,SHADOW,ZOOM)
  298.  
  299.           Unique Variables:
  300.  
  301.             ZOOM   - A "switch" to indicate if the window should
  302.                      zoom onto the screen.
  303.                        0 - No, normal pop-up window.
  304.                        1 - Yes, zoom to size.
  305.  
  306.  
  307.  
  308.  
  309.           
  310.           ---------------------------------------------------------
  311.           PRTWINDOW                                      procedure
  312.           ---------------------------------------------------------
  313.  
  314.           Purpose:  Display text in the current window using the
  315.                     current attributes and window coordinates.
  316.  
  317.           Syntax:  PRTWINDOW(ROW,COL,STRDAT)
  318.  
  319.           Note:  ROW and COL refer to positions inside the window.
  320.                  ROW 1, COL 1 refers to upper left corner of the
  321.                  window.
  322.           
  323.  
  324.  
  325.  
  326.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  327.           
  328.                                     - 5 -
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ---------------------------------------------------------
  338.           PRTCWINDOW                                     procedure
  339.           ---------------------------------------------------------
  340.  
  341.           Purpose:  Display text centered in the window on the ROW
  342.                     specified using the current attributes and
  343.                     window coordinates.
  344.  
  345.           Syntax:  PRTCWINDOW(ROW,STRDAT)
  346.  
  347.           Note:  ROW refers to the row in the window.  ROW 1 refers
  348.                  to the first row inside the border.
  349.  
  350.           
  351.           ---------------------------------------------------------
  352.           TPWATTR                                        procedure
  353.           ---------------------------------------------------------
  354.  
  355.           Purpose:  To change the color attributes of a specified
  356.                     area of the screen.
  357.  
  358.           Syntax:  TPWATTR(ROW,COL,ROWS,COLS,ATTR)
  359.  
  360.  
  361.           
  362.           ---------------------------------------------------------
  363.           TPWBOX                                         procedure
  364.           ---------------------------------------------------------
  365.  
  366.           Purpose:  Draws a box on the screen of a specified size,
  367.                     border selection, border color attribute and
  368.                     window color attribute and save the screen area
  369.                     to memory.
  370.  
  371.           Syntax:  TPWBOX(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER_
  372.                           SATTR,SHADOW,ZOOM,SCRN^)
  373.  
  374.           CAUTION:  Do not call this procedure by itself.  It is
  375.                     used by MAKEWINDOW only.
  376.  
  377.           
  378.           ---------------------------------------------------------
  379.           TPWFILL                                        procedure
  380.           ---------------------------------------------------------
  381.  
  382.           Purpose:  Fills a specified area of the screen with a
  383.                     specified character and color attribute.
  384.  
  385.           Syntax:  TPWFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)
  386.  
  387.           Unique Variables:
  388.  
  389.             CHAR - The integer value of the character you want
  390.                    displayed.
  391.  
  392.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  393.           
  394.                                     - 6 -
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ---------------------------------------------------------
  404.           TPWPRINT                                       procedure
  405.           ---------------------------------------------------------
  406.  
  407.           Purpose:  Displays string data at a specified location
  408.                     with a specified color attribute.
  409.  
  410.           Syntax:  TPWPRINT(ROW,COL,STRDAT,ATTR)
  411.  
  412.           
  413.           ---------------------------------------------------------
  414.           TPWPRINTC                                      procedure
  415.           ---------------------------------------------------------
  416.  
  417.           Purpose:  Displays string data center within specified
  418.                     columns and on a specified row with a specified
  419.                     color attribute.
  420.  
  421.           Syntax:  TPWPRINTC(ROW,COLL,COLR,STRDAT,ATTR)
  422.  
  423.           Unique Variables:
  424.  
  425.             COLL and COLR refer to the left and right columns
  426.             between which you want you data centered.
  427.  
  428.  
  429.  
  430.  
  431.  
  432.           
  433.           ---------------------------------------------------------
  434.           TPWRBOX                                         procedure
  435.           ---------------------------------------------------------
  436.  
  437.           Purpose:  To restore a specified area of the screen
  438.                     display from information stored in memory.
  439.  
  440.           Syntax:  TPWRBOX(ROW,COL,ROWS,COLS,SCRN^)
  441.  
  442.           CAUTION:  Do not call this procedure by itself.  It is
  443.                     used by REMOVEWINDOW only.
  444.  
  445.  
  446.           
  447.           ---------------------------------------------------------
  448.           REMOVEWINDOW                                   procedure
  449.           ---------------------------------------------------------
  450.  
  451.           Purpose:  To remove the last window opened with MakeWindow
  452.                     from the screen, restore the area under the
  453.                     window and restore the cursor position.
  454.  
  455.           Syntax:  REMOVEWINDOW
  456.  
  457.  
  458.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  459.           
  460.                                     - 7 -
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           ---------------------------------------------------------
  470.           TPWBORDER                                      procedure
  471.           ---------------------------------------------------------
  472.  
  473.           Purpose:  Sets the text screen border to a specified
  474.                     color.  Does not work with EGAs.
  475.  
  476.           Syntax:  TPWBORDER(BACK)
  477.  
  478.  
  479.  
  480.           
  481.           ---------------------------------------------------------
  482.           TITLEWINDOW                                    procedure
  483.           ---------------------------------------------------------
  484.  
  485.           Purpose:  To print a title in the border of a window using
  486.                     a specified color attribute at a specified
  487.                     location.
  488.  
  489.           Syntax:  TITLEWINDOW(LOC,ATTR,STRDAT)
  490.  
  491.           Unique Variables:
  492.  
  493.             LOC - Specifies the location of the title
  494.                     1 - Upper Left Corner
  495.                     2 - Upper Center
  496.                     3 - Upper Right Corner
  497.                     4 - Lower Left Corner
  498.                     5 - Lower Center
  499.                     6 - Lower Right Corner
  500.  
  501.  
  502.  
  503.           
  504.           ---------------------------------------------------------
  505.           VIDEOOFF                                       procedure
  506.           ---------------------------------------------------------
  507.  
  508.           Purpose:  Blanks the video screen. Does not work on EGAs.
  509.  
  510.           Syntax:  VIDEOOFF
  511.           
  512.  
  513.  
  514.           
  515.           ---------------------------------------------------------
  516.           VIDEOON                                        procedure
  517.           ---------------------------------------------------------
  518.  
  519.           Purpose:  Restores the video screen. Does not work on
  520.                     EGAs.
  521.  
  522.           Syntax:  VIDEOON
  523.  
  524.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  525.           
  526.                                     - 8 -
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                            TPWINDO QUICK REFERENCE
  537.  
  538.  
  539.           
  540.               MakeWindow(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
  541.                               Sattr,Shadow,Zoom)
  542.           
  543.                 MakeBox(Row,Col,Rows,Cols,Wattr,Battr,BrdrSel,
  544.                               Sattr,Shadow,Zoom)
  545.  
  546.                                 MakeMenu(Menu)
  547.  
  548.                             TitleWindow(Loc,Title)
  549.  
  550.                                  RemoveWindow
  551.  
  552.                                  ClearWindow
  553.  
  554.                           PrtWindow(Row,Col,StrDat)
  555.  
  556.                             PrtCWindow(Row,StrDat)
  557.  
  558.                                Attr(Fore,Back)
  559.  
  560.                             CursorChange(New,Old)
  561.  
  562.                         TPWPrint(Row,Col,StrDat,Attr)
  563.  
  564.                  TPWPrintC(Row,ColLeft,ColRight,StrDat,Attr)
  565.  
  566.                      TPWFill(Row,Col,Rows,Cols,Char,Attr)
  567.  
  568.                        TPWAttr(Row,Col,Rows,Cols,Attr)
  569.  
  570.                                    VideoOn
  571.  
  572.                                    VideoOff
  573.  
  574.                                     EGA43
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.                 TPW60 Copyright (c) 1988 Richard D. Fothergill
  591.           
  592.                                     - 9 -
  593.  
  594.  
  595.