home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TBW_40.ZIP / TBW40.TXT < prev    next >
Encoding:
Text File  |  1987-12-28  |  14.8 KB  |  595 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                                 December 28, 1987
  8.  
  9.  
  10.  
  11.                                    TBWINDO
  12.                              MULTI-LEVEL WINDOWS
  13.                            FOR BORLANDS TURBO BASIC
  14.                                  Version 4.0
  15.  
  16.  
  17.                                     FILES
  18.                      In this version, TBW40.ARC contains
  19.  
  20.                TBWINDO.INC    - Turbo Basic window include file
  21.                TBDEMO40.BAS   - Demonstration program source code
  22.                TBW40.TXT      - This document file.
  23.                README.1ST     - Most recent changes and corrections.
  24.  
  25.  
  26.  
  27.                                 USING TBWINDO
  28.  
  29.           Include the TBWINDO.INC  program in your  program with the
  30.           following statement:
  31.  
  32.                             $INCLUDE "TBWINDO.INC"
  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.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                     - 1 -
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           DEFINITIONS OF COMMON VARIABLES USED IN THE
  74.           STATEMENT AND FUNCTION DESCRIPTIONS:
  75.  
  76.  
  77.           ATTR    - integer value for the foreground and
  78.                     background color. See FNATTR.
  79.  
  80.           BACK    - integer value representing any one of BASIC's
  81.                     background colors.  Valid numbers are 0 - 8.
  82.  
  83.           BATTR   - integer value representing the border color
  84.                     attribute.
  85.           
  86.           BRDRSEL - integer value representing the desired border
  87.                     type.  Valid selections are:
  88.  
  89.                       0 - no border
  90.                       1 - single line frame
  91.                       2 - double line frame
  92.                       3 - single horizontal, double vertical
  93.                       4 - double horizontal, single vertical
  94.                       5 - double line frame, arrow upper left corner
  95.           
  96.           COL     - integer value representing the screen column,
  97.                     should be in the range of 2 - 79
  98.  
  99.           COLS    - integer value representing the number of columns
  100.                     wide.
  101.           
  102.           FORE    - integer value representing any one of BASIC's
  103.                     foreground colors.  Valid numbers are 0 - 31.
  104.  
  105.           ROW     - integer value representing the screen row,
  106.                     should be in the range of 2 - 23.
  107.  
  108.           ROWS    - integer value representing the number of rows
  109.                     long.
  110.  
  111.           STRDAT$ - string data.
  112.  
  113.           WATTR   - integer value representing the window color
  114.                     attribute.
  115.  
  116.           NOTE:  There is no parameter checking performed in any of
  117.                  the statements or functions.  If string data
  118.                  exceeds the area specified it will spill out the
  119.                  sides.  If parameters are out range of BASIC's
  120.                  limits you will either get error messages or very
  121.                  strange video results.
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                     - 2 -
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           ---------------------------------------------------------
  140.           CLEARWINDOW                                    statement
  141.           ---------------------------------------------------------
  142.  
  143.           Purpose:  Clears the current window inside the border.
  144.  
  145.           Syntax:  CLEARWINDOW
  146.  
  147.  
  148.  
  149.           ---------------------------------------------------------
  150.           FNATTR                                          function
  151.           ---------------------------------------------------------
  152.  
  153.           Purpose:  Calculate the color attribute given the fore
  154.                     and background colors.  Returns an integer
  155.                     value.
  156.  
  157.           Syntax:  FNATTR(FORE,BACK)
  158.  
  159.  
  160.  
  161.           ---------------------------------------------------------
  162.           MAKEMENU                                       statement
  163.           ---------------------------------------------------------
  164.  
  165.           Purpose:  Creates a point and shoot type menu in a
  166.                     previously defined window.  Returns an integer
  167.                     value in the variable CURNTPOS equal to the
  168.                     the menu item number selected.
  169.  
  170.           Syntax:  MAKEMENU
  171.  
  172.           Unique Variables: Must be defined before the call.
  173.  
  174.               ITEM$()    - An  array of  string  data that  you want
  175.                           displayed in the menu.
  176.  
  177.               ITEMCOUNT - Total elements in the ITEM$ array.
  178.  
  179.               STARTPOS  - Default opening position of the
  180.                           selection bar.
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                     - 3 -
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           ---------------------------------------------------------
  206.           MAKEWINDOW                                     statement
  207.           ---------------------------------------------------------
  208.  
  209.           Purpose:  Open a text window on the screen.
  210.  
  211.           Syntax:  MAKEWINDOW(ROW,COL,ROWS,COLS,WATTR,BATTR,BRDRSEL_
  212.                               ,SHADOW,ZOOM)
  213.  
  214.           Unique Variables:
  215.           
  216.               SHADOW - A "switch" to indicate if the window should
  217.                        have a shadow around it.
  218.                        0 - No Shadow
  219.                        1 - Left Solid Black   3 - Left Shadow Black
  220.                        2 - Right Solid Black  4 - Right Shadow Black
  221.  
  222.               ZOOM   - A "switch" to indicate if the window should
  223.                        zoom onto the screen.
  224.                        0 - No, normal pop-up window.
  225.                        1 - Yes, zoom to size.
  226.  
  227.  
  228.  
  229.           ---------------------------------------------------------
  230.           PRTWINDOW                                      statement
  231.           ---------------------------------------------------------
  232.  
  233.           Purpose:  Display text in the current window using the
  234.                     current attributes and window coordinates.
  235.  
  236.           Syntax:  PRTWINDOW(ROW,COL,STRDAT$)
  237.  
  238.           Note:  ROW and COL refer to positions inside the window.
  239.                  ROW 1, COL 1 refers to upper left corner of the
  240.                  window.
  241.           
  242.  
  243.  
  244.           ---------------------------------------------------------
  245.           PRTCWINDOW                                     statement
  246.           ---------------------------------------------------------
  247.  
  248.           Purpose:  Display text centered in the window on the ROW
  249.                     specified using the current attributes and
  250.                     window coordinates.
  251.  
  252.           Syntax:  PRTCWINDOW(ROW,STRDAT$)
  253.  
  254.           Note:  ROW refers to the row in the window.  ROW 1 refers
  255.                  to the first row inside the border.
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                     - 4 -
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ---------------------------------------------------------
  272.           TBWATTR                                        statement
  273.           ---------------------------------------------------------
  274.  
  275.           Purpose:  To change the color attributes of a specified
  276.                     area of the screen.
  277.  
  278.           Syntax:  TBWATTR(ROW,COL,ROWS,COLS,ATTR)
  279.  
  280.  
  281.  
  282.           ---------------------------------------------------------
  283.           TBWBOX                                         statement
  284.           ---------------------------------------------------------
  285.  
  286.           Purpose:  Draws a box on the screen of a specified size,
  287.                     border selection, border color attribute and
  288.                     window color attribute.
  289.  
  290.           Syntax:  TBWBOX(ROW,COL,ROWS,COLS,WATTR,BATTR)
  291.  
  292.  
  293.  
  294.           ---------------------------------------------------------
  295.           TBWFILL                                        statement
  296.           ---------------------------------------------------------
  297.  
  298.           Purpose:  Fills a specified area of the screen with a
  299.                     specified character and color attribute.
  300.  
  301.           Syntax:  TBWFILL(ROW,COL,ROWS,COLS,CHAR,ATTR)
  302.  
  303.           Unique Variables:
  304.  
  305.               CHAR - The integer value of the character you want
  306.                      displayed.
  307.  
  308.  
  309.  
  310.           ---------------------------------------------------------
  311.           TBWPRINT                                       statement
  312.           ---------------------------------------------------------
  313.  
  314.           Purpose:  Displays string data at a specified location
  315.                     with a specified color attribute.
  316.  
  317.           Syntax:  TBWPRINT(ROW,COL,STRDAT$,ATTR)
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                     - 5 -
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ---------------------------------------------------------
  338.           TBWPRINTC                                      statement
  339.           ---------------------------------------------------------
  340.  
  341.           Purpose:  Displays string data center within specified
  342.                     columns and on a specified row with a specified
  343.                     color attribute.
  344.  
  345.           Syntax:  TBWPRINTC(ROW,COLL,COLR,STRDAT$,ATTR)
  346.  
  347.           Unique Variables:
  348.  
  349.               COLL and COLR refer to the left and right columns
  350.               between which you want you data centered.
  351.  
  352.  
  353.           ---------------------------------------------------------
  354.           TBWREST                                        statement
  355.           ---------------------------------------------------------
  356.  
  357.           Purpose:  To restore a specified area of the screen
  358.                     display from information stored in memory.
  359.  
  360.           Syntax:  TBWREST(ROW,COL,ROWS,COLS,SCRN())
  361.  
  362.           Unique Variables:
  363.  
  364.               SCRN() should be defined as an array of integers.
  365.  
  366.  
  367.           ---------------------------------------------------------
  368.           TBWSAVE                                        statement
  369.           ---------------------------------------------------------
  370.  
  371.           Purpose:  To save a specified area of the screen in
  372.                     an integer array for later recall.
  373.  
  374.           Syntax:  TBWSAVE(ROW,COL,ROWS,COLS,SCRN())
  375.  
  376.           Unique Variables:
  377.  
  378.               SCRN() should be defined as an array of integers.
  379.  
  380.  
  381.           ---------------------------------------------------------
  382.           REMOVEWINDOW                                   statement
  383.           ---------------------------------------------------------
  384.  
  385.           Purpose:  To remove the last window opened from the
  386.                     screen, restore the area under the window and
  387.                     restore the cursor position.
  388.  
  389.           Syntax:  REMOVEWINDOW
  390.  
  391.  
  392.  
  393.                                     - 6 -
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ---------------------------------------------------------
  404.           TEXTBORDER                                     statement
  405.           ---------------------------------------------------------
  406.  
  407.           Purpose:  Sets the text screen border to a specified
  408.                     color.
  409.  
  410.           Syntax:  TEXTBORDER(BACK)
  411.  
  412.  
  413.  
  414.           ---------------------------------------------------------
  415.           TITLEWINDOW                                    statement
  416.           ---------------------------------------------------------
  417.  
  418.           Purpose:  To print a title in the border of a window using
  419.                     the border color attributes at a specified
  420.                     location.
  421.  
  422.           Syntax:  TITLEWINDOW(LOC,ATTR,STRDAT$)
  423.  
  424.           Unique Variables:
  425.  
  426.               LOC - Specifies the location of the title
  427.                     1 - Upper Left Corner
  428.                     2 - Upper Center
  429.                     3 - Upper Right Corner
  430.                     4 - Lower Left Corner
  431.                     5 - Lower Center
  432.                     6 - Lower Right Corner
  433.  
  434.  
  435.           ---------------------------------------------------------
  436.           WINDOWXY                                       statement
  437.           ---------------------------------------------------------
  438.  
  439.           Purpose:  Position the cursor within the current window.
  440.           
  441.           Syntax:  WINDOWXY(ROW,COL)
  442.  
  443.           Note:  ROW and COL refer to positions inside the window.
  444.                  ROW 1, COL 1 refers to upper left corner of the
  445.                  window.
  446.           
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                     - 7 -
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           All  of  the above  variables  with the  exception  of the
  470.           string variables  must either  be   declared  globally  as
  471.           integers by  means of  a DEFINT  statement early   in  the
  472.           program;  or  must  have  the  specific integer identifier
  473.           (%)  attached  wherever  they   appear in the program. The
  474.           BASIC  compiler  is picky  about  this; so   be   sure  to
  475.           verify that the type  assignment is correct.  Make certain
  476.           that  all  of  your variables  passing  parameters  to the
  477.           TBWINDO  subroutine are  identified  as integers,  and you
  478.           will be   able to  proceed with  the compile  operation as
  479.           with any other program.
  480.  
  481.           Rick Fothergill
  482.           141 Oak Hill Road
  483.           Pittsfield, MA 01201
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.                                     - 8 -
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.                            TBWINDO QUICK REFERENCE
  537.  
  538.  
  539.           
  540.           MakeWindow(Row%,Col%,Rows%,Cols%,Wattr%,Battr%,BrdrSel%,
  541.                                 Shadow%,Zoom%)
  542.  
  543.                            TitleWindow(Loc%,Title$)
  544.  
  545.                                  RemoveWindow
  546.  
  547.                                  ClearWindow
  548.  
  549.                                    MakeMenu
  550.  
  551.                          PrtWindow(Row%,Col%,StrDat$)
  552.  
  553.                            PrtCWindow(Row%,StrDat$)
  554.  
  555.                              FNAttr%(Fore%,Back%)
  556.  
  557.                              WindowXY(Row%,Col%)
  558.  
  559.                    TBWSave(Row%,Col%,Rows%,Cols%,Scrn%(??))
  560.  
  561.                    TBWRest(Row%,Col%,Rows%,Cols%,Scrn%(??))
  562.  
  563.                       TBWPrint(Row%,Col%,StrDat$,Attr%)
  564.  
  565.                TBWPrintC(Row%,ColLeft%,ColRight%,StrDat$,Attr%)
  566.  
  567.                   TBWFill(Row%,Col%,Rows%,Cols%,Char%,Attr%)
  568.  
  569.                      TBWAttr(Row%,Col%,Rows%,Cols%,Attr%)
  570.  
  571.              TBWBox(Row%,Col%,Rows%,Cols%,Wattr%,Battr%,BrdrSel%)
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                     - 9 -
  592.  
  593.  
  594.  
  595.