home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / turbopas / wndw55.arc / WNDW55.DOC < prev    next >
Text File  |  1989-08-24  |  98KB  |  2,540 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                            MULTI-LEVEL VIRTUAL WINDOWS
  21.                                    USER'S GUIDE
  22.  
  23.                                    Version 5.5
  24.                                  August 24, 1989
  25.  
  26.  
  27.                Copyright (C) 1988-1989 Eagle Performance Software
  28.                               All Rights Reserved.
  29.  
  30.  
  31.  
  32.                                _______                     
  33.                           ____|__     |               (tm) 
  34.                        --|       |    |------------------- 
  35.                          |   ____|__  |  Association of    
  36.                          |  |       |_|  Shareware         
  37.                          |__|   o   |    Professionals     
  38.                        -----|   |   |--------------------- 
  39.                             |___|___|    MEMBER            
  40.  
  41.  
  42.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  43.  
  44.  
  45.  
  46.                        T A B L E   O F   C O N T E N T S
  47.  
  48.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 4
  49.              Features .  . . . . . . . . . . . . . . . . . . . . . 4
  50.              Using the Manuals . . . . . . . . . . . . . . . . . . 4
  51.              Licensing . . . . . . . . . . . . . . . . . . . . . . 5
  52.              Customer Service  . . . . . . . . . . . . . . . . . . 5
  53.              ASP . . . . . . . . . . . . . . . . . . . . . . . . . 6
  54.  
  55.         2. GETTING STARTED . . . . . . . . . . . . . . . . . . . . 7
  56.              Distribution Files  . . . . . . . . . . . . . . . . . 7
  57.              Demonstration . . . . . . . . . . . . . . . . . . . . 7
  58.  
  59.         3. PROGRAMMING WINDOWS . . . . . . . . . . . . . . . . . . 8
  60.              Basic Programming . . . . . . . . . . . . . . . . . . 8
  61.              Window Definitions  . . . . . . . . . . . . . . . . . 9
  62.              Basic Routines  . . . . . . . . . . . . . . . . . . . 10
  63.              MakeWindow Parameters . . . . . . . . . . . . . . . . 10
  64.              Window Modes  . . . . . . . . . . . . . . . . . . . . 11
  65.                Defaults  . . . . . . . . . . . . . . . . . . . . . 11
  66.                SetWindowModes  . . . . . . . . . . . . . . . . . . 12
  67.                List of Modes . . . . . . . . . . . . . . . . . . . 12
  68.                Shadows . . . . . . . . . . . . . . . . . . . . . . 13
  69.                ZoomMode  . . . . . . . . . . . . . . . . . . . . . 13
  70.                RelMode . . . . . . . . . . . . . . . . . . . . . . 13
  71.                PermMode  . . . . . . . . . . . . . . . . . . . . . 14
  72.                SeeThruMode . . . . . . . . . . . . . . . . . . . . 14
  73.                HiddenMode  . . . . . . . . . . . . . . . . . . . . 15
  74.                VirtualMode . . . . . . . . . . . . . . . . . . . . 15
  75.              Cursor Modes  . . . . . . . . . . . . . . . . . . . . 16
  76.  
  77.         4. WRITING TO WINDOWS  . . . . . . . . . . . . . . . . . . 18
  78.              Direct Writing  . . . . . . . . . . . . . . . . . . . 18
  79.              Cursor and EOS Positioning  . . . . . . . . . . . . . 18
  80.              Clearing  . . . . . . . . . . . . . . . . . . . . . . 19
  81.              Scrolling . . . . . . . . . . . . . . . . . . . . . . 20
  82.              Line Drawing  . . . . . . . . . . . . . . . . . . . . 21
  83.              Custom Routines . . . . . . . . . . . . . . . . . . . 22
  84.  
  85.         5. VIRTUAL WINDOWS . . . . . . . . . . . . . . . . . . . . 24
  86.              Application . . . . . . . . . . . . . . . . . . . . . 24
  87.              Programming . . . . . . . . . . . . . . . . . . . . . 24
  88.  
  89.         6. WINDOW MANAGEMENT . . . . . . . . . . . . . . . . . . . 28
  90.              Access Methods  . . . . . . . . . . . . . . . . . . . 28
  91.              Display Control . . . . . . . . . . . . . . . . . . . 28
  92.              Write Control . . . . . . . . . . . . . . . . . . . . 29
  93.              Window Modes and Flags  . . . . . . . . . . . . . . . 30
  94.              High Speed Screen Design  . . . . . . . . . . . . . . 30
  95.              Multiple Video Pages  . . . . . . . . . . . . . . . . 31
  96.              Multi-Tasking Environments  . . . . . . . . . . . . . 31
  97.  
  98.  
  99.  
  100.  
  101.  
  102.                                        2
  103.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  104.  
  105.  
  106.         7. DATA MANAGEMENT . . . . . . . . . . . . . . . . . . . . 33
  107.              Data Allocation . . . . . . . . . . . . . . . . . . . 33
  108.              Record Handling . . . . . . . . . . . . . . . . . . . 33
  109.  
  110.         8. UTILITY UNITS . . . . . . . . . . . . . . . . . . . . . 36
  111.              Goof Unit . . . . . . . . . . . . . . . . . . . . . . 36
  112.              Wutil Unit  . . . . . . . . . . . . . . . . . . . . . 36
  113.  
  114.         APPENDIX A: Application Products . . . . . . . . . . . . . 38
  115.  
  116.         APPENDIX B: Revision History . . . . . . . . . . . . . . . 40
  117.  
  118.         APPENDIX C: Credits  . . . . . . . . . . . . . . . . . . . 42
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.                                        3
  164.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  165.  
  166.  
  167.    1.  I N T R O D U C T I O N
  168.  
  169.  
  170.    FEATURES
  171.  
  172.    Welcome to WNDW multi-level virtual windows!
  173.  
  174.    You have just obtained a copy of the highest performance window utilities 
  175.    available today for Turbo Pascal 5.0 (TP5).  Both novice and professional 
  176.    programmers will appreciate these simple and very powerful utilities that 
  177.    gives you full window control and management in all text modes.
  178.    
  179.    Here are some of the features you will discover:
  180.  
  181.      . Uses the powerful direct screen writing routines of 
  182.        QWIK55.
  183.      . Up to 254 fixed or virtual windows can be on the screen at 
  184.        one time.
  185.      . Extremely high-speed virtual screens in RAM.
  186.      . Virtual windows are fully updated even if covered!
  187.      . Virtual windows have virtual titles.
  188.      . Fully supported hidden windows saved in RAM.
  189.      . Fully supports all video pages.
  190.      . Adjustable-rate moving, resizing, and scrolling.
  191.      . All windows can be randomly accessed.
  192.      . 28 window-relative writing routines.
  193.      . 15 different border styles with shadows.
  194.      . Full line drawing procedures.
  195.      . Full cursor mode control for each window.
  196.      . Writes in all text modes and column modes.
  197.      . Writes direct to multi-tasking video buffers (MTVB).
  198.      . Only 13k bytes of code if all 69 utilities are used.
  199.      . Used in all other Eagle products.
  200.  
  201.    WNDW is a very high performance window unit with high speed and tight code.  
  202.    All types of windows, including fixed or virtual, hidden or shown, work 
  203.    compatibly in the same package.  With WNDW, you can choose the absolute 
  204.    writing routines of QWIK, the window-relative writing routines of WNDW, and 
  205.    even customize your own.
  206.  
  207.  
  208.    USING THE MANUALS
  209.  
  210.    Disk Based Guides - The manuals for WNDW are on disk so that you can 
  211.    conveniently scan for the topic you are seeking.  You can do this with any 
  212.    list or search utility with a search function.  You can also make a printed 
  213.    copy.  If you have not already printed this manual, refer to the READ.ME 
  214.    file for instructions.  At the present time, no bound manuals are being 
  215.    offered with registration.
  216.  
  217.    User's Guide - This manual, the one your are reading now, assumes that as a 
  218.    programmer you are already familiar with Turbo Pascal 5.0, and that you 
  219.  
  220.  
  221.    Chapter 1, Introduction                                             Page 4
  222.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  223.  
  224.  
  225.    have a working knowledge of your disk operating system (DOS).  It also 
  226.    assumes that you are familiar with QWIK screen utilities in QWIK55.ARC.
  227.    This manual will provide the basic instructions for creating and managing 
  228.    multi-level windows.  You can even copy examples from this file direct to 
  229.    the Turbo editor for testing.
  230.  
  231.    Reference Guide - This manual describes in detail all procedures, functions 
  232.    and variables used in WNDW.  It is alphabetically arranged for easy access 
  233.    in a format similar to the TP5 manual.  Use this manual when you have 
  234.    become familiar with the basic principles in the User's guide.
  235.  
  236.  
  237.    LICENSING
  238.  
  239.    Registration - These routines and the documentation have been released for 
  240.    distribution as Shareware.  You have been given the chance to sample the 
  241.    full capability of WNDW without risk!  If you find that WNDW is a valuable 
  242.    tool, then you are expected to register.  You will find a reasonable 
  243.    licensing schedule found in LICENSE.ARC to meet private or commercial 
  244.    needs.  When registering, be sure to specify the version for Turbo Pascal 
  245.    (such as TP4 or TP5) you wish to receive.
  246.  
  247.    Source Code - All registered users will receive source code when the signed 
  248.    license agreement is returned with the registration.  All source code 
  249.    compiles under TP5 as well as TP4.  The compiled units in the distributed 
  250.    file were compiled with TP5 and only work in TP5.
  251.  
  252.  
  253.    CUSTOMER SERVICE
  254.  
  255.    If you have questions, comments, or suggestions, the Eagle can be contacted 
  256.    by four means - (1) CompuServe, (2) telephone, (3) The Eagle BBS, or 
  257.    (4) mail.
  258.  
  259.    CompuServe - The most dependable way to contact the Eagle is through 
  260.    CompuServe.  James (Jim) H. LeMay has written the TP5 version of QWIK, but 
  261.    the person to contact is Jordan Gallagher who can be reached on the Borland
  262.    Forum by typing GO BPROGA from the CompuServe main menu.  You will enter
  263.    the Forum for Turbo Pascal.  You can contact Jordan with his PPN number of
  264.    73557,2342.  Messages can also be left through EasyPlex.
  265.  
  266.    Telephone - Jordan can also be reached by phone at (214) 539-7855 on
  267.    weekdays and Saturday from 9:00 a.m. to 8:00 p.m CST.
  268.  
  269.    The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539-
  270.    9878, 1200/2400 N81.
  271.  
  272.    Mail - For registration or problems, please write:
  273.  
  274.        Eagle Performance Software
  275.        P.O. Box 292786
  276.        Lewisville, TX  75029-2786
  277.  
  278.    In your written request for resolving problems, be sure to include:
  279.  
  280.  
  281.    Chapter 1, Introduction                                             Page 5
  282.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  283.  
  284.  
  285.  
  286.      . A 5 1/4 inch diskette of compilable source code of the problem.
  287.      . The Eagle product and version number.
  288.      . The computer make and model.
  289.      . The type of video card, video monitor and keyboard.
  290.  
  291.  
  292.    ASP
  293.  
  294.    WNDW is a shareware program conforming to the standards of the Association 
  295.    of Shareware Professionals (ASP).  You can get more information about ASP 
  296.    by writing to:
  297.     
  298.      Association of Shareware Professionals
  299.      P.O. Box 5786
  300.      Bellevue,WA 98006
  301.  
  302.    This program is produced by a member of the Association of Shareware
  303.    Professionals (ASP).  ASP wants to make sure that the shareware principle
  304.    works for you.  If you are unable to resolve a shareware-related problem
  305.    with an ASP member by contacting the member directly, ASP may be able to
  306.    help.  The ASP Ombudsman can help you resolve a dispute or problem with an
  307.    ASP member, but does not provide technical support for member's products.
  308.    Please write to:
  309.  
  310.      ASP Ombudsman
  311.      P.O. Box 5786
  312.      Bellevue,WA 98006
  313.  
  314.    or send a CompuServe message via EasyPlex to ASP Ombudsman 7007,3536.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.    Chapter 1, Introduction                                             Page 6
  343.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  344.  
  345.  
  346.    2.  G E T T I N G   S T A R T E D
  347.  
  348.    This section will acquaint you with the files on distribution disk and show 
  349.    you a couple of demonstrations to quickly see what WNDW can accomplish.
  350.  
  351.  
  352.    DISTRIBUTION FILES
  353.  
  354.    In this version, WNDW55.ARC contains:
  355.  
  356.      Read.   .me:   Note of printing instructions for manual.
  357.      KeyB    .tpu:  Keyboard unit for WNDWMGR.PAS demo.               
  358.      Goof    .pas:  Unit to display errors.
  359.      Qwik55  .tpu:  Unit for quick screen writing.
  360.      Strs    .tpu:  Unit from QWIK55 for number-to-string conversions.
  361.      Wutil   .tpu:  Independent utilities unit used in WNDW.
  362.      W55-var .inc:  This file is the actual source code which lists
  363.                     all of the types, constants, and variables used 
  364.                     for WNDW55.TPU.
  365.      Wndw55- .pas:  Shows the interface portion of WNDW55.
  366.      Wndw55  .tpu:  This unit has the full power of all of its
  367.                     capabilities.  Please note that because 
  368.                     WNDW55.TPU uses W55-VAR.INC, MaxWndw,
  369.                     MaxVirtualWndw, MaxPageUsed, and the WindowNames 
  370.                     names have all been assigned.  In order to make 
  371.                     any changes in the data requirements, the complete 
  372.                     source code will be required. 
  373.      Wndw55  .doc:  This document - a user's guide to WNDW.
  374.      WndwRef .doc:  WNDW Reference Guide document covering each 
  375.                     routine and variable in detail.
  376.      WndwDemo.pas:  Demo of WNDW55.TPU and QWIK55.TPU which shows
  377.                     screen design performance.
  378.      WndwMgr .pas:  Demo of full window management.
  379.      License .arc:  ARC file containing license agreement and ordering 
  380.                     details.
  381.  
  382.  
  383.    DEMONSTRATION
  384.  
  385.    To get the feeling of the speed and features of WNDW, let's run the 
  386.    demonstration programs that came with the utilities.  Do the following 
  387.    steps:
  388.  
  389.      1. Copy QWIK55.TPU to QWIK.TPU.
  390.      2. Copy WNDW55.TPU to WNDW.TPU
  391.      3. If you are running programs in a multi-tasking
  392.         environment, instruct the environment that you are NOT
  393.         writing direct to the screen.  Also set text pages to 2.
  394.      4. Make, compile and run WNDWDEMO.PAS to get a feel for 
  395.         screen design performance and speed.  
  396.      5. Make, compile and run WNDWMGR.PAS to get a feel for true 
  397.         virtual windows and window management.  Press Alt-1 to 
  398.         access the bottom window.  With Scroll Lock on, it can be 
  399.         moved, resized and scrolled.
  400.  
  401.  
  402.  
  403.    Chapter 2, Getting Started                                          Page 7
  404.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  405.  
  406.  
  407.    3.  P R O G R A M M I N G   W I N D O W S
  408.  
  409.    This sections will get you familiar with the basics of window programming 
  410.    by starting with very basic windows and then taking you step-by-step 
  411.    through the variety of options and modes that are available.
  412.  
  413.  
  414.    BASIC PROGRAMMING
  415.  
  416.    First Program - Let's write a short program to see how simple it is to 
  417.    write with WNDW.  While in the TP editor, enter the following code:
  418.  
  419.      EXAMPLE 1:  Your first window
  420.      ----------------------------------------------------------------------
  421.      {$M 16384,8000,8000 }                                                 
  422.      uses Crt,Qwik,Wndw,Goof;
  423.      begin
  424.        InitWindow (LightGrayBG,true);    { Initialize and Clear window }
  425.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  426.        WWriteC (7,'Making windows is easy!');
  427.      end.
  428.  
  429.    Assuming you have already copied QWIK55.TPU to QWIK.TPU and WNDW55.TPU to
  430.    WNDW.TPU, make and run the code.  You can then see these results:
  431.  
  432.       . The base window is cleared with Black on LightGray attributes.
  433.       . The window is placed at absolute row 5, column 20
  434.       . The window size is 15 rows high and 40 columns wide.
  435.       . The window text color is White on a Blue background.
  436.       . The window border color is Cyan on a Blue background.
  437.       . The border is the Single line width style.
  438.       . The window name is aWindow.
  439.       . The message was centered on window-relative row 7.
  440.       
  441.    Row/Col vs. X/Y - You probably noticed that the row parameter is first and 
  442.    the column parameter is second.  Since WNDW is entirely for text modes, it 
  443.    is more intuitive to specify the row first and the column second just like 
  444.    any word processor.  The X/Y scheme is better suited for graphics.
  445.  
  446.    Attributes - Notice that our example uses the constant "BlueBG".  WNDW uses 
  447.    QWIK which provides eight convenient background color constants to use 
  448.    along with Turbo's 16 foreground colors.  The same names are used, but the 
  449.    "BG" suffix is added: 
  450.  
  451.       BlackBG       RedBG
  452.       BlueBG        MagentaBG
  453.       GreenBG       BrownBG
  454.       CyanBG        LightGrayBG
  455.  
  456.    These allow WNDW to make the most of Turbo's constant folding.  By simply 
  457.    adding the foreground and background constants together, the compiler saves 
  458.    the result as a single word.  And, by simply reading the MakeWindow 
  459.    statement, what you see is what you get (WYSIWYG). 
  460.  
  461.    Protected Underlay - That first program was pretty simple wasn't it?  
  462.  
  463.  
  464.    Chapter 3, Programming Windows                                      Page 8
  465.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  466.  
  467.  
  468.    Several things happened that you probably didn't notice.  The area under 
  469.    the window, called the underlay, was actually saved.  Later on when the 
  470.    window is no longer needed, it can be removed by restoring the underlay.  
  471.    This makes it just like a sheet of paper on a desk.  Let's add some 
  472.    statements to show if the underlay is really protected.  In addition, let's 
  473.    add a little more pizazz to the window by adding a shadow, zoom effect, and 
  474.    a title:
  475.  
  476.      EXAMPLE 2:  Protected underlay
  477.      ----------------------------------------------------------------------
  478.      {$M 16384,8000,8000 }                                                 
  479.      uses Crt,Qwik,Wndw,Goof;
  480.      begin
  481.        InitWindow (LightGrayBG,true); 
  482.        WWriteC (12,'Base Window');
  483.        SetWindowModes (ZoomMode+ShadowRight);
  484.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  485.        TitleWindow (Top,Left,Yellow+BlueBG,' My First Window ');
  486.        WWriteC (7,'Making windows is easy!');
  487.        delay (2000);
  488.        RemoveWindow;   { Remove the window and restore underlay. }
  489.      end.
  490.  
  491.    Did you see that the message "Base Window" was still there?  In fact that 
  492.    entire underlay was protected because it was saved in the heap while we 
  493.    were writing on the CRT.  In addition:
  494.  
  495.       . The window modes controlled the Shadow and Zoom effect.
  496.       . The title is placed on the Top border, Left justified, with Yellow
  497.         on Blue attributes.
  498.       . The "Base Window" message was centered on window-relative row 12.
  499.  
  500.    Basic Principles - Was that simple enough for you?  Well, you'll be glad to 
  501.    know that you have already tried all the basic principles to making 
  502.    windows.  And the rest is just that easy.  But you haven't seen anything 
  503.    yet.
  504.  
  505.  
  506.    WINDOW DEFINITIONS
  507.  
  508.    Window - Just what is a window anyway?  It's an area reserved on the screen 
  509.    as a frame of reference to write text.  Right on the screen, the power of 
  510.    this program allows you to move, rearrange, hide, move, and resize, without 
  511.    losing any data.
  512.  
  513.    View - In virtual windows, this window text area is also called the view.  
  514.    More about virtual windows is explained later.
  515.  
  516.    Border - The border is the lines surrounding the window or view to clearly 
  517.    separate the window contents from other areas of the CRT.  However, a 
  518.    window does not require a border.
  519.  
  520.    Title - Conveniently, a window can be titled on the border - either the top 
  521.    or the bottom.  The title area extends the full length of the window not 
  522.    including the two vertical borders.  The title is written at a border-
  523.  
  524.  
  525.    Chapter 3, Programming Windows                                      Page 9
  526.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  527.  
  528.  
  529.    relative location.  If a window does not have a border, then the title area 
  530.    is just the top or bottom row of the window text area.
  531.  
  532.    Cursor - Each window has its own cursor location and mode (shape).
  533.  
  534.    Shadow - To give a window that off-the-screen appearance, a shadow can be 
  535.    added onto the outer edge of the window or window border.
  536.  
  537.    Generally Speaking - Throughout this document, the word "window" will 
  538.    loosely refer to all of the above parts as the full window.  It should be 
  539.    understood that all writing to the windows uses coordinates relative to the 
  540.    upper left corner of the window text area which is (1,1) exclusive of the 
  541.    border.
  542.  
  543.  
  544.    BASIC ROUTINES
  545.  
  546.    Basic Routines - There are five basic procedures that are fundamental to 
  547.    creating multi-level windows:
  548.          
  549.      InitWindow     - Initializes global data for the program.
  550.      SetWindowModes - Determines what types of windows are made.
  551.      MakeWindow     - Creates the window.
  552.      TitleWindow    - Places titles on the window.
  553.      RemoveWindow   - Removes window from CRT and memory.
  554.  
  555.    InitWindow - First, before any window procedures are used, InitWindow 
  556.    should be executed to initialize all global data for the entire program.  
  557.    It only needs to be done once.  
  558.           
  559.      InitWindow (Wattr: integer; ClearScr: boolean)
  560.  
  561.    The initial base window has no border and the window attribute is Wattr.  
  562.    You can optionally clear the window by setting ClearScr to TRUE.  The 
  563.    procedure initializes over 50 variables.  For details, you can examine the 
  564.    source code.
  565.  
  566.  
  567.    MAKEWINDOW PARAMETERS
  568.  
  569.    Declaration - The MakeWindow procedure actually makes the window on the 
  570.    screen.  Let's take a look at its declaration:
  571.  
  572.       MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  573.                   BrdrSel: Borders; WindowName: WindowNames)
  574.  
  575.    The procedure's parameters control location, size, attributes, border 
  576.    style, and window name.  Notice that the size is expressed as Rows/Cols 
  577.    rather than another (Row2,Col2) coordinate.  This makes it very easy to 
  578.    change the location without having to recalculate the size.  
  579.  
  580.    Self-Centering Window - There is a very simple method to self-center a
  581.    window on a screen - simply set the appropriate Row and/or Col parameter to
  582.    0.  If Row is 0, the window will be centered to the current height of the
  583.    screen.  Likewise, if Col is 0, it will be centered horizontally.  So
  584.  
  585.  
  586.    Chapter 3, Programming Windows                                      Page 10
  587.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  588.  
  589.  
  590.    there's no need to calculate sizes!  This also works for RelMode which will
  591.    be discussed later.
  592.  
  593.    Attributes - Wattr and Battr are the attributes for the window text area 
  594.    and border, respectively.  The attributes that are recognized are the same 
  595.    ones used in QWIK - even SameAttr is supported.
  596.  
  597.    Border Styles - There are 15 different border styles that can be used for 
  598.    the border, including two custom borders and even no border at all.  Here 
  599.    is the list of Border names that are predefined:
  600.  
  601.      NoBrdr         - No border at all.  Just the text area.
  602.      BlankBrdr      - Blank character on all sides.
  603.      SingleBrdr     - Single lines on all sides.
  604.      DoubleBrdr     - Double lines on all sides.
  605.      HdoubleBrdr    - Horizontal double lines.  Single vertical lines.
  606.      VdoubleBrdr    - Vertical double lines.  Single horizontal lines.
  607.      SolidBrdr      - Solid box character on all sides.
  608.      EvenSolidBrdr  - Vertical solid box.  Horizontal half box.
  609.      ThinSolidBrdr1 - Half box on all sides.  Squeezed horizontally.
  610.      ThinSolidBrdr2 - Half box on all sides.  Squeezed vertically.
  611.      LhatchBrdr     - Light hatch character on all sides.
  612.      MhatchBrdr     - Medium hatch character on all sides.
  613.      HhatchBrdr     - Heavy hatch character on all sides.
  614.      UserBrdr1      - User defined border.
  615.      UserBrdr2      - User defined border.
  616.  
  617.    All of the borders except the user borders are reserved for use in future 
  618.    Eagle products.  UserBrdr1 and UserBrdr2 may be customized to your needs.  
  619.    Each border has 15 different parts for the line drawing set including tees 
  620.    and interior lines.
  621.  
  622.    Tip: Hatch Borders - Since MDA and VGA both use a 9x16 character cell size, 
  623.    the hatch characters (ASCII 176, 177, 178) are only 8x16 in a 9x16 cell.  
  624.    This unfortunately produces a horizontal gap between the characters not 
  625.    seen on the CGA.  Be aware of the effect.
  626.  
  627.    Window Name - The name of each window should be different in order to 
  628.    uniquely identify the window for window management.  But since our simple 
  629.    test program only displayed the window momentarily, the window name is not 
  630.    significant and did not need to be unique.  So, the generic name "aWindow" 
  631.    was used.  The name Window0 is used to identify the initial base window 
  632.    which is the full CRT screen.
  633.  
  634.  
  635.    WINDOW MODES
  636.  
  637.    Defaults - Without needing to specify anything, the window is created with 
  638.    several defaults.  Let's see what they are:
  639.  
  640.      . Fixed size and placed absolute to the CRT.
  641.      . Shown on the CRT.
  642.      . The underlay is saved.
  643.      . No shadow or zoom effect.
  644.      . No virtual screen.
  645.  
  646.  
  647.    Chapter 3, Programming Windows                                      Page 11
  648.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  649.  
  650.  
  651.      . Cursor is turned on with the default cursor mode.
  652.      . Window is cleared.
  653.      . Moving and Accessing is permitted.
  654.  
  655.    Well, if these are all defaults, then that means they can be changed.  And 
  656.    they can.  We've already found out how to add shadow and zoom.  Let's try 
  657.    changing some others and see what happens.  Enter the following code into 
  658.    the editor:
  659.  
  660.      EXAMPLE 3:  Different modes and a hidden window
  661.      ----------------------------------------------------------------------
  662.      {$M 16384,8000,8000 }                                                 
  663.      uses Crt,Qwik,Wndw,Goof;                                     
  664.      begin                                                                 
  665.        InitWindow (LightGrayBG,true);
  666.        SetWindowModes (HiddenMode or ZoomMode or CursorOffMode);
  667.        MakeWindow (0,0,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  668.        WWriteC (12,'Where is it?');
  669.        WriteToHidden (Window1);     { Write to the hidden window.}
  670.        TitleWindow (Bottom,Right,Yellow+BlueBG,' My Second Window ');
  671.        WWriteC (3,'Here it is ...');
  672.        WBrdrH (7);                  { Add an extra horizontal border.}
  673.        WWriteC (10,'It was hidden!');
  674.        delay (2000);
  675.        ShowWindow (Window1);        { Put it back on the screen. }
  676.        delay (2000);
  677.        RemoveWindow;
  678.      end.
  679.  
  680.    When you run it, the window is immediately created.  But instead we see the 
  681.    message "Where is it?".  And to answer that question, the window was 
  682.    created in RAM instead of on the CRT.  In addition, the code also wrote 
  683.    messages direct to the hidden window.  The window remains hidden until it 
  684.    is called which we did with ShowWindow.  Afterward, we removed it from 
  685.    memory with RemoveWindow.  I'll bet you didn't know that you have already 
  686.    done some writing to a virtual screen.  That's right - the hidden window 
  687.    was a virtual screen!  Pretty easy, huh?  And it was done by simply setting 
  688.    a mode.  
  689.  
  690.    SetWindowModes - This procedure can be used any time prior to MakeWindow.  
  691.    It only needs to be done once since the value is retained in WindowModes 
  692.    until changed again.
  693.  
  694.    List of Modes - Did you notice the zoom effect this time and that the 
  695.    cursor was turned off?  Let's take a look at all the available modes:
  696.  
  697.      Mode Constant  Description
  698.      -------------  -----------------------------------------------
  699.      ShadowLeft     Shadow on the left side
  700.      ShadowRight    Shadow on the right side
  701.      ZoomMode       Zoom effect on Make, Show and AccessWindow
  702.      CursorOffMode  Leaves cursor off for window
  703.      RelMode        Window-relative frame of reference, no underlay
  704.      PermMode       Can't be moved or removed, no underlay
  705.      SeeThruMode    Doesn't clear screen inside window
  706.  
  707.  
  708.    Chapter 3, Programming Windows                                      Page 12
  709.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  710.  
  711.  
  712.      HiddenMode     Create window as hidden
  713.      VirtualMode    Create Virtual window and screen 
  714.      NoHideMode     Ignores request to hide window
  715.      NoAccessMode   Ignores request to access window
  716.      NoMoveMode     Ignores request to move/resize window
  717.  
  718.    We've already seen what the first four can do.  Let check to see what the 
  719.    others can do.
  720.  
  721.    ShadowLeft/ShadowRight - When placed on the CRT, the window gets a shadow 
  722.    on either the left or right side as well as the bottom.  For good human 
  723.    factors, it is recommended that the shadow only be used for the top window 
  724.    for clarity.  Shadows are fully supported at any level for serial-access 
  725.    windows.  (However, for random-access, the shadows are permitted, but if a 
  726.    window is pulled out from under it, the corners will not be updated at that 
  727.    moment.)  Tip: Place windows with shadows correctly to prevent wrap-around.
  728.  
  729.    ZoomMode - When a window is created, shown, or accessed on the CRT with 
  730.    this mode, it produces a zoom effect.  It is conveniently suppressed for 
  731.    hidden windows.
  732.  
  733.    RelMode - This is the simplest of all modes.  It enables you to set up a 
  734.    window within a window.  It simply overwrites the window, but produces a 
  735.    handy window-relative frame of reference to draw borders, write text or 
  736.    whatever.  It's a worry-free mode.  To get out of RelMode, you can simply 
  737.    switch to another window, or you can return to the parent window with 
  738.    RemoveWindow.  RelMode is only temporary and no stats are saved.  Let's 
  739.    modify the last example and try this out:
  740.  
  741.      EXAMPLE 4:  RelMode window
  742.      ----------------------------------------------------------------------
  743.      {$M 16384,8000,8000 }                                                 
  744.      uses Crt,Qwik,Wndw,Goof;                                     
  745.      begin                                                                 
  746.        InitWindow (LightGrayBG,true);
  747.        SetWindowModes (HiddenMode or ZoomMode or CursorOffMode);
  748.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  749.        WWriteC (12,'Where is it?');
  750.        WriteToHidden (Window1);     { Write to the hidden window.}
  751.        TitleWindow (Bottom,Right,Yellow+BlueBG,' My Second Window ');
  752.        SetWindowModes (RelMode);
  753.        MakeWindow (3, 0, 3,32,SameAttr,SameAttr,HdoubleBrdr,aWindow);
  754.        TitleWindow (Top,Center,SameAttr,' My Answer: ');
  755.        WWriteC (1,'Here it is ...');
  756.        delay (2000);
  757.        ShowWindow (Window1);        { Put it back on the screen. }
  758.        WWriteC (10,'It was hidden!');
  759.      end.
  760.  
  761.    Notice that the (Row,Col) location was relative to the parent window, 
  762.    Window1.  Even the title as well as the text was placed in RelMode.  The 0
  763.    value for Col centered it across the width of the window (not the screen).
  764.    Once the window was shown, the window coordinates and modes were restored 
  765.    to the parent window.  The message appeared correctly on row 10 of the 
  766.    parent window.  Notice also that we didn't bother to use RemoveWindow since 
  767.  
  768.  
  769.    Chapter 3, Programming Windows                                      Page 13
  770.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  771.  
  772.  
  773.    we were finished and wanted to take a closer look at what we created.
  774.  
  775.    PermMode - When creating your initial screen for a program, the underlay 
  776.    probably does not need to be saved.  This mode enables you to create 
  777.    windows without saving the underlay so the screen is simply overwritten  - 
  778.    perfect for initial screens by increasing speed and saving memory.  All the 
  779.    window stats are still saved for future use.  Keep in mind two rules for 
  780.    this mode.  First, all PermMode windows must be the first ones created.  
  781.    And second, use discretion when accessing the window to make sure it is not 
  782.    covered by another window before writing to it.  Let's try an example:
  783.  
  784.      EXAMPLE 5:  PermMode window
  785.      ----------------------------------------------------------------------
  786.      {$M 16384,8000,8000 }                                                 
  787.      uses Crt,Qwik,Wndw,Goof;                                     
  788.      begin                                                                 
  789.        InitWindow (LightGrayBG,false);   { No need to clear screen }
  790.        SetWindowModes (PermMode);
  791.        MakeWindow ( 1, 1,12,80,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  792.        TitleWindow (Top,Left,Yellow+BlueBG,' Input Window ');
  793.        MakeWindow (13, 1,13,80,White+GreenBG,GreenBG,HdoubleBrdr,Window2);
  794.        TitleWindow (Top,Left,Yellow+GreenBG,' Output Window ');
  795.        WWrite ( 1, 1,'Output data.');
  796.        AccessWindow (Window1);
  797.        WWrite ( 1, 1,'Input data.');
  798.      end.
  799.  
  800.    Since we were designing the initial screen, the ClearScr parameter in 
  801.    InitWindow was set to FALSE.  Did you notice that writing back to Window1 
  802.    was no problem?   You've just had your first shot at window management!  
  803.    AccessWindow will let you write to any window by name.  But if RemoveWindow 
  804.    is used on PermMode windows, the window record is simply dropped from the 
  805.    stack and the screen appears unaltered.
  806.  
  807.    SeeThruMode - If there is a portion of the current screen that needs to be 
  808.    captured to become a part of the window itself, this mode creates the 
  809.    border but simply skips clearing contents the window.  This is done only 
  810.    when the window is first created.
  811.  
  812.      EXAMPLE 6:  SeeThruMode window
  813.      ----------------------------------------------------------------------
  814.      {$M 16384,8000,8000 }                                                 
  815.      uses Crt,Qwik,Wndw,Goof;                                     
  816.      begin                                                                 
  817.        InitWindow (LightGrayBG,true); 
  818.        WWriteC (12,'My message');
  819.        SetWindowModes (SeeThruMode);
  820.        MakeWindow (10,26, 5,30,White+BlueBG,Cyan+BlueBG,SingleBrdr,aWindow);
  821.        TitleWindow (Top,Left,Yellow+BlueBG,' Captured Text ');
  822.        delay (2000);
  823.        RemoveWindow;
  824.      end.
  825.  
  826.    When running this program, it appears that a border was just placed over 
  827.    the message "My message".  But in fact, it's really a part of the new top
  828.  
  829.  
  830.    Chapter 3, Programming Windows                                      Page 14
  831.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  832.  
  833.  
  834.    window.  So, if the window is moved, the contents move as well.
  835.  
  836.    HiddenMode - In example 3, we plunged right into making hidden windows and 
  837.    it was easy, too.  As it was explained, the hidden window is actually a 
  838.    virtual window in the heap to which you can write at any time.  Since 
  839.    virtual screen writing is so very quick, you can even design full screens 
  840.    in an instant and then display them on the CRT.  Once a window is shown, it 
  841.    can always be hidden again with HideWindow.  This is explained further in 
  842.    Section 6 under Window Management.
  843.  
  844.    VirtualMode - This mode is very simple but powerful and enables you to 
  845.    create a virtual window.  A virtual screen is kept in RAM, but we can view 
  846.    any portion of it on the CRT.  As you would hope, it's still quite simple:
  847.  
  848.      EXAMPLE 7:  VirtualMode window
  849.      ----------------------------------------------------------------------
  850.      {$M 16384,8000,8000 }                                                 
  851.      uses Crt,Qwik,Wndw,Goof;                                     
  852.      begin                                                                 
  853.        InitWindow (LightGrayBG,true); 
  854.        SetWindowModes (VirtualMode);
  855.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  856.        WriteToVirtual (Window1);
  857.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  858.        WWrite ( 1, 1,'Upper left corner');
  859.        WWriteC (7,'This message is centered on the screen');
  860.        VUpdateWindow;            { Update the complete window on the CRT. }
  861.        WriteToCRT;               { Return to writing on the CRT. }
  862.      end.
  863.  
  864.    VUpdateWindow is the workhorse for virtual windows.  It copied a portion of 
  865.    the virtual screen, the virtual titles, and the cursor location back on the 
  866.    CRT.  You probably noticed that the long message seemed to be cut off.  But 
  867.    actually we are only looking at a portion of an 80x25 virtual screen.  So 
  868.    the message was indeed centered.  You can write direct to the virtual 
  869.    screen and view any portion you want.  We have just sampled some of the 
  870.    most powerful features of WNDW with very little effort.
  871.  
  872.    Restrictive Modes - NoHideMode, NoAccessMode, and NoMoveMode are modes that 
  873.    restrict window management.  These modes are covered in the Window 
  874.    Management section.
  875.  
  876.    Back to Defaults - What about getting back to the default modes after they 
  877.    have been changed?  Just use SetWindowModes (0).
  878.  
  879.    Combinations - Just about any combination of modes can put together.  Just 
  880.    sum them together in the SetWindowModes procedure.  However, there are some 
  881.    combinations that will not be valid.  In fact, the procedure corrects your 
  882.    mistakes.  Here's a list of the modes showing invalid combinations:
  883.  
  884.      Set Mode       Invalid Combination With     Correction
  885.      -------------  ---------------------------  -------------------
  886.      ShadowLeft     ShadowRight                  ShadowRight
  887.      ShadowRight    ShadowLeft                   ShadowRight
  888.      ZoomMode       SeeThruMode                  Ignores ZoomMode
  889.  
  890.  
  891.    Chapter 3, Programming Windows                                      Page 15
  892.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  893.  
  894.  
  895.      RelMode        Hidden, Virtual or PermMode  RelMode
  896.      PermMode       HiddenMode                   PermMode
  897.                     RelMode                      RelMode
  898.      SeeThruMode    ZoomMode                     Ignores ZoomMode
  899.      HiddenMode     RelMode or PermMode          RelMode or PermMode
  900.      VirtualMode    RelMode                      RelMode
  901.  
  902.  
  903.    CURSOR MODES
  904.  
  905.    Every Window - WNDW fully supports the cursor mode control of QWIK.  In 
  906.    fact, every window has its own cursor mode.  The setting is controlled by 
  907.    SetCursorDefault.  Here's how it works:
  908.  
  909.      EXAMPLE 8:  Cursor modes in each window
  910.      ----------------------------------------------------------------------
  911.      {$M 16384,8000,8000 }                                                 
  912.      uses Crt,Qwik,Wndw,Goof;                                     
  913.      begin                                                                 
  914.        InitWindow (LightGrayBG,true); 
  915.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  916.        SetCursorDefault (CursorBlock);
  917.        MakeWindow (9,30,15,40,White+BrownBG,BrownBG,EvenSolidBrdr,Window2);
  918.        WWrite ( 1, 1,'Upper left corner');
  919.        GotoEos;
  920.        delay (2000);
  921.        RemoveWindow;
  922.        delay (2000);
  923.        RemoveWindow;
  924.      end.
  925.  
  926.    When you ran this code, you noticed that top window had a block cursor.  
  927.    When the window was removed, the cursor mode was restored to new top 
  928.    window as an underline.  Just like SetWindowModes, the value is saved in 
  929.    CursorDefault until changed.
  930.  
  931.    Initialization - When WNDW is used, some initialization code tests the
  932.    start up cursor mode.  On MDA cards, it corrects the improper CGA default.
  933.    In addition, if the cursor is hidden, WNDW forces the cursor to an
  934.    underline, but the original cursor is still in CursorInitial.
  935.  
  936.    Initial Window - InitWindow sets CursorDefault to the current cursor mode 
  937.    which is used for all subsequent windows and Window0.  If you even want 
  938.    Window0 to have a different cursor mode and default, simply use 
  939.    Qwik.SetCursor before InitWindow.
  940.  
  941.    Mutiple PermMode Windows - If you have several PermMode windows, to get the
  942.    cursor to appear in one of the windows, you can use AccessWindow at any
  943.    time.  (Be sure that no other normal windows are covering it!)  If it also
  944.    has a virtual screen, you can also use the VUpdate routines at any time,
  945.    but only the last window accessed by AccessWindow or the like can display
  946.    the cursor.  This is controlled by the value of CrtWI.  As a short-cut, you
  947.    can also manually set CrtWI to the level index of the PermMode window you
  948.    want prior to a VUpdate routine such as:
  949.  
  950.  
  951.  
  952.    Chapter 3, Programming Windows                                      Page 16
  953.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  954.  
  955.  
  956.      AccessWindow (Window2);     { Window 2 is permanent and virtual }
  957.      { ... }                     { CrtWI is equal to level of Window2 }
  958.      WriteToVirtual (Window3);   { Window 3 is permanent and virtual }
  959.      CrtWI := WI;                { Alter active window to current Window 3 }
  960.      VUpdateCursor;              { Now cursor appears in Window 3 not 2 }
  961.  
  962.  
  963.    CursorOffMode - So, what's the difference between using 
  964.    SetWindowModes(CursorOffMode) or SetCursorDefault(CursorOff)?  For 
  965.    technical reasons, in virtual windows, the cursor could be turned on and 
  966.    off.  If CursorOff is used, then the cursor could be turned on having an 
  967.    overbar cursor ($0000).  It's easier to use CursorOffMode.
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.    Chapter 3, Programming Windows                                      Page 17
  1014.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1015.  
  1016.  
  1017.    4.  W R I T I N G   T O   W I N D O W S 
  1018.  
  1019.    WNDW has several window-relative routines designed to write in the windows, 
  1020.    including direct writing, cursor and EOS positioning, clearing, scrolling, 
  1021.    and line drawing.  They work in all types of windows, including hidden and 
  1022.    virtual.  To do this, the routines access the top window record (TWS or 
  1023.    TopWndwStat) that keeps information about the current window.  For a 
  1024.    breakdown on the window record, see Data Structure in WNDWREF.DOC.  Each of 
  1025.    these groups of routines are discussed below.
  1026.  
  1027.  
  1028.    DIRECT WRITING
  1029.  
  1030.    Window Relative - Rather than using Qwrite to write to windows, three 
  1031.    routines are provided to use window-relative coordinates.  You have already 
  1032.    used two of them.  The attribute used is the window attribute TWS.WndwAttr.
  1033.  
  1034.      WWrite   (Row,Col: byte; aStr: string)
  1035.      WWriteC  (Row: byte; aStr: string)        
  1036.      WWriteA  (Row,Col: byte; ArrayLength: word; VAR aStr)
  1037.  
  1038.    WWriteC centers the string within the window while WWriteA is for arrays 
  1039.    or substrings.  These routines are actually externals that interface the 
  1040.    QWIK routines using TWS.
  1041.  
  1042.    QWIK Support - You will be pleased to know that QWIK is fully integrated 
  1043.    and supported in WNDW like your favorite use of SameAttr and the EOS 
  1044.    marker.  Wherever an attribute is needed, SameAttr can be used.  And all 
  1045.    the window-relative writing routines support the EOS.  For example, to 
  1046.    chain after a WWrite statement, just do the following:
  1047.  
  1048.      WWrite (1,2,'My message');
  1049.      QwriteEos (SameAttr,' is here');
  1050.  
  1051.    This would write the message "My message is here" on window-relative row 1, 
  1052.    column 2, also indicated as (1,2), with the current window attribute.
  1053.  
  1054.    Changing Attributes - Suppose you do not want to use the current window 
  1055.    attribute.  How can it be altered?  The QwriteEos example above is one way.  
  1056.    But since the original window attribute is saved in TWS.OrigAttr, it can be 
  1057.    changed temporarily by doing the following:
  1058.  
  1059.      with TWS do
  1060.        begin
  1061.          WndwAttr := NewAttr;       { Assign new attribute }
  1062.          WWrite (1,1,'New Attribute'); 
  1063.          WndwAttr := OrigAttr;      { Restore window attribute }
  1064.        end;
  1065.  
  1066.  
  1067.    CURSOR AND EOS POSITIONING
  1068.  
  1069.    WNDW has eight routines to locate and move either the cursor or the EOS 
  1070.    marker relative to the current window.
  1071.  
  1072.  
  1073.  
  1074.    Chapter 4, Writing To Windows                                       Page 18
  1075.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1076.  
  1077.  
  1078.  
  1079.    Cursor Location - Just like WhereR/WhereC, the following functions return 
  1080.    the current cursor location:
  1081.  
  1082.      WWhereR - Window-relative row.
  1083.      WWhereC - Window-relative column.
  1084.  
  1085.    Cursor Movement - Similar to GotoRC and GotoEos, the following procedures 
  1086.    move the cursor:
  1087.  
  1088.      WGotoRC  - Move to window-relative row and column.
  1089.      WGotoEos - Move cursor to match EOS marker location.
  1090.  
  1091.    So, what's the difference between GotoEos and WGotoEos?  The latter does 
  1092.    two more operations - (1) the cursor location is saved in TWS, and (2) the 
  1093.    cursor mode is tested in virtual windows to be turned on or off.  To be 
  1094.    consistent in windows, it is easier to use WGotoEos.
  1095.  
  1096.    EOS Location - Similar to EosR and EosC, the following functions return the 
  1097.    current EOS location:
  1098.  
  1099.      WEosR - Window-relative row.
  1100.      WEosC - Window-relative column.
  1101.  
  1102.    EOS Movement - Similar to EosToRC and QEosLn, the following procedures move 
  1103.    the EOS marker:
  1104.  
  1105.      WEosToRC - Move EOS to window-relative row and column.
  1106.      WEosLn   - Move EOS to column 1 of the next row with a possible 
  1107.                 scroll if past the last window row.
  1108.  
  1109.  
  1110.    CLEARING
  1111.  
  1112.    WNDW provides seven window-relative routines for clearing portions of the 
  1113.    window including lines, titles, fields, and even the full window with the 
  1114.    window attribute TWS.WndwAttr.  SameAttr becomes very handy when complex 
  1115.    attribute fields have already been designed into the window.
  1116.  
  1117.      WClrScr      - Clears entire window.
  1118.      WClrTitle    - Clears entire title given Top or Bottom.
  1119.      WClrLine     - Clears an entire row.
  1120.      WClrEol      - Clears a row to End-Of-Line given a (Row,Col).
  1121.      WClrEos      - Clears a row from EOS to EOL.
  1122.      WClrField    - Clears a field given a (Row,Col).
  1123.      WClrFieldEos - Clears a field at EOS.
  1124.  
  1125.    Each of these procedures places the EOS marker at the beginning of the 
  1126.    cleared area for convenient chaining.  (WClrTitle does not alter EOS.)  The 
  1127.    latter four procedures also provide an optional attribute change.  Here are 
  1128.    some examples with a variety of ways to enter data using many of the above 
  1129.    window-relative routines:
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.    Chapter 4, Writing To Windows                                       Page 19
  1136.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1137.  
  1138.  
  1139.      EXAMPLE 9:  Window-relative writing routines
  1140.      ----------------------------------------------------------------------
  1141.      {$M 16384,8000,8000 }
  1142.      uses Crt,Qwik,Strs,Wndw,Goof;
  1143.      var
  1144.        s1,s2,s3: string;
  1145.        r1,r2:    real;
  1146.        Ch: char;
  1147.      begin
  1148.        InitWindow (LightGrayBG,true);
  1149.        MakeWindow (5,20,15,40,White+BlueBG,Cyan+BlueBG,SingleBrdr,Window1);
  1150.        s1 := ' a:\long\long\filename';
  1151.        s2 := ' a:\shorter\filename';
  1152.        s3 := ' error message';
  1153.        r1 := 1.0;
  1154.        r2 := 14.33e3;
  1155.        WWrite    ( 2, 2,'File name: ');
  1156.        WClrEos   (LightGrayBG);              { Clear first field }
  1157.        QwriteEos (SameAttr,s1);              { Put in file name }
  1158.        WWrite    ( 3, 2,'Status');
  1159.        WClrField ( 3,13,20,LightGrayBG);     { Clear second field }
  1160.        QwriteEos (SameAttr,s3);              { Put in status message }
  1161.        WWrite    ( 4, 2,'Quantity:  ');
  1162.        WClrFieldEos (20,LightGrayBG);        { Clear third field }
  1163.        QwriteEos (SameAttr,StrRFD(r1,19,1)); { Put in formatted data }
  1164.        EosToRCrel (0,-1);                    { Shift EOS back one space }
  1165.        WGotoEos;
  1166.        TitleWindow (Bottom,Center,Yellow+BlueBG+Blink,' Press any key ');
  1167.        repeat
  1168.          Ch := ReadKey;
  1169.        until Ch<>#00;
  1170.        WClrTitle (Bottom);
  1171.        TWS.WndwAttr := SameAttr;        { Keeps field attributes intact }
  1172.        WWrite  ( 2,13,s2);
  1173.        WClrEos (SameAttr);              { Clears remainder of long filename }
  1174.        WClrEol ( 3,13,SameAttr);        { Clears beyond field, But A OK! }
  1175.        WWrite  ( 4,13,StrRFD(r2,19,1)); { Overwrites new data }
  1176.        TWS.WndwAttr := TWS.OrigAttr;    { Restore window attribute }
  1177.      end.
  1178.  
  1179.    When running this example, the window will display the formatted data in 
  1180.    their fields.  Then press a key as requested.  Then the fields are updated 
  1181.    with new data.  Notice that the fields are only overwritten and not cleared 
  1182.    first.  This produces the best human factors by appearing flawless.
  1183.  
  1184.  
  1185.    SCROLLING
  1186.  
  1187.    Some operations may require scrolling all or just portions of a window.  
  1188.    WNDW has four routines to do this, and, like all other WNDW routines, they 
  1189.    operate in all windows and video pages at the highest speed without flicker 
  1190.    or snow.
  1191.  
  1192.    Full Window - To scroll the entire window, two routines scroll the window 
  1193.    up or down.  You may also want to consider the conditional scroll of 
  1194.  
  1195.  
  1196.    Chapter 4, Writing To Windows                                       Page 20
  1197.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1198.  
  1199.  
  1200.    WEosLn:
  1201.  
  1202.      WScrollUp   - Scrolls window up.
  1203.      WScrollDown - Scrolls window down.
  1204.  
  1205.    Partial Window - Just like InsLine and DelLine, these two routines insert 
  1206.    and delete lines by specifying the row.
  1207.  
  1208.      WDelLine - Deletes the specified row scrolling the remainder up.
  1209.      WInsLine - Inserts the specified row scrolling the remainder down.
  1210.  
  1211.  
  1212.    LINE DRAWING
  1213.  
  1214.    The border alone is not sufficient for the design of many windows that need 
  1215.    to be partitioned in a logical manner.  WNDW has six procedures to 
  1216.    completely partition any window - three are for extending the border and 
  1217.    three are for a separate line drawing set for inside the window.
  1218.  
  1219.    Border Drawing - The following procedures can easily add an extra partition 
  1220.    to the window by using the current border style (TWS.WSbrdr) and the border 
  1221.    attribute (TWS.BrdrAttr):
  1222.  
  1223.      WBrdrH    - draws a horizontal partition at the given row complete with 
  1224.                  tees.
  1225.      WBrdrV    - draws a vertical partition at the given columns complete with 
  1226.                  tees.
  1227.      WBrdrPart - places a single border part at the given row and column 
  1228.                  usually used for a cross or tee.
  1229.  
  1230.    Line Drawing - When a window is created, the line drawing set (TWS.WSline) 
  1231.    is the same as the border style (TWS.WSbrdr) but can freely be changed.  
  1232.    The following procedures can easily add an extra line within the window by 
  1233.    using the line drawing set and the current window attribute (TWS.WndwAttr):
  1234.  
  1235.      WLineH    - draws just a horizontal line at the given (Row,Col) repeated 
  1236.                  for a number of columns.
  1237.      WLineV    - draws just a vertical line at the given (Row,Col) repeated 
  1238.                  for a number of columns.
  1239.      WLinePart - places a single line part at the given row and column usually 
  1240.                  used for a cross or tee.
  1241.  
  1242.    Acronyms - To make it easy to remember each individual part of a border or 
  1243.    line set, each part has its own acronym.  For example, BrdrTL means the Top 
  1244.    Left border part.  Here are the parts in their relative positions and their 
  1245.    definitions:
  1246.  
  1247.      Relative Position       The first letter of the border acronym mean:
  1248.      ------------------         T = top         B = bottom
  1249.      TL  TH  TT  TH  TR         V = vertical    H = horizontal
  1250.      LV      VL      RV         L = left        R = right
  1251.      LT  HL  CL  HL  RT         C = cross
  1252.      LV      VL      RV      The second letter is the same except for:
  1253.      BL  BH  BT  BH  BR         T = tee         L = line
  1254.  
  1255.  
  1256.  
  1257.    Chapter 4, Writing To Windows                                       Page 21
  1258.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1259.  
  1260.  
  1261.  
  1262.    Example - Let's see if we can try some screen design with these routines 
  1263.    with this example:
  1264.  
  1265.      EXAMPLE 10:  Screen design
  1266.      ----------------------------------------------------------------------
  1267.      {$M 16384,8000,8000 }
  1268.      uses Crt,Qwik,Wndw,Goof;
  1269.      begin
  1270.        InitWindow (LightGrayBG,true);
  1271.        MakeWindow ( 5,19,17,41,GreenBG,White+GreenBG,VdoubleBrdr,Window1);
  1272.        TWS.WSline := SingleBrdr;   { Don't want VdoubleBrdr }
  1273.        WLineH ( 4, 1,TWS.Wcols);   { Use Wcols for full window width }
  1274.        WLineH (12, 1,TWS.Wcols);
  1275.        WBrdrH (8);
  1276.        WBrdrV (20);
  1277.        WBrdrPart ( 8,20,BrdrCL);   { For the Cross Line }
  1278.      end.
  1279.  
  1280.    When you see this executed, it is apparent that the borders are connected 
  1281.    with tees.  Notice that the line set uses the window attribute.  I'll bet 
  1282.    you didn't know screen design could be this easy!  Why use compressed 
  1283.    screens?
  1284.  
  1285.  
  1286.    CUSTOM ROUTINES
  1287.  
  1288.    You can make your own custom routines to be window-relative by using the 
  1289.    current window record.  This topic will get you familiar with the window 
  1290.    coordinates and guide you through an example.
  1291.  
  1292.    Coordinates - The top (or active) window record has two sets of coordinates 
  1293.    - one set includes the border and the other excludes it.  Here are the 
  1294.    field identifiers for the ones including the border:
  1295.      
  1296.      WSrow  - Row of the top border.
  1297.      WScol  - Column of the left border.
  1298.      WSrows - Number of rows from border to border.
  1299.      WScols - Number of columns from border to border.
  1300.      WSrow2 - Row of the bottom border.
  1301.      WScol2 - Column of the right border.
  1302.  
  1303.    The "WS" acronym means WndwStat which was used to create the window.  But 
  1304.    usually you would want the coordinate for the text window exclusive of the 
  1305.    border ("W" acronym) and here are those field identifiers:
  1306.  
  1307.      Wrow  - Top row of the window.
  1308.      Wcol  - Left column of the window.
  1309.      Wrows - Number of rows in the window.
  1310.      Wcols - Number of columns in the window.
  1311.      Wrow2 - Bottom row of the window.
  1312.      Wcol2 - Right column of the window.
  1313.  
  1314.    For example, to access the top row of the window, use TWS.Wrow.  This uses 
  1315.    the same amount of code as a simple variable.
  1316.  
  1317.  
  1318.    Chapter 4, Writing To Windows                                       Page 22
  1319.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1320.  
  1321.  
  1322.  
  1323.    Example - You may have noticed that there is no Wfill procedure included in 
  1324.    WNDW.  That's because it's so simple to customize your own.  Let's try to 
  1325.    write one:
  1326.  
  1327.      procedure Wfill (Row,Col,Rows,Cols: byte; Ch: char);
  1328.      begin
  1329.        with TWS do   
  1330.          Qfill (pred(Wrow+Row),pred(Wcol+Col),Rows,Cols,WndwAttr,Ch);
  1331.      end.
  1332.  
  1333.    You can do the same to all your routines and they can work in any displayed 
  1334.    or hidden window, or even virtual screens.
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.    Chapter 4, Writing To Windows                                       Page 23
  1380.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1381.  
  1382.  
  1383.    5.  V I R T U A L  W I N D O W S
  1384.  
  1385.    Now that you have a good idea of what windows can do, virtual windows will 
  1386.    add a greater magnitude of power and flexibility to your windows with no 
  1387.    more effort than what has already been covered.  This section shows the 
  1388.    practical applications and how to program them.
  1389.  
  1390.  
  1391.    APPLICATION
  1392.  
  1393.    This topic will help you decide when virtual windows can meet the needs of 
  1394.    your programming application.
  1395.  
  1396.  
  1397.    More Power - The default mode for making windows is a fixed-size window 
  1398.    with all of the text displayed.  But what if you want variable sized 
  1399.    windows or want to write to windows that are not displayed or even covered?  
  1400.    Virtual windows to the rescue!  They handle this automatically.
  1401.  
  1402.    Definition - What is a virtual window anyway?  There are two parts to a 
  1403.    virtual window - the screen and the view.  The screen part is written in 
  1404.    RAM while the view is seen on the CRT.  So, we can write to the screen at 
  1405.    any time and show only a portion to the CRT as required!
  1406.  
  1407.    Advantages - Since QWIK has already developed low-level tools for virtual 
  1408.    screens, WNDW uses them to create quick virtual windows.  Here's the 
  1409.    advantages:
  1410.  
  1411.      . Variable row-by-column screen size up to 64k.
  1412.      . Extremely high speed in RAM.
  1413.      . Number of screens only limited by memory.
  1414.      . Can update windows even if they are overlapped, covered, or hidden.
  1415.      . The view can be resized without losing text.
  1416.      . The screen allows wraparound.
  1417.      . Can access any screen at any time.
  1418.  
  1419.    If your application has operations in one window that affects others, then 
  1420.    virtual windows are essential.  An example of this is the Turbo Debugger 
  1421.    environment where operations in the CPU window affect items in the source 
  1422.    code and watch windows.
  1423.  
  1424.  
  1425.    PROGRAMMING
  1426.  
  1427.    Remember, we already did some virtual window programming back in Example 7 
  1428.    and there wasn't anything to it.  Now, in this section, you will learn 
  1429.    additionally how to make, write, update, view, and resize a virtual window.
  1430.  
  1431.    Compiling - To include the virtual window code in the unit, the conditional 
  1432.    directive AddVirtual must be defined.  The distributed unit already has  
  1433.    defined it for you.  If you have the source code, the directive is found at 
  1434.    the top of WNDW55.PAS.  To eliminate the code when virtual windows are not
  1435.    needed, simply remove the "$" in front of "Define AddVirtual".
  1436.  
  1437.    Creating - All we have to do to make a virtual window is use VirtualMode 
  1438.  
  1439.  
  1440.    Chapter 5, Virtual Windows                                          Page 24
  1441.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1442.  
  1443.  
  1444.    in the SetWindowModes procedure.  The default size for screen is the 
  1445.    current screen dimensions as set by InitWindow.  But suppose a different 
  1446.    size is needed.  How can that be changed?  SetVirtualSize controls the 
  1447.    screen size.  Here's an example:
  1448.  
  1449.      EXAMPLE 11:  Virtual window sizing
  1450.      ----------------------------------------------------------------------
  1451.      {$M 16384,10000,10000 }
  1452.      uses Crt,Qwik,Wndw,Goof;
  1453.      begin
  1454.        InitWindow (LightGrayBG,true);
  1455.        SetWindowModes (VirtualMode);
  1456.        SetVirtualSize (20,100);                   { 20 rows by 100 columns }
  1457.        MakeWindow (5,20,15,40,LightCyan+BlueBG,White+BlueBG,SingleBrdr,
  1458.                    Window1);
  1459.        WriteToVirtual (Window1);         { Now write to the virtual screen }
  1460.        Qfill (1,1,CRTrows,CRTcols,SameAttr,'?');   { Fill screen with data }
  1461.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  1462.        WWrite ( 4, 8,' >');                      { Let's get our bearings. }
  1463.        QwriteEos (TWS.WndwAttr+blink,'+');
  1464.        QwriteEos (SameAttr,'<- Row 4, Column 10 ');
  1465.        VUpdateWindow;             { Update the complete window on the CRT. }
  1466.        delay (2000);               { Make sure we see where the cursor is. }
  1467.        RemoveWindow;
  1468.      end.
  1469.  
  1470.    Notice that we chose a 20x100 screen, but what is seen on the CRT is only 
  1471.    15x40 which is set by MakeWindow.  So, MakeWindow sets the view size while 
  1472.    SetVirtualSize sets the screen size.
  1473.  
  1474.    Writing to the Screen - Since there are two areas to write on a virtual 
  1475.    window, the view and the screen, WNDW must be told where you intend to 
  1476.    place text.  Right after this MakeWindow procedure, it is assumed we are 
  1477.    going to continue to write on the CRT.  But the primary place to write is 
  1478.    the virtual screen.  WriteToVirtual selects that screen.  All subsequent 
  1479.    procedures will write to it - all QWIK routines, WNDW routines, and even 
  1480.    TitleWindow and MakeWindow.  It is treated just like any other screen.  The 
  1481.    exception of course is the cursor routines which must be handled by WNDW 
  1482.    routines only.
  1483.  
  1484.    RelMode - If you do write to the virtual screen and use MakeWindow, the 
  1485.    mode is forced into RelMode.  Otherwise, the window would be nested and 
  1486.    WNDW could not support it.
  1487.  
  1488.    Memory - What does the screen actually look like in memory?  It is saved in 
  1489.    the heap in the same way as a CRT video screen.  Technically, the far 
  1490.    pointer QScrPtr points to the location of the screen which is a contiguous 
  1491.    array of Character/Attribute words.  The last two rows past the screen are 
  1492.    reserved for the virtual titles which are seen on the CRT view when 
  1493.    updated.
  1494.  
  1495.    Writing to the View - It is possible to write direct to the view on the CRT 
  1496.    if desired.  To get back and write to the top view, use WriteToCRT and do 
  1497.    your writing.  But the next time this window is updated with VUpdateWindow 
  1498.    or the like, the view will be overwritten with the contents of the virtual 
  1499.  
  1500.  
  1501.    Chapter 5, Virtual Windows                                          Page 25
  1502.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1503.  
  1504.  
  1505.    screen.
  1506.  
  1507.    Updating - At some time, we would probably like to see the screen and we 
  1508.    can do this with any of five updating procedures.  The main workhorse is 
  1509.    VUpdateWindow which has been demonstrated several times.  This procedure is 
  1510.    so carefree is doesn't even matter when you use it.  It updates the virtual 
  1511.    window of the current name (TWS.WSname) no matter where it is - on top, 
  1512.    covered, overlayed, and even hidden from the CRT!  The routine actually 
  1513.    hunts for it and updates it.  To show how it can do this, let's modify the  
  1514.    last example:
  1515.  
  1516.      EXAMPLE 12:  Updating covered windows automatically
  1517.      ----------------------------------------------------------------------
  1518.      {$M 16384,12000,12000 }
  1519.      uses Crt,Qwik,Wndw,Goof;
  1520.      begin
  1521.        InitWindow (LightGrayBG,true);
  1522.        SetWindowModes (VirtualMode);
  1523.        SetVirtualSize (20,100);                   { 20 rows by 100 columns }
  1524.        MakeWindow (5,20,15,40,LightCyan+BlueBG,White+BlueBG,SingleBrdr,
  1525.                    Window1);
  1526.        SetWindowModes (0);                        { Back to default modes. }
  1527.        MakeWindow (7,30,16,18,White+GreenBG,GreenBG,DoubleBrdr,Window2);
  1528.        delay (2000);               { Make sure we see where the cursor is. }
  1529.        WriteToVirtual (Window1);         { Now write to the virtual screen }
  1530.        Qfill (1,1,CRTrows,CRTcols,SameAttr,'?');   { Fill screen with data }
  1531.        TitleWindow (Top,Left,Yellow+BlueBG,' Virtual Window ');
  1532.        WWrite ( 4, 8,' >');                      { Let's get our bearings. }
  1533.        QwriteEos (TWS.WndwAttr+blink,'+');
  1534.        QwriteEos (SameAttr,'<- Row 4, Column 10 ');
  1535.        VViewRC (4,10);
  1536.        VUpdateWindow;             { Update the complete window on the CRT. }
  1537.        delay (1000);
  1538.        RemoveWindow;
  1539.        delay (2000);               { Make sure we see where the cursor is. }
  1540.        RemoveWindow;
  1541.      end.
  1542.  
  1543.    With the delay inserted, it gives you time to clearly see that the covered 
  1544.    virtual window was updated even though it was covered by another window.  
  1545.    But that's not all.  When the window was removed, you could see that it was 
  1546.    fully updated even under the part that was covered!  That's the power of 
  1547.    virtual windows.
  1548.  
  1549.    Updating Routines - There are four other updating procedures that can be 
  1550.    chosen other than VUpdateWindow:
  1551.  
  1552.      VUpdateView   - Updates just the window contents.
  1553.      VUpdateTitles - Updates just the titles.
  1554.      VUpdateCursor - Updates new cursor position.
  1555.      VUpdateRows   - Updates selected rows on top view, but full view if 
  1556.                      covered.
  1557.  
  1558.    VUpdateWindow actually executes the first three.  But they are also 
  1559.    available as separate routines for more detailed work.  When the view is on 
  1560.  
  1561.  
  1562.    Chapter 5, Virtual Windows                                          Page 26
  1563.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1564.  
  1565.  
  1566.    top of the CRT or hidden, the routines are extremely quick.  VUpdateRows is 
  1567.    especially quick for items like data entry to the virtual screen.  If the 
  1568.    windows are covered, the procedures have to do more work.  Then 
  1569.    VUpdateWindow takes about the same time as either VUpdateTitles and 
  1570.    VUpdateView, so VUpdateWindow might as well be used.  VUpdateCursor is 
  1571.    almost a trivial routine in any case.
  1572.    
  1573.    Viewing - In this example, you may have noticed that the view was shifted a 
  1574.    bit compared to Example 11, and that the cursor was no longer in view.  It 
  1575.    was shifted by the viewing routine VViewRC.  In fact, we could view any 
  1576.    part of the screen.  Three routines can adjust the reference point of view 
  1577.    of the upper left corner:
  1578.  
  1579.      VViewRC     - Changes to a given (Row,Col).
  1580.      VViewRCrel  - Shifts a number of rows and columns, positive or negative.
  1581.      VScrollView - Shifts a number of rows and columns, and updates the just 
  1582.                    the view and accepts mouse stepped input.
  1583.  
  1584.    The first two only change the coordinates in the virtual window record, 
  1585.    while VScrollView updates the view as well.  VViewRCrel is actually a 
  1586.    subroutine of VScrollView.  All routines check for bounds and will keep the 
  1587.    view within screen limits.
  1588.  
  1589.    Resizing - If the virtual window is the top view, two routines can resize 
  1590.    it by shifting the lower right hand border:
  1591.  
  1592.      VResizeWindow - Shifts a number of rows and columns, and updates the 
  1593.                      entire window.  Accepts both row and column parameters 
  1594.                      which permit mouse stepped input.
  1595.      VZoomWindow   - Toggles window between full size and current size.  
  1596.                      Zooming up, the window is centered on the screen and the 
  1597.                      view is at (1,1).  Zooming down, it returns to the same 
  1598.                      size and location, but the view remains at (1,1).
  1599.  
  1600.    Both routines force writing to the CRT upon exit.  They also completely 
  1601.    update the window since the view and cursor may be shifted.  The titles are 
  1602.    also smoothly updated.  The zoom can be toggled back and forth as long as 
  1603.    it hasn't changed size or hasn't zoomed up another window.
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.    Chapter 5, Virtual Windows                                          Page 27
  1624.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1625.  
  1626.  
  1627.    6.  W I N D O W   M A N A G E M E N T
  1628.  
  1629.    Some of the previous examples have already touched on the principles of 
  1630.    window management.  Now this section provides the full scope of management 
  1631.    to access windows for display or writing, including multiple video pages.
  1632.  
  1633.  
  1634.    ACCESS METHODS
  1635.  
  1636.    The are two basic methods for accessing windows: serial access and random 
  1637.    access; WNDW does them both.
  1638.  
  1639.    Serial Access - This is a simple method of stacking windows over each other 
  1640.    and then removing them in reverse order.  Any writing is always done on the 
  1641.    top window displayed on the CRT.  The only two procedures used are 
  1642.    MakeWindow and RemoveWindow.  For simple menu systems, serial access may be 
  1643.    all that is needed.  The advantages are:
  1644.  
  1645.      . Uses less code.
  1646.      . No gaps in heap memory.
  1647.      . Only one place to write.
  1648.  
  1649.    But the disadvantages are many.  Once a window is removed, it is lost from 
  1650.    memory and must be recreated.  This can cause a significant amount of 
  1651.    shuffle to access other windows.  Serial access is a subset of random 
  1652.    access.
  1653.  
  1654.    Random Access - More and more applications require access to any window at 
  1655.    any time without losing the data.  WNDW was designed to handle this 
  1656.    automatically at very high speed.  The advantages to random access are:
  1657.  
  1658.      . Free access to any window.
  1659.      . Windows are created only once.
  1660.      . Virtual windows can be updated even if covered.
  1661.      . Ease of programming.
  1662.  
  1663.    Any window can be randomly accessed, including fixed, virtual and hidden 
  1664.    windows.  It's as simple as that.  Try running the window management demo 
  1665.    WNDWMGR.PAS again and see how you can hide, show, and access any window.
  1666.    The instructions are on the screen.
  1667.  
  1668.  
  1669.    DISPLAY CONTROL
  1670.  
  1671.    Three procedures select the window to be displayed as the top window:
  1672.  
  1673.      AccessWindow - Accesses the window by name whether hidden or covered.
  1674.      HideWindow   - Hides the top window.
  1675.      ShowWindow   - Shows a window given its name.
  1676.  
  1677.    AccessWindow hunts for the named window and, if it is hidden, it will also 
  1678.    be shown.  ShowWindow is actually a subroutine of AccessWindow.  Any window 
  1679.    (except PermMode) can be hidden and shown; they do not have to be created 
  1680.    with HiddenMode which hides it at the start.
  1681.  
  1682.  
  1683.  
  1684.    Chapter 6, Window Management                                        Page 28
  1685.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1686.  
  1687.  
  1688.    EOS - When using Hide/ShowWindow, the EOS is reset to (1,1) to prevent 
  1689.    unexpected results.  However, if the window is currently displayed on the 
  1690.    CRT and AccessWindow is used, the EOS is restored to its previous value.
  1691.  
  1692.    RemoveWindow - This procedure could be considered a form of display 
  1693.    control, but remember that when a window is removed, it is gone forever, 
  1694.    including any virtual screen.
  1695.  
  1696.    MoveWindow - This procedure shifts the top window around on the CRT by a 
  1697.    given number of rows and columns allowing mouse stepped control.  A window 
  1698.    can be limited in movement by setting the margins in MarginRec.  The bounds 
  1699.    are conveniently checked, so the window will always stay within limits.  In 
  1700.    the WNDWMGR.PAS demo, you can see the status line on row 25 is never 
  1701.    overlapped by MoveWindow.  Although Window0 is a permanent one, we could 
  1702.    easily write to the status line at anytime by using AccessWindow (Window0).
  1703.  
  1704.    Changing Borders - For human factors, it is often helpful to have a border 
  1705.    be emphasized when it becomes the new top window.  Two high speed 
  1706.    procedures handle this well:
  1707.  
  1708.      ChangeBorder  - Changes the top window to the new given border style.
  1709.      RestoreBorder - Restores the original border created with MakeWindow.
  1710.  
  1711.    Both of these procedures work only on the top window, and they can either 
  1712.    be fixed or virtual.  They replace all border parts including tees and also 
  1713.    leave all titles untouched.
  1714.  
  1715.  
  1716.    WRITE CONTROL
  1717.  
  1718.    Three procedures select where the writing procedures will write:
  1719.  
  1720.      WriteToHidden  - Writes to the named hidden window.
  1721.      WriteToVirtual - Writes to the named virtual screen.
  1722.      WriteToCRT     - Writes to the current top window on the CRT.
  1723.  
  1724.    WriteToHidden - A hidden window is saved with the border intact, but is 
  1725.    stripped of any shadow.  It is easier to use the window-relative writing 
  1726.    routines because of the optional border rather than using QWIK which can 
  1727.    still be used.  Any shadow is reconstructed by ShowWindow.
  1728.  
  1729.    WriteToVirtual - A virtual screen can freely use either WNDW or QWIK 
  1730.    routines since it never has a border.  If you want to write directly to the 
  1731.    virtual screen after it has just been created, sometimes it's easier to use 
  1732.    WriteToVirtual (TWS.WSname) provided HiddenMode was not used as well.
  1733.  
  1734.    WriteToCRT - All routines continue to write to their destination until 
  1735.    changed.  This routine will get you back to writing on the CRT.  Some 
  1736.    procedures are forced back to the CRT after their operation.  Here are 
  1737.    those exceptions:
  1738.  
  1739.      AccessWindow           VResizeWindow         MoveWindow
  1740.      HideWindow             VZoomWindow    
  1741.      ShowWindow             ChangeBorder   
  1742.      RemoveWindow           RestoreBorder  
  1743.  
  1744.  
  1745.    Chapter 6, Window Management                                        Page 29
  1746.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1747.  
  1748.  
  1749.  
  1750.    REMEMBER: Use WriteToCRT to get back to the CRT.  If you forget, the text 
  1751.    will of course be in an unexpected window.
  1752.  
  1753.    MakeWindow - This procedure does NOT force a change in the write 
  1754.    destination.  If you are writing to a hidden window or a virtual screen, 
  1755.    the resulting window created by MakeWindow is forced into RelMode.  
  1756.    However, the WindowModes setting is not affected.
  1757.  
  1758.  
  1759.    WINDOW MODES AND FLAGS
  1760.  
  1761.    Additional window modes are available to restrict window operations or to 
  1762.    detect the window destination status.  Each mode has a corresponding 
  1763.    boolean flag.
  1764.  
  1765.    Restrictive Modes - In some applications, you may want to restrict what the 
  1766.    end user can change for the windows.  Before the window is created with 
  1767.    MakeWindow, use these modes in SetWindowModes.  The flag can be used for 
  1768.    testing.
  1769.  
  1770.      Set Mode      Set Flag      Description
  1771.      ------------  ------------  --------------------------------------------
  1772.      NoHideMode    NoHideFlag    Ignores HideWindow operation.
  1773.      NoAccessMode  NoAccessFlag  Ignores AccessWindow operation.
  1774.      NoMoveMode    NoMoveFlag    Ignores MoveWindow/VResizeWindow operations.
  1775.  
  1776.  
  1777.    Destination Modes - These modes are just for your information and are 
  1778.    handled automatically by WNDW.  These identify the write destination of the 
  1779.    window.  You can use the flags for testing, but the modes are ignored by 
  1780.    SetWindowModes:
  1781.  
  1782.      Set Mode       Set Flag       Description
  1783.      -------------  -------------  ------------------------------
  1784.      ToCRTMode      ToCRTFlag      Writing to the CRT.
  1785.      ToHiddenMode   ToHiddenFlag   Writing to the hidden window.
  1786.      ToVirtualMode  ToVirtualFlag  Writing to the virtual screen.
  1787.  
  1788.  
  1789.    HIGH SPEED SCREEN DESIGN
  1790.  
  1791.    By using Hidden or Virtual windows, WNDW enables you to make screen design 
  1792.    several magnitudes faster than you ever thought possible.  
  1793.  
  1794.    Comparing Speeds - Let's compare three speeds - (1) Turbo's direct video, 
  1795.    (2) QWIK/WNDW writing to CRT, and (3) QWIK/WNDW writing to RAM.  The 
  1796.    following chart is striking.  
  1797.  
  1798.                         ---- QWIK/WNDW ----
  1799.      Video Card  Turbo  To CRT    To RAM
  1800.      ----------  -----  ------  ----------
  1801.      CGA         100%   225%    1600-4100%
  1802.      All others  100%   750%     900-1700%
  1803.  
  1804.  
  1805.  
  1806.    Chapter 6, Window Management                                        Page 30
  1807.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1808.  
  1809.  
  1810.    Design Strategy - So how can you get these fantastic speeds?  The simplest 
  1811.    way was shown in Example 3 by creating hidden windows.  You may wish to 
  1812.    make a habit of creating your windows with HiddenMode and then immediately 
  1813.    show them with ShowWindow.  Virtual window code is not even required for 
  1814.    hidden windows.  Of course, the alternative is to go ahead and use virtual 
  1815.    windows.  Either way, you can actually see the increase in performance in 
  1816.    your programs.
  1817.    
  1818.    Code Savings - Many application programs use disk-based screens that are 
  1819.    called from the disk when required.  QWIK and WNDW require such little code 
  1820.    to create a full screen design, that you will actually save code and disk 
  1821.    space by using these routines - not to mention the increase in speed!
  1822.  
  1823.  
  1824.    MULTIPLE VIDEO PAGES
  1825.  
  1826.    Most color video cards have the capacity for multiple video pages.  If your 
  1827.    application can benefit from extra pages, WNDW handles all the data records 
  1828.    with simplicity.
  1829.  
  1830.    Compiling - To include the multiple video page code in the unit, the 
  1831.    conditional directive MultiPage must be defined.  The distributed unit 
  1832.    already defines it for you.  If you have the source code, the directive 
  1833.    is found at the top of WNDW55.PAS.  To eliminate the code when these pages
  1834.    are not needed, simply remove the "$" in front of "Define MultiPage".
  1835.  
  1836.    Changing Pages - To change video pages, use one of the following 
  1837.    procedures:
  1838.  
  1839.      WriteToPage      - Directs all QWIK and WNDW routines to write to the 
  1840.                         given page number, but still view the current page.
  1841.      WriteAndViewPage - Directs all QWIK and WNDW routines to write and to 
  1842.                         view the given page number.
  1843.  
  1844.    Separate Records - Each video page has its own set of window records that 
  1845.    are completely separate including the level indexes and top window stats.  
  1846.    So when pages are swapped, everything is just where it was left - even the 
  1847.    cursor mode and EOS.  However, the virtual screen records use the same 
  1848.    array in the heap, but, to keep them separate, they do not share records.
  1849.  
  1850.  
  1851.    MULTI-TASKING ENVIRONMENTS
  1852.  
  1853.    WNDW is perfectly suited for working in multi-tasking environments.  In
  1854.    order for your program to advantage of the speed and flexiblity of virtual
  1855.    video buffers (MTVB) used with any environment, there is only one variable
  1856.    that needs to be set:
  1857.  
  1858.      PreferMultiTask := true;
  1859.  
  1860.    Place this before InitWindow, and WNDW will use the MTVB if available.  All
  1861.    routines will then be set to write directly to this buffer.  If InMultiTask
  1862.    is true, then WNDW is using the MTVB.  Crt.DirectVideo is set false by WNDW
  1863.    and you must likewise instruct the environment that the program is capable
  1864.    of writing to the MTVB by telling it that is does not write direct to the
  1865.  
  1866.  
  1867.    Chapter 6, Window Management                                        Page 31
  1868.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1869.  
  1870.  
  1871.    screen.  WNDW is extremely fast and proves itself well in environments!
  1872.  
  1873.    Multiple Pages - Please remember that many multi-tasking environments do
  1874.    not support more than one page.  Be sure the ones you are designing around
  1875.    do support full page control.  WNDW prevents the use of multiple pages
  1876.    while using the MTVB by altering MaxValidPage in the InitPages procedure.
  1877.    If you have one that behaves properly and you have the source code to WNDW,
  1878.    you can enable multiple page writing by deleting the following line in
  1879.    InitPages:
  1880.  
  1881.      If InMultiTask then
  1882.        MaxValidPage := 0;
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.    Chapter 6, Window Management                                        Page 32
  1929.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1930.  
  1931.  
  1932.    7.  D A T A   M A N A G E M E N T 
  1933.  
  1934.    Almost all of the data is handled automatically by WNDW.  This section is 
  1935.    provided for those who are interested in the details of data management and 
  1936.    the inner workings of WNDW.  The only required reading is Data Allocation.  
  1937.    Otherwise, you can skip this section.
  1938.  
  1939.  
  1940.    DATA ALLOCATION
  1941.  
  1942.    This topic will provide you enough knowledge to budget the number of data 
  1943.    records needed for you program using the constants MaxWndw, MaxVirualWndw, 
  1944.    and MaxPageUsed.
  1945.  
  1946.  
  1947.    Data Structure - For a detailed description of the data structure, you can 
  1948.    refer to Data Structure in Section 3 of WNDWREF.DOC.  To be able to adjust 
  1949.    the data structure, you must have the source code.  If not, the sizes have 
  1950.    been preassigned.
  1951.  
  1952.    MaxWndw - Each window on the CRT, displayed or hidden, requires one window 
  1953.    record of statistics called WndwStat which is global data.  The initial 
  1954.    window, Window0, is always at WndwStat[0].  They array of records is sized 
  1955.    by MaxWndw as the highest number of windows, hidden and displayed, that are 
  1956.    on the CRT at any one time on any one video page.   For example, if page 0 
  1957.    has a maximum of 10 windows and page 1 has 6, set MaxWndw equal to 10.
  1958.  
  1959.    MaxVirtualWndw - Each virtual window has two window records - one is in 
  1960.    WndwStat for the view and the other is in VirtualStat for the virtual 
  1961.    screen which is dynamic data.  The first virtual screen is saved in 
  1962.    VirtualStat[0] since it is zero based.  The array of records is sized by 
  1963.    MaxVirtualWndw as the highest total number of active virtual windows.  For 
  1964.    example, if page 0 has 4 virtual windows and page 1 also has 4, set 
  1965.    MaxVirtualWndw equal to 7 (not 8).
  1966.  
  1967.    MaxPageUsed - This is the highest page number that will be used in a 
  1968.    multiple video page program.  If you are only using page 0, which is 
  1969.    usually the case, you should go ahead and undefine the directive MultiPage 
  1970.    and not bother with MaxPageUsed.  Each page saves its own WndwStats and 
  1971.    Indexes in one record called PageStat in an array in dynamic memory.  
  1972.    MaxPageUsed and Qwik.MaxPage are compared and the lesser of the two will 
  1973.    size the PageStat array.
  1974.  
  1975.    Program Development - When you first start developing a program, make it 
  1976.    easy on yourself and inflate these constants to provide enough freedom 
  1977.    without having to recompile.  In your final program, you can trim them down 
  1978.    and retest.
  1979.  
  1980.  
  1981.    RECORD HANDLING
  1982.  
  1983.    If you are wondering where your WndwStat record is being saved, the 
  1984.    following will show you how it is managed.
  1985.  
  1986.  
  1987.  
  1988.  
  1989.    Chapter 7, Data Mangement                                           Page 33
  1990.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  1991.  
  1992.  
  1993.    Displayed Stack - Each window as it is displayed on the CRT has its 
  1994.    corresponding window record saved in WndwStat starting from the bottom of 
  1995.    the array and stacked upward.  The base window, Window0, is permanent and 
  1996.    saved in WndwStat[0].  The first window displayed is saved in WndwStat[1], 
  1997.    the second in WndwStat[2], and so on.  The top window is in WndwStat[LI] 
  1998.    where LI is the top Level Index.
  1999.  
  2000.    Hidden Stack - Hidden windows have their record moved from WndwStat[LI] to 
  2001.    the top of WndwStat starting from the top of the array stacked downward.  
  2002.    As you can imagine, the hidden stack is simply inverted to the displayed 
  2003.    stack.  So, when a window is hidden, it is placed starting at 
  2004.    WndwStat[MaxWndw].  The last hidden window saved is at WndwStat[HLI].  HLI 
  2005.    is the Hidden Level Index.  Conversely, when a window is shown, it is 
  2006.    removed from the hidden stack and replaced in WndwStat[LI].
  2007.  
  2008.    Random Access - Anytime a window is randomly accessed, the record is pulled 
  2009.    out from the middle of the stack.  The stack is then dropped to fill the 
  2010.    gap. 
  2011.  
  2012.    VirtualStat - The records for the virtual screens are kept in dynamic 
  2013.    memory in an array called VirtualStat and are not shuffled like the window 
  2014.    records.  If a window is virtual, the index to the virtual screen is 
  2015.    WndwStat[?].VI.
  2016.  
  2017.    TopWndwStat - The current window stats are always maintained in the global 
  2018.    record TopWndwStat (TWS).  Combined with a WITH statement, the code is 
  2019.    optimized just like simple global variables.  When working with the current 
  2020.    window, always use TopWndwStat (TWS) in lieu of WndwStat or VirtualStat.
  2021.  
  2022.    TopVirtualStat - Just like TWS, a copy of the current virtual screen record 
  2023.    from VirtualStat is maintained in the global record TopVirtualStat (TVS).
  2024.  
  2025.    RelMode Records - RelMode windows only have the record temporarily placed 
  2026.    in TWS and are not saved in the stack.  They are overwritten with any 
  2027.    change of windows.
  2028.  
  2029.    PermMode Records - PermMode windows have a copy of its record placed in TWS 
  2030.    (and TVS if virtual), but the stack is not shuffled and there are no gaps.  
  2031.    All PermMode records must be the first ones in the stack.  The highest 
  2032.    index of permanent windows is maintained in PLI the Permanent Level Index.
  2033.  
  2034.    Saving Records - Again, WNDW handles this automatically, TWS and TVS are 
  2035.    saved in their appropriate WndwStat or VirtualStat.  Remember, when writing 
  2036.    to virtual screens, TWS and TVS are reversed.  It may be helpful to think 
  2037.    of TVS then as the Top View Stat on the CRT.
  2038.  
  2039.    Finding Records - Since the records are shuffled, just how do you find the 
  2040.    record you want?  Given the window name, GetLevelIndex returns the index in 
  2041.    WndwStat for the window record.
  2042.  
  2043.    Page Records - When swapping pages, WNDW swaps the entire WndwStat array, 
  2044.    top window records, indexes, margins, cursor mode and window modes for 
  2045.    each page.
  2046.  
  2047.    Heap - Virtual screens and hidden windows are saved in the heap.  To 
  2048.  
  2049.  
  2050.    Chapter 7, Data Mangement                                           Page 34
  2051.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2052.  
  2053.  
  2054.    figure your heap requirement, please refer to Appendix A in WNDWREF.DOC.  
  2055.    For your own program, you can also use the HeapOK procedure to test for 
  2056.    MaxAvail.  If there is insufficient heap space, then HeapOK will terminate 
  2057.    the program through the GOOF unit.
  2058.  
  2059.    Stack - Stack checking has been turned off in the units.  Less than 2k is 
  2060.    used for any procedure.
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.    Chapter 7, Data Mangement                                           Page 35
  2112.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2113.  
  2114.  
  2115.    8.  U T I L I T Y   U N I T S
  2116.    
  2117.    Two other units are required with the WNDW package - GOOF and WUTIL.  The 
  2118.    GOOF unit handles programming errors while WUTIL has some high speed 
  2119.    screamin' routines to add zing into many of the window operations.  WUTIL 
  2120.    is already compiled into WNDW, but the unit is available for your other 
  2121.    programs as well.
  2122.  
  2123.  
  2124.    GOOF UNIT
  2125.      
  2126.    All programmers make mistakes, right?  So, what happens when you try to 
  2127.    make more windows than there are records available?  Since WNDW is so 
  2128.    powerful and can even write in RAM, there is a good possibility that your 
  2129.    mistake may not even show up on the screen.  How do you know if anything 
  2130.    has gone wrong?  The GOOF unit was made especially for handling errors.
  2131.  
  2132.    Displaying Errors - When an error is found in your program, the ShowGoof 
  2133.    procedure is called and the program is terminated.  The CRT will display an 
  2134.    error message in a flashing window.  There are eight fatal errors that are 
  2135.    listed in APPENDIX B in WNDWREF.DOC to identify problems before they 
  2136.    happen.  Please refer to it for the error messages and their solutions.
  2137.  
  2138.    Flexibility - ShowGoof is accessed indirectly with an indirect call.  This 
  2139.    means that you can freely edit the GOOF unit without needing to recompile 
  2140.    WNDW.  You can even edit it for use in your own applications.  The error 
  2141.    message numbers 1-50 are reserved.  So, for your own applications, it is 
  2142.    suggested that you start with number 51.  If you have thoroughly tested 
  2143.    your program, some of the messages can be eliminated.  
  2144.  
  2145.    Using GOOF - It is very important that GOOF be included in the USES list.  
  2146.    You may find that it compiles without it, but if an error does occur, your 
  2147.    system will surely crash.  Notice that GOOF is the last unit in the USES 
  2148.    list as it uses both QWIK and WNDW.
  2149.  
  2150.  
  2151.    WUTIL UNIT
  2152.  
  2153.    To help make WNDW into a fast unit, some maximum/minimum functions and move 
  2154.    procedures were included in the separate unit WUTIL.  Since WUTIL is an 
  2155.    independent unit, you can also use it by itself in your own programs.
  2156.  
  2157.  
  2158.    Maximum/Minimum - These high speed functions compare two values and return 
  2159.    the result whether maximum or minimum.  They have been trimmed down to 
  2160.    operate on specific data types and only use 112 bytes total.
  2161.  
  2162.      MaxI - returns the maximum of two integers.
  2163.      MaxL - returns the maximum of two long integers.
  2164.      MaxW - returns the maximum of two words.
  2165.      MinI - returns the minimum of two integers.
  2166.      MinL - returns the minimum of two long integers.
  2167.      MinW - returns the minimum of two words.
  2168.  
  2169.  
  2170.  
  2171.  
  2172.    Chapter 8, Utility Units                                            Page 36
  2173.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2174.  
  2175.  
  2176.    Move16/MoveWords - Since WNDW needs the highest speed move procedures, two 
  2177.    routines were developed.
  2178.  
  2179.      Move16    - Drop-in replacement for TP's Move that is twice as fast using 
  2180.                  16-bit transfers.
  2181.      MoveWords - Faster than Move16, but Source cannot overlap Dest[0].
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.    Chapter 8, Utility Units                                            Page 37
  2234.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2235.  
  2236.  
  2237.    A P P E N D I X   A :   A P P L I C A T I O N   P R O D U C T S
  2238.  
  2239.  
  2240.    Eagle Performance Software has developed identical products for both
  2241.    Turbo C and Turbo Pascal.  Our pledge is to provide you quality products
  2242.    with unparalleled performance and ease of use.  All registered users
  2243.    receive the complete source code when a signed license agreement is
  2244.    returned.
  2245.  
  2246.  
  2247.    QWIK
  2248.  
  2249.    QWIK - For direct screen video, QWIK is the highest performance screen 
  2250.    writing tools available today for all text modes in any video 
  2251.    configuration.  QWIK provides capabilities far beyond those in the 
  2252.    unit/library that comes with your compiler.   Here are some of the 
  2253.    features:
  2254.                 
  2255.      - Writes on all IBM compatible computers, displays and adapters 
  2256.        including MDA, CGA, EGA, MCGA, VGA, 8514/A, Hercules and 3270 PC.
  2257.      - Superior video detection routine.
  2258.      - Eliminates snow and flicker.
  2259.      - Writes directly to the screen in absolute rather than relative 
  2260.        coordinates.
  2261.      - Writes in all text modes and column modes.
  2262.      - Writes on all video pages.
  2263.      - Writes on virtual screens in RAM.
  2264.      - Writes text and attribute, text only, or attribute only.
  2265.      - Reads strings, characters and attributes.
  2266.      - Uses End-Of-String (EOS) marker for quick string chaining.
  2267.      - Provides standardized cursor shapes for all adapters.
  2268.      - Enhanced cursor movement.
  2269.      - Compatible with DESQview and similar multitasking environments.
  2270.      - Over 650% faster than standard direct screen writing.
  2271.      - Only 2.7k bytes of code if all 43 utilities are used.
  2272.      - Optimized by the compiler and drops unused code.
  2273.      - Used in all other Eagle products.
  2274.      - Excellent documentation like this document.
  2275.  
  2276.    Here are the product versions:
  2277.  
  2278.       File name    CIS Name    Compiler  Release date
  2279.       -----------  ----------  --------  ------------
  2280.       QWIK42C.ARC  QWIK42.ARC  TP4(TP5)   10-01-88
  2281.       QWIK5XC.ARC  QWIK5X.ARC  TP5(TP4)   12-20-88
  2282.       QWIKC20.ARC  QWKC20.ARC  TC2        12-03-88
  2283.  
  2284.  
  2285.    WNDW - Here are the current product versions of WNDW:
  2286.  
  2287.       File name    CIS Name    Compiler  Release date
  2288.       -----------  ----------  --------  ------------
  2289.       WNDW42B.ARC  WNDW42.ARC  TP4(TP5)   10-15-88
  2290.       WNDW5XC.ARC  WNDW5X.ARC  TP5(TP4)   12-20-88
  2291.       WNDWC20.ARC  WNDC20.ARC  TC2        02-01-89
  2292.  
  2293.  
  2294.    Appendix A: Application Products                                    Page 38
  2295.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2296.  
  2297.  
  2298.  
  2299.  
  2300.    PULL
  2301.  
  2302.    PULL - For multi-level pull-down menus, PULL is fully featured and fully 
  2303.    configurable.  Includes execute, single, and multiple choice menus, 
  2304.    unlimited nested submenus, data entry windows, help windows, directory 
  2305.    windows, message system, and fully completed interfaces.  Some of the 
  2306.    features are:
  2307.  
  2308.      - Uses QWIK and WNDW.
  2309.      - Work window(s) and complete interface for menus
  2310.      - Pull-down menus with 3 menu modes and 8 line modes
  2311.      - Pull-down file directory
  2312.      - Highlighted command letters
  2313.      - Unlimited levels of submenus
  2314.      - Unlimited data entry windows for 9 types of data
  2315.      - Data entry for the work window(s)
  2316.         Free field entry with either fixed column or flexible column        
  2317.          length.
  2318.         Full editing capability including insert cursor mode
  2319.         Full field selection with cursor keys
  2320.         Automatic NumLock for numerical data entry
  2321.         Right or left justification for data entry output
  2322.         Error messages for invalid data entries
  2323.         Error messages for data entries out of range
  2324.      - Automatic sizes and locations for menus.
  2325.      - Operation by cursor 
  2326.        keys or command keys
  2327.      - Pull/Pop between work window and nested submenu(s)
  2328.      - Programmable control of pull and pop sequences
  2329.      - Context-sensitive help
  2330.      - Message lines for prompts and processing
  2331.      - Full working shell for user development
  2332.      - Excellent documentation like this document.
  2333.  
  2334.    Here are the product versions:
  2335.  
  2336.       File name    CIS Name    Compiler  Release date
  2337.       -----------  ----------  --------  ------------
  2338.       PULL42B.ARC  PULL42.ARC  TP4(TP5)   01-03-89
  2339.       PULL5XC.ARC  PULL5X.ARC  TP5(TP4)   01-06-89
  2340.       PULLC20.ARC  PULC20.ARC  TC2        TBA
  2341.  
  2342.  
  2343.    ON-LINE SERVICES
  2344.  
  2345.    CompuServe - All updated files and later versions can be found on the 
  2346.    CompuServe Borland Forums (GO BPROGA for TP and GO BPROGB for TC) or the 
  2347.    IBM Programming Forum (GO IBMPRO).
  2348.  
  2349.    The Eagle BBS - You can also get the latest files on our 24-hour BBS at
  2350.    (214) 539-9878, 1200/2400 N81.
  2351.  
  2352.  
  2353.  
  2354.  
  2355.    Appendix A: Application Products                                    Page 39
  2356.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2357.  
  2358.  
  2359.    A P P E N D I X   B :   R E V I S I O N   H I S T O R Y
  2360.  
  2361.    REVISIONS:
  2362.  
  2363.    Version 4.0 (12-12-87):
  2364.      . Incorporated QWIK40.TPU for full IBM compatibility.
  2365.      . Combined all modes into one variable - WindowModes.
  2366.      . Added the following procedures/functions:
  2367.          SetWindowModes
  2368.          RestoreTurboWindow
  2369.          PartitionWindow
  2370.          PartitionCross
  2371.          ClearTitle
  2372.          ClearWindow
  2373.          HideWindow
  2374.          ShowWindow
  2375.          MoveWindow
  2376.          AccessWindow
  2377.          GetLevelIndex
  2378.      . Added 7 background constants.
  2379.      . MakeWindow now requires a WindowName.
  2380.      . TitleWindow requires one more direction parameter.
  2381.      . Current WndwStats are kept in TopWndwStat rather than 
  2382.          WndwStat[LI].
  2383.      . LIcurrent was deleted.
  2384.      . Changed BrdrRec type for easier modifications.
  2385.      . Added 3 more borders - VdoubleBrdr, ThinSolidBrdr2, UserBrdr2.
  2386.      . Changed the following names:
  2387.          MixedBrdr     to HdoubleBrdr
  2388.          ThinSolidBrdr to ThinSolidBrdr1
  2389.          Tattr         to TextAttr     { Assigned by Borland }
  2390.  
  2391.    Version 4.0a (12-12-87):
  2392.      . Set the correct dates for WNDWVARS.TPU and WNDW40.TPU.
  2393.    
  2394.    Version 4.2 (10-22-88):
  2395.      . Major revision over WNDW40; over 50 procedures added or changed.
  2396.      . Added professional documents WNDW42.DOC and WNDWREF.DOC.
  2397.      . Added virtual window power.
  2398.      . Enabled direct writing to hidden windows and virtual screens.
  2399.      . Added multiple video page routines.
  2400.      . Added 28 window relative routines.
  2401.      . Replaced Qbox with MakeWindow RelMode.
  2402.      . Replaced ScrollWindow with WScrollUp, WScrollDown, WInsLine, WDelLine, 
  2403.          and WEosLn.
  2404.      . Changed WSwhereR and WSwhereC to be window relative.
  2405.      . Added window-relative stats in WndwStat.
  2406.      . Changed BrdrRec acronyms.
  2407.      . Changed and added window modes.
  2408.      . Added full line drawing procedures.
  2409.      . Changed WndwVars unit to an include file.
  2410.      . Changed ClearWindow to WClrScr
  2411.      . Changed ClearTitle to WClrTitle
  2412.      . Deleted Attr function.
  2413.  
  2414.  
  2415.  
  2416.    Appendix B: Revision History                                        Page 40
  2417.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2418.  
  2419.  
  2420.    Version 5.X (12-20-88):
  2421.      . Compiled WNDW42 under TP5.  No other changes.
  2422.  
  2423.    Version 5.Xa (01-11-89):
  2424.      . Provided initialization code for systems with improperly set cursor 
  2425.        modes.
  2426.  
  2427.    Version 5.Xb (03-04-89):
  2428.      . Integrated QWIK55.TPU for multi-tasking detection.
  2429.      . Added feature for self-centering windows.
  2430.      . Fixed RelMode window placement in virtual screens.
  2431.  
  2432.    Version 5.Xc (05-29-89):
  2433.      . Fixed PermMode Virtual window updates.
  2434.      . Virtual cursor now updates in any write-to mode.
  2435.      . Added CrtWI index for the active window on the CRT.
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.    Appendix B: Revision History                                        Page 41
  2478.    WNDW Multi-level Virtual Windows                 User's Guide, Version 5.5
  2479.  
  2480.  
  2481.    A P P E N D I X   C :   C R E D I T S
  2482.  
  2483.  
  2484.    Fundamental Ideas - The initial concepts of serial-access windows were 
  2485.    developed by Michael Burton in his copy of WINDO.INC, ver 2.4.  The 
  2486.    concepts were used by written permission.
  2487.  
  2488.    Special Effects - Special effects concepts were graciously suggested by 
  2489.    Rick Fothergill.
  2490.  
  2491.    Copyright (c) 1986-1989 by James H. LeMay for Eagle Performance Software.
  2492.    All Rights Reserved.  Protected by the United States Copyright Laws.
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.    Appendix C: Credits                                                 Page 42
  2539. 
  2540.