home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / tb / tbwindo / tbw60.txt < prev   
Text File  |  1988-04-28  |  19KB  |  661 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                                 April 28, 1988
  8.  
  9.  
  10.  
  11.                                    TBWINDO
  12.                              MULTI-LEVEL WINDOWS
  13.                            FOR BORLANDS TURBO BASIC
  14.                                  Version 6.0
  15.  
  16.  
  17.                                     FILES
  18.                      In this version, TBW60.ARC contains
  19.  
  20.                TBW60.INC      - Turbo Basic window include file
  21.                TBW60.DEF      - Definition file for including
  22.                TBD60.BAS      - Demonstration program source code
  23.                TBW60.TXT      - This document file.
  24.  
  25.  
  26.  
  27.                                 USING TBWINDO
  28.  
  29.           Include the TBW60.DEF program in your program with the
  30.           following statement:
  31.  
  32.                              $INCLUDE "TBW60.DEF"
  33.  
  34.           Set MW% variable equal to the maximum number of windows
  35.           you will have open at any one time.
  36.  
  37.           Set the ScrnArray variable equal to the estimated total
  38.           memory required to save your screens.  If you experience a
  39.           subscript out of range error in the include file, increase
  40.           this variable.  As a rough rule of thumb, start out with
  41.           the variable equal to 250 times the maximum windows (mw%)
  42.           variable.
  43.           
  44.           You invoke the routines by means of a CALL with a list of
  45.           parameters, rather than a GOSUB.
  46.  
  47.           All of the above variables with the exception of the
  48.           string variables must either  be  declared  globally  as
  49.           integers by means of a DEFINT statement early  in  the
  50.           program;  or  must  have  the  specific integer identifier
  51.           (%)  attached  wherever  they  appear in the program. The
  52.           BASIC compiler is picky about this; so be sure to verify
  53.           that the type assignment is correct.  Make certain that
  54.           all of your variables passing parameters to the TBWINDO
  55.           subroutine are identified as integers, and you will be
  56.           able to proceed with the compile operation as with any
  57.           other program.
  58.  
  59.  
  60.  
  61.  
  62.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  63.           
  64.                                     - 1 -
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.               If you are using TBWINDOs and find it of value a
  75.           contribution ($20.00) to the author is suggested.  This
  76.           will enable and encourage the further development of
  77.           TBWINDOs.
  78.  
  79.                            WARRANTY AND DISCLAIMER
  80.  
  81.               The author make no warranties, expressed or implied,
  82.           as to the quality or performance of this program.  The
  83.           author will not be held liable for any direct, indirect,
  84.           incidental or consequential damages resulting from the use
  85.           of this program.  Your use of the program constitutes your
  86.           agreement to this disclaimer and your release of the
  87.           author from any form of liability or litigation.
  88.           
  89.           
  90.           Rick Fothergill         BBS - (413) 499-7245
  91.           141 Oak Hill Road             300-1200-2400 baud 8-N-1
  92.           Pittsfield, MA  01201         8am - 4pm Eastern
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  129.           
  130.                                     - 2 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           DEFINITIONS OF COMMON VARIABLES USED IN THE
  140.           STATEMENT AND FUNCTION DESCRIPTIONS:
  141.  
  142.  
  143.           ATTR    - integer value for the foreground and
  144.                     background color. See FNATTR.
  145.  
  146.           BACK    - integer value representing any one of BASIC's
  147.                     background colors.  Valid numbers are 0 - 8.
  148.  
  149.           BATTR   - integer value representing the border color
  150.                     attribute.
  151.  
  152.           BARTYPE - type of highlight bar selected, used by MAKEMENU
  153.                       0 - no visible bar
  154.                       1 - full width bar
  155.                       2 - string width bar
  156.                       3 - pointer
  157.  
  158.           BORDER  - integer value representing the desired border
  159.                     type.  Valid selections are:
  160.  
  161.                       1 - single line
  162.                       2 - double line
  163.                       3 - single horizontal, double vertical
  164.                       4 - double horizontal, single vertical
  165.                       5 - solid
  166.                       6 - light hatch
  167.                       7 - medium hatch
  168.                       8 - heavy hatch
  169.           
  170.           COL     - integer value representing the screen column,
  171.                     should be in the range of 2 - 79
  172.  
  173.           COLS    - integer value representing the number of columns
  174.                     wide.
  175.  
  176.           CURNTPOS - position of menu selection bar returned by
  177.                      MAKEMENU
  178.  
  179.           FLATTR  - color attribute of the first letter of each item
  180.                     in a menu, used by MAKEMENU
  181.  
  182.           FLON    - a switch used by MAKEMENU to indicate whether
  183.                     first letter selection is active.
  184.                       0 - first letter not active
  185.                      -1 - first letter active
  186.  
  187.           FORE    - integer value representing any one of BASIC's
  188.                     foreground colors.  Valid numbers are 0 - 31.
  189.  
  190.           HLATTR  - color attribute of menu highlight bar, used by
  191.                     MAKEMENU
  192.  
  193.  
  194.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  195.           
  196.                                     - 3 -
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           ITEM$() - a string array of menu selections used by
  206.                     MAKEMENU
  207.  
  208.           ITEMCOUNT - total number of items in current menu
  209.  
  210.           MAXITEM - maximum item allowed in a menu, used by MAKEMENU
  211.  
  212.           MW      - maximum windows and menus allowed to be open at
  213.                     once
  214.  
  215.           ROW     - integer value representing the screen row,
  216.                     should be in the range of 2 - 23.
  217.  
  218.           ROWS    - integer value representing the number of rows
  219.                     long.
  220.  
  221.           SATTR   - integer value representing then shadow color
  222.                     attribute
  223.  
  224.           SHADOW  - integer value representing the desired shadow
  225.                     type.  Valid selections are:
  226.                       0    - No shadow
  227.                       1,2  - Reattribute shadow, does not destroy
  228.                       3,4  - Solid Block
  229.                       5,6  - Light Hatch
  230.                       7,8  - Medium Hatch
  231.                       9,10 - Heavy Hatch
  232.                     Odd - Left  Even - Right
  233.  
  234.           STARTPOS - starting position for the menu selection bar,
  235.                     used by MAKEMENU
  236.  
  237.           STRDAT$ - string data.
  238.  
  239.           WATTR   - integer value representing the window color
  240.                     attribute.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  261.           
  262.                                     - 4 -
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ---------------------------------------------------------
  272.           CLEARWINDOW                                    statement
  273.           ---------------------------------------------------------
  274.  
  275.           Purpose:  Clears the current window inside the border.
  276.  
  277.           Syntax:  CLEARWINDOW
  278.  
  279.  
  280.  
  281.  
  282.  
  283.           ---------------------------------------------------------
  284.           FNATTR                                          function
  285.           ---------------------------------------------------------
  286.  
  287.           Purpose:  Calculate the color attribute given the fore
  288.                     and background colors.  Returns an integer
  289.                     value.
  290.  
  291.           Syntax:  FNATTR(FORE,BACK)
  292.  
  293.  
  294.  
  295.  
  296.  
  297.           ---------------------------------------------------------
  298.           MAKEBOX                                        statement
  299.           ---------------------------------------------------------
  300.  
  301.           Purpose:  Draws a box on the screen.  No screen saving
  302.                     performed.  See MAKEWINDOW.
  303.  
  304.           Syntax:  MAKEBOX(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER_
  305.                               SATTR,SHADOW,ZOOM)
  306.  
  307.           Unique Variables:
  308.           
  309.               ZOOM   - A "switch" to indicate if the window should
  310.                        zoom onto the screen.
  311.                        0 - No, normal pop-up window.
  312.                        1 - Yes, zoom to size.
  313.  
  314.  
  315.  
  316.           
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  327.           
  328.                                     - 5 -
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ---------------------------------------------------------
  338.           MAKEMENU                                       statemenu
  339.           ---------------------------------------------------------
  340.  
  341.           Purpose:  Presents a highlighted bar menu in a previously
  342.                     opened window.  Returns the position of the
  343.                     highlighted bar in an integer variable called
  344.                     CURNTPOS when the user makes a selection.
  345.  
  346.           Syntax:  MAKEMENU
  347.  
  348.           Note:  See the variable descriptions above that reference
  349.                  MAKEMENU and the demo program for a more detailed
  350.                  description of how to use this procedure.
  351.  
  352.  
  353.  
  354.  
  355.           ---------------------------------------------------------
  356.           MAKEWINDOW                                     statement
  357.           ---------------------------------------------------------
  358.  
  359.           Purpose:  Open a text window on the screen with automatic
  360.                     screen saving.
  361.  
  362.           Syntax:  MAKEWINDOW(ROW,COL,ROWS,COLS,WATTR,BATTR,BORDER_
  363.                               SATTR,SHADOW,ZOOM)
  364.  
  365.           Unique Variables:
  366.           
  367.               ZOOM   - A "switch" to indicate if the window should
  368.                        zoom onto the screen.
  369.                        0 - No, normal pop-up window.
  370.                        1 - Yes, zoom to size.
  371.  
  372.  
  373.           
  374.           ---------------------------------------------------------
  375.           PRTWINDOW                                      statement
  376.           ---------------------------------------------------------
  377.  
  378.           Purpose:  Display text in the current window using the
  379.                     current attributes and window coordinates.
  380.  
  381.           Syntax:  PRTWINDOW(ROW,COL,STRDAT$)
  382.  
  383.           Note:  ROW and COL refer to positions inside the window.
  384.                  ROW 1, COL 1 refers to upper left corner of the
  385.                  window.
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  393.           
  394.                                     - 6 -
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ---------------------------------------------------------
  404.           PRTCWINDOW                                     statement
  405.           ---------------------------------------------------------
  406.  
  407.           Purpose:  Display text centered in the window on the ROW
  408.                     specified using the current attributes and
  409.                     window coordinates.
  410.  
  411.           Syntax:  PRTCWINDOW(ROW,STRDAT$)
  412.  
  413.           Note:  ROW refers to the row in the window.  ROW 1 refers
  414.                  to the first row inside the border.
  415.  
  416.  
  417.           ---------------------------------------------------------
  418.           REMOVEWINDOW                                   statement
  419.           ---------------------------------------------------------
  420.  
  421.           Purpose:  To remove the last window opened from the
  422.                     screen, restore the area under the window and
  423.                     restore the cursor position.
  424.  
  425.           Syntax:  REMOVEWINDOW
  426.  
  427.  
  428.           ---------------------------------------------------------
  429.           TBWATTR                                        statement
  430.           ---------------------------------------------------------
  431.  
  432.           Purpose:  To change the color attributes of a specified
  433.                     area of the screen.
  434.  
  435.           Syntax:  TBWATTR(ROW,COL,ROWS,COLS,ATTR)
  436.  
  437.  
  438.           ---------------------------------------------------------
  439.           TBWBOX                                         statement
  440.           ---------------------------------------------------------
  441.  
  442.           Purpose:  Draws a box on the screen of a specified size,
  443.                     border selection, border color attribute and
  444.                     window color attribute and save the screen area
  445.                     to memory.
  446.  
  447.           Syntax:  TBWBOX(SAVFLG,ROW,COL,ROWS,COLS,WATTR,BATTR_
  448.                            ,BORDER, SHADOW,ZOOM,SCRN())
  449.  
  450.           CAUTION:  Do not call this procedure by itself.  It is
  451.                     used by MAKEWINDOW and MAKEBOX only.
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  459.           
  460.                                     - 7 -
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           ---------------------------------------------------------
  470.           TBWFILL                                        statement
  471.           ---------------------------------------------------------
  472.  
  473.           Purpose:  Fills a specified area of the screen with a
  474.                     specified character and color attribute.
  475.  
  476.           Syntax:  TBWFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)
  477.  
  478.           Unique Variables:
  479.  
  480.               CHAR - The integer value of the character you want
  481.                      displayed.
  482.  
  483.  
  484.           ---------------------------------------------------------
  485.           TBWPRINT                                       statement
  486.           ---------------------------------------------------------
  487.  
  488.           Purpose:  Displays string data at a specified location
  489.                     with a specified color attribute.
  490.  
  491.           Syntax:  TBWPRINT(ROW,COL,STRDAT$,ATTR)
  492.  
  493.  
  494.           ---------------------------------------------------------
  495.           TBWPRINTC                                      statement
  496.           ---------------------------------------------------------
  497.  
  498.           Purpose:  Displays string data center within specified
  499.                     columns and on a specified row with a specified
  500.                     color attribute.
  501.  
  502.           Syntax:  TBWPRINTC(ROW,COLL,COLR,STRDAT$,ATTR)
  503.  
  504.           Unique Variables:
  505.  
  506.               COLL and COLR refer to the left and right columns
  507.               between which you want you data centered.
  508.  
  509.  
  510.           ---------------------------------------------------------
  511.           TBWRBOX                                         statement
  512.           ---------------------------------------------------------
  513.  
  514.           Purpose:  To restore a specified area of the screen
  515.                     display from information stored in memory.
  516.  
  517.           Syntax:  TBWRBOX(ROW,COL,ROWS,COLS,SHADOW,SCRN())
  518.  
  519.           CAUTION:  Do not call this procedure by itself.  It is
  520.                     used by REMOVEWINDOW only.
  521.  
  522.  
  523.  
  524.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  525.           
  526.                                     - 8 -
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           ---------------------------------------------------------
  536.           TBWBORDER                                      statement
  537.           ---------------------------------------------------------
  538.  
  539.           Purpose:  Sets the text screen border to a specified
  540.                     color.
  541.  
  542.           Syntax:  TBWBORDER(BACK)
  543.  
  544.  
  545.           ---------------------------------------------------------
  546.           TBWTITLE                                       statement
  547.           ---------------------------------------------------------
  548.  
  549.           Purpose:  Handles all requests to TITLEWINDOW.
  550.  
  551.           Syntax:  TBWTITLE(DIR,ROW,COL,ROWS,COLS,STRDAT$,ATTR)
  552.  
  553.           CAUTION:  Do not call this procedure by itself. It is
  554.                     used by TITLEWINDOW only.
  555.  
  556.  
  557.           ---------------------------------------------------------
  558.           TITLEWINDOW                                    statement
  559.           ---------------------------------------------------------
  560.  
  561.           Purpose:  To print a title in the border of a window using
  562.                     the border color attributes at a specified
  563.                     location.
  564.  
  565.           Syntax:  TITLEWINDOW(LOC,ATTR,STRDAT$)
  566.  
  567.           Unique Variables:
  568.  
  569.               LOC - Specifies the location of the title
  570.                     1 - Upper Left Corner
  571.                     2 - Upper Center
  572.                     3 - Upper Right Corner
  573.                     4 - Lower Left Corner
  574.                     6 - Lower Center
  575.                     6 - Lower Right Corner
  576.  
  577.  
  578.           ---------------------------------------------------------
  579.           WINDOWXY                                       statement
  580.           ---------------------------------------------------------
  581.  
  582.           Purpose:  Position the cursor within the current window.
  583.           
  584.           Syntax:  WINDOWXY(ROW,COL)
  585.  
  586.           Note:  ROW and COL refer to positions inside the window.
  587.                  ROW 1, COL 1 refers to upper left corner of the
  588.                  window.
  589.  
  590.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  591.           
  592.                                     - 9 -
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                            TBWINDO QUICK REFERENCE
  602.  
  603.  
  604.           
  605.           MakeWindow(Row%,Col%,Rows%,Cols%,Wattr%,Battr%,BrdrSel%,
  606.                                 Shadow%,Zoom%)
  607.  
  608.           MakeBox(Row%,Col%,Rows%,Cols%,Wattr%,Battr%,BrdrSel%,
  609.                              Shadow%,Zoom%)
  610.           
  611.                            TitleWindow(Loc%,Title$)
  612.  
  613.                                  RemoveWindow
  614.  
  615.                                  ClearWindow
  616.  
  617.                          PrtWindow(Row%,Col%,StrDat$)
  618.  
  619.                            PrtCWindow(Row%,StrDat$)
  620.  
  621.                              FNAttr%(Fore%,Back%)
  622.  
  623.                              WindowXY(Row%,Col%)
  624.  
  625.                                    MakeMenu
  626.  
  627.                       TBWPrint(Row%,Col%,StrDat$,Attr%)
  628.  
  629.                TBWPrintC(Row%,ColLeft%,ColRight%,StrDat$,Attr%)
  630.  
  631.                   TBWFill(Row%,Col%,Rows%,Cols%,Char%,Attr%)
  632.  
  633.                      TBWAttr(Row%,Col%,Rows%,Cols%,Attr%)
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.              TBW60 / Copyright (c) 1988 by Richard D. Fothergill
  657.           
  658.                                     - 10 -
  659.  
  660.  
  661.