home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / WNDW55.ZIP / WNDW55.DOC < prev    next >
Encoding:
Text File  |  1989-08-24  |  94.3 KB  |  2,541 lines

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