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