home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / wndw40.zip / WNDW40.DOC < prev    next >
Text File  |  1987-12-12  |  14KB  |  296 lines

  1.                                                          December 12, 1987 
  2.  
  3.                                    MULTI-LEVEL 
  4.                                   RANDOM-ACCESS
  5.                                      WINDOWS
  6.                                    Version 4.0
  7.  
  8.         PURPOSE:
  9.  
  10.         Two units create incredibly quick multi-level, random-access 
  11.         windows in Turbo Pascal 4.0 programs for all IBM and compatibles 
  12.         including the new PS/2 systems, PCjr, PC convertible, and 3270 PC.  
  13.         They work in all text modes and any column mode (40/80/etc.) using 
  14.         the quick screen writing utilities of QWIK40.TPU.  The entire code 
  15.         is only 7.4k bytes for all utilities.
  16.  
  17.  
  18.         TEST DRIVE:
  19.  
  20.         Compile and run the tutoring program WNDWDEMO.PAS to get a feeling
  21.         for features and speed.  For a demo of window management with 
  22.         random-access windows, run WMGRDEMO.PAS.  Both demos use the same 
  23.         code, but were just applied differently. 
  24.  
  25.  
  26.         FILES:
  27.  
  28.         In this version, WNDW40.ARC contains:
  29.  
  30.            !_read  .me!:  File that insists you get a copy of QWIK40.ARC.
  31.            Qwik40a .tpu:  Unit for quick screen writing.
  32.            WndwVars.pas:  Unit source code for variables used in 
  33.                           WNDW40.TPU.
  34.            WndwVars.tpu:  Unit of WNDWVARS.PAS.
  35.            Wndw40  .tpu:  Unit for your programs to use windows.
  36.            Wndw40- .pas:  Partial source code listing of WNDW40.TPU.
  37.            Wndw40  .doc:  This document.
  38.            WndwDemo.pas:  Demo of WNDW40.TPU and QWIK40.TPU which also
  39.                           gives a tutorial of user instructions.
  40.            WmgrDemo.pas:  Demo of window management with random-access.
  41.            License .arc:  ARC file containing license agreements
  42.  
  43.  
  44.         IMPROVEMENTS:
  45.  
  46.         Obviously, this program was modified to work with TP 4.0.  In 
  47.         addition, several new features were added for random-access 
  48.         windows.  Compared to WINDOW34.INC, the code has been overhauled 
  49.         and many improvements in code optimization were made as noted 
  50.         below and in the demos.  However, the changes necessary to upgrade 
  51.         your code are minimal.
  52.  
  53.  
  54.         PROCEDURES:
  55.  
  56.         WNDW40.TPU - This unit has the full capabilities of window 
  57.         management of random-access windows.  Note that WNDW40.TPU uses 
  58.         QWIK.TPU and WNDWVARS.TPU.  MaxWndw is fixed at 30 windows and the 
  59.         window names have all been assigned.  In order to make any 
  60.         changes, the complete source code will be required to still have 
  61.         the full window management utilities.
  62.  
  63.         WNDW40-.PAS - The procedures in WNDW40.TPU are only partially 
  64.         listed in WNDW40-.PAS.  I have decided not to disclose some of the 
  65.         more critical procedures in window management in this ARC file.  
  66.         This means that you can make some changes in WNDWVARS.PAS, but 
  67.         only the BASIC (serial-access) window utilities will be compiled 
  68.         in WNDW40-.PAS.  The length of the complete source code is over 
  69.         1000 lines.  Of course, those registered can receive the source 
  70.         code upon request.
  71.  
  72.  
  73.         SHAREWARE:
  74.  
  75.         These procedures are ShareWare. The cost may range from $6 to $32 
  76.         depending on your application.  I do enjoy assisting others in 
  77.         their programming, but lack of reimbursement is expensive for me! 
  78.         Please help out.  See the STATMENT.LIC in LICENSE.ARC for details.  
  79.         If the response will let me break even, I will continue support.
  80.  
  81.  
  82.         UPGRADING:
  83.  
  84.         QWIK - Refer to the notes in QWIK40.ARC for upgrading the QWIK 
  85.         utilities.
  86.  
  87.         Modes - All the modes are kept as bit flags in the global variable 
  88.         called WindowModes.  ShadowDir and FixedWindow have been 
  89.         converted into one of the modes listed below.  Contrary to what 
  90.         you might expect, FixedWindow corresponds to the constant PermMode 
  91.         and not FixedMode.  None of the modes are tripped back to clear 
  92.         and remain unaltered until you change them.  Each window saves a 
  93.         copy of WindowModes when it was created in the variable WSmodes.  
  94.         The constants listed below have the appropriate bit flag set.
  95.  
  96.           PermMode    - This window will saves the underlay and is 
  97.                         permanent.  So, it can't be moved, hidden, or 
  98.                         accessed.  Use this for the first windows 
  99.                         placed on the screen.
  100.           FixedMode   - the underlay is saved in this mode, but it  
  101.                         prevents the user from moving or accessing 
  102.                         it randomly, such as pull-down menus.
  103.           ShadowLeft  - a shadow is placed on the lower left corner.
  104.           ShadowRight - a shadow is placed on the upper right corner.
  105.           ZoomMode    - this creates the zoom effect when the window 
  106.                         is made, accessed or shown.
  107.           HideMode    - This is handled by WNDW40.  It will tell you 
  108.                         the status of the window.  It shouldn't be 
  109.                         set by the programmer.  Another way to tell 
  110.                         if a window is hidden is with GetLevelIndex.  
  111.                         If the value is greater than LI, it's hidden.
  112.  
  113.         To set the modes for subsequent MakeWindows, use the following:
  114.           
  115.             SetWindowModes (ZoomMode+ShadowRight);
  116.  
  117.         You could just as easily assign WindowModes manually:
  118.  
  119.             WindowModes:=ZoomMode+ShadowRight;
  120.  
  121.         SetWindowModes just makes sure you don't have two shadows turned 
  122.         on and clears the HideMode.  The default is all modes off.  
  123.         WindowModes will apply to all subsequent MakeWindows.
  124.  
  125.         MakeWindow - This procedure now requires a unique name so it can 
  126.         be identified for random-access.  If you don't intend to use 
  127.         random-access, any name will do.
  128.  
  129.         TitleWindow - One more parameter was added to work on the top or 
  130.         the bottom border.  Simply include the constant Top or Bottom.
  131.  
  132.         Programming Errors - Programming errors now appear as a centered 
  133.         flashing window rather than using a writeln statement.  The code 
  134.         is in WNDWVARS.PAS and you can easily modify it or eliminate it 
  135.         altogether.  Writeln is no longer used anywhere in the units.
  136.  
  137.         WndwStat - Several new variables were added in the WndwStat record 
  138.         for ease of use.  The UnderLay is the screen data that is 
  139.         overwritten by the new window.  With a shadow, it adds 2 more 
  140.         columns and one more row.  These dimensions are kept as "UL" 
  141.         variables.
  142.  
  143.         TopWndwStat - The current window stats are always maintained in 
  144.         the global record TopWndwStat.  Combined with a with statement, 
  145.         the code is optimized just like simple global variables.  So use 
  146.         TopWndwStat in lieu of WndwStat[LI].
  147.  
  148.         Tattr - Change all references to Tattr to TextAttr which is 
  149.         Turbo's text attribute for Writeln.
  150.  
  151.         Suppressing Attributes - The use of a negative number to suppress 
  152.         attribute changes in the creation of a window is now possible.  I, 
  153.         personally,  cannot think of a reasonable application of this per 
  154.         se.  However, if you chose to do so, remember that TextAttr will 
  155.         be set to the lo byte portion of the integer Wattr.  To have both 
  156.         a selected TextAttr and a negative number, give the Wattr 
  157.         parameter the following value:
  158.  
  159.            $FF00 + MyForeground + MyBackground  
  160.         
  161.         Turbo will compile it down to an integer.
  162.  
  163.  
  164.         ADDITIONAL NOTES:
  165.  
  166.         QWIK40A.TPU - If you have QWIK40.ARC, replace your QWIK40.TPU with 
  167.         QWIK40A.TPU.  The earlier version always left SubmodelID as zero.  
  168.         It is corrected in this version.
  169.  
  170.         QWIK - The demos WNDWDEMO.PAS and WMGRDEMO.PAS cover most of the 
  171.         instructions for use, but users should also read QWIK40.ARC to get 
  172.         the most of these procedures.  For instance, WNDW40.TPU can work 
  173.         on up to 8 display pages depending on your video card.  Turbo 
  174.         Pascal procedures only work on the first page, page 0.  This is 
  175.         where QWIK utilities come in.  They will work on any page.  Even 
  176.         though WNDW40.TPU will seem to make a Turbo Window on say page 3, 
  177.         the standard procedures of WriteLn, Window, GotoXY, etc. will not 
  178.         work there.  You must then use QWIK for those pages.  QWIK also 
  179.         works in absolute screen coordinates and are not limited to the 
  180.         Turbo Window dimensions.  There may be later versions of QWIK, so 
  181.         use the latest one.
  182.  
  183.         Heap - The memory requirement for the heap depends on whether your 
  184.         program uses serial or random access, the latter requiring about 
  185.         twice as much.  For serial access, the heap is:
  186.  
  187.            Total Bytes = (Sum of the underlay bytes for all windows) +
  188.                          2*(underlay bytes of the largest window)
  189.  
  190.         Underlay bytes are just the Rows*Cols*2.  If you have a shadow, 
  191.         you must add 1 to Rows and 2 to Cols.  The last part about the 
  192.         largest window is a requirement only if MoveWindow or ScrollWindow 
  193.         is used.  For random access, the heap is:
  194.  
  195.            Total Bytes = 2*(Sum of the underlay bytes for all windows) +
  196.                          (Underlay bytes for the largest window)
  197.  
  198.         The need for the doubled size is to account for the maximum 
  199.         possibility of gaps due to RemoveWindow being used.  If it is not 
  200.         used, then use the serial access size.
  201.  
  202.         Stack - Stack checking has been turned off in the unit.  Less than 
  203.         1k is used for any procedure.
  204.  
  205.         Small Windows - Remember that a Turbo window cannot have less than 
  206.         2 rows or columns and still work scrolling and wrap-around.
  207.  
  208.         Hatch Borders - With the 9x16 character cell size on the new VGA 
  209.         adapters being the same as MDA, the hatch characters (ASCII 176, 
  210.         177, 178) are only 8x16 in a 9x16 cell.  This unfortunately 
  211.         produces a horizontal gap between the characters not seen on the 
  212.         CGA.  Be aware of the effect.
  213.  
  214.         Full Screen Windows - Be sure to remember when you turn on a 
  215.         shadow, especially on the left side.  If you try to make the 
  216.         window in Col=1, the shadow will wrap around to the other side of 
  217.         the screen leaving a black column.  In addition, it will not be 
  218.         removed correctly, because it will think the underlay starts at 
  219.         Col=-2 which translates to 254 in byte.
  220.  
  221.         Pull-down Menus - An application of windows is multi-level pull-
  222.         down menus.  I have already created some very thorough code in a 
  223.         file called PULL20.ARC.  It is fully featured and fully 
  224.         configurable.  Includes execute, single, and multiple choice 
  225.         menus, unlimited nested submenus, data entry windows, help 
  226.         windows, message system, fully completed interfaces.  Scheduled 
  227.         release is now 01-12-88.
  228.  
  229.         On-line source - All updated files can be found on the CompuServe 
  230.         Borland Forum (GO BPROGA) in the TP 4.0 data library or in the IBM 
  231.         Software Forum (GO IBMSW).
  232.  
  233.  
  234.         LIABILITY:
  235.  
  236.         No liabilities are assumed in the use or misuse of these 
  237.         procedures.
  238.  
  239.  
  240.         CREDITS:
  241.  
  242.         The initial program was developed by Michael Burton in his copy
  243.         of WINDO.INC, ver 2.4.  The program was edited by permission and
  244.         re-released as WINDOW30.ARC.
  245.  
  246.         Copyright (c) 1986,1987 by James H. LeMay, Michael Burton
  247.         Even though this is source code, it is still protected by the 
  248.         United States Copyright Law.
  249.  
  250.         Current author:
  251.           Jim LeMay, 6341 Klamath Rd., Ft. Worth, TX  76116
  252.             1-(817) 732-7150 (after 1730 PST), CIS 76011,217
  253.         Initial author:
  254.           Michael Burton, 15540 Boot Hill Rd., Hayden Lake, ID 83835
  255.             1-(208)-772-9347 (after 1800 PST)
  256.  
  257.         Special effects concepts were graciously suggested by:
  258.  
  259.           Rick Fothergill, 141 Oak Hill Road, Pittsfield, MA 01201
  260.             Data: 1-(413)-499-7245, CIS 76210,443
  261.             GEnie Mail:  R.FOTHERGILL
  262.  
  263.  
  264.         REVISIONS:
  265.  
  266.         Version 4.0 (12-12-87):
  267.           . Incorporated QWIK40.TPU for full IBM compatibility.
  268.           . Combined all modes into one variable - WindowModes.
  269.           . Added the following procedures/functions:
  270.               SetWindowModes
  271.               RestoreTurboWindow
  272.               PartitionWindow
  273.               PartitionCross
  274.               ClearTitle
  275.               ClearWindow
  276.               HideWindow
  277.               ShowWindow
  278.               MoveWindow
  279.               AccessWindow
  280.               GetLevelIndex
  281.           . Added 7 background constants.
  282.           . MakeWindow now requires a WindowName.
  283.           . TitleWindow requires one more direction parameter.
  284.           . Current WndwStats are kept in TopWndwStat rather than 
  285.               WndwStat[LI].
  286.           . LIcurrent was deleted.
  287.           . Changed BrdrRec type for easier modifications.
  288.           . Added 3 more borders - VdoubleBrdr, ThinSolidBrdr2, UserBrdr2.
  289.           . Changed the following names:
  290.               MixedBrdr     to HdoubleBrdr
  291.               ThinSolidBrdr to ThinSolidBrdr1
  292.               Tattr         to TextAttr     { Assigned by Borland }
  293.  
  294.         Version 4.0a (12-12-87):
  295.           . Set the correct dates for WNDWVARS.TPU and WNDW40.TPU.
  296.