home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / mcwint20.arc / MCWINDOW.DOC < prev    next >
Text File  |  1988-01-10  |  187KB  |  6,535 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                    MC-WINDOW
  19.  
  20.                     WINDOWS AND QUICK WRITE UTILITIES FOR C
  21.  
  22.                              by Michael G. Mlachak
  23.  
  24.                                       and
  25.  
  26.                                Brian L. Cassista
  27.  
  28.  
  29.  
  30.  
  31.                                  January 1988
  32.  
  33.                                   Version 2.0
  34.  
  35.  
  36.  
  37.  
  38.       (C) Copyright 1987, 1988 by Michael G. Mlachak & Brian L. Cassista
  39.                               All Rights Reserved
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                                                              LICENSE AGREEMENT
  135.     __________________________________________________________________________
  136.  
  137.  
  138.      CAREFULLY READ ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT PRIOR
  139.      TO USING THE ENCLOSED SOFTWARE. USING THE ENCLOSED ROUTINES INDICATES
  140.      YOUR ACCEPTANCE OF THESE TERMS AND CONDITIONS.
  141.  
  142.         1. LICENSE: You have the non-exclusive right to use the enclosed
  143.      routines. Programs that you write and compile using these routines
  144.      may be used, given away or sold without additional license or fees.
  145.      These routines can only be used on a single computer or network node.
  146.      You may physically transfer these routines from from one computer to
  147.      another provided that the routines are used on only one computer or
  148.      network node at a time. You may not distribute copies of these routines
  149.      or documentation to others. You may not modify or translate these
  150.      routines or related documentation without the prior written consent
  151.      of Michael G. Mlachak and Brian L. Cassista. The sample programs
  152.      included provide a demonstration of how to use these routines. They
  153.      are intended for educational purposes only. As a registered owner,
  154.      you have the right to edit or modify these sample programs for your
  155.      own use, but you may not give away or sell them, alone or as part of
  156.      any program, in executable, object or source code form. You may,
  157.      however, incorporate miscellaneous sample routines into your programs,
  158.      as long as your resulting programs do not substanstially duplicate
  159.      all or part of a sample program in appearance or functionality.
  160.  
  161.         2. BACKUP AND TRANSFER: You may make as many copies of these
  162.      routines as you want, soley for backup purposes. You must reproduce
  163.      and include the copyright notice on all backup copies. You may not
  164.      transfer or license these routines to another party.
  165.  
  166.         3. COPYRIGHT: These routines and their related documentation
  167.      are copyrighted. You may not copy these routines or its documentation
  168.      except for backup purposes. All other copies of these routines and
  169.      their documentation are in violation of this agreement.
  170.  
  171.         4. TERM: This license is effective until terminated. You may
  172.      terminate it by destroying the program and documentation and all
  173.      copies thereof. This license will also terminate if you fail to
  174.      comply with any term or condition of this Agreement. You agree, upon
  175.      termination, to destroy all copies of these routines and documentation.
  176.  
  177.         5. LIMITED WARRANTY: THE ROUTINES ARE PROVIDED "AS IS" WITHOUT
  178.      WARRANTY OF ANY KIND. THE ENTIRE RISK AS TO THE RESULTS AND
  179.      PERFORMANCE OF THESE ROUTINES IS ASSUMED BY YOU. SHOULD THESE
  180.      ROUTINES PROVE DEFECTIVE, YOU (NOT MICHAEL G. MLACHAK AND/OR BRIAN
  181.      L. CASSISTA) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,
  182.      REPAIR OR CORRECTION. FURTHER, MICHAEL G. MLACHAK OR BRIAN L.
  183.      CASSISTA DO NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS
  184.      REGARDING THE USE OF, OR THE RESULTS OF THE USE OF, THESE ROUTINES
  185.      IN TERMS OF CORRECTNESS, ACCURACY, RELIABLITY, CURRENTNESS, OR
  186.      OTHERWISE; AND YOU RELY ON THESE ROUTINES AND RESULTS SOLELY AT
  187.      YOUR OWN RISK.
  188.         Michael G. Mlachak and Brian L. Cassista do warrant to the original
  189.      licensee that the disk(s) on which these routines were recorded be
  190.  
  191.  
  192.          MC-WINDOW                                                           1
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.     LICENSE AGREEMENT
  201.     __________________________________________________________________________
  202.  
  203.      free from defects in materials and workmanship under normal use and
  204.      service for a period of 90 days from the date of delivery as evidenced
  205.      by a copy of your receipt. Michael G. Mlachak's and Brian L. Cassista's
  206.      entire liability and your exclusive remedy shall be replacement of the
  207.      disk not meeting the limited warranty and which is returned to either
  208.      Michael G. Mlachak or Brian L. Cassista with a copy of your receipt.
  209.      If failure of the disk has resulted from accident, abuse, or
  210.      misapplication of the product, then Michael G. Mlachak and Brian L.
  211.      Cassista shall have no responsibility to replace the disk under this
  212.      limited warranty.
  213.         THE ABOVE IS THE ONLY WARRANTY OF ANY KIND, EITHER EXPRESSED OR
  214.      IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  215.      MERCHANTABILITY AND FITNESS FOR A PARTICULIAR PURPOSE THAT IS MADE
  216.      BY MICHAEL G. MLACHAK AND BRIAN L. CASSISTA ON THESE ROUTINES.
  217.  
  218.         6. UPDATE POLICY: In order to be able to obtain updates of these
  219.      routines, the licensee in accordance with this agreement must
  220.      complete and return the attached registration form to either Michael
  221.      G. Mlachak or Brian L. Cassista. IF THIS REGISTRATION FORM HAS NOT
  222.      BEEN RECEIVED BY MICHAEL G. MLACHAK OR BRIAN L. CASSISTA THEY ARE
  223.      NOT UNDER ANY OBLIGATION TO MAKE AVAILABLE ANY UPDATES EVEN THOUGH
  224.      PAYMENT OF THE APPLICABLE UPDATE FEE HAS BEEN MADE.
  225.  
  226.         7. ACKNOWLEDGEMENT: YOU ACKNOWLEDGE THAT YOU HAVE READ THIS
  227.      AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS AND
  228.      CONDITIONS. YOU ALSO AGREE THAT THIS AGREEMENT IS THE COMPLETE
  229.      AND EXCLUSIVE STATEMENT OF AGREEMENT BETWEEN THE PARTIES AND
  230.      SUPERCEDES ALL PROPOSALS OR PRIOR AGREEMENTS, VERBAL OR WRITTEN,
  231.      AND ANY OTHER COMMUNICATIONS BETWEEN THE PARTIES RELATING TO
  232.      THE SUBJECT MATTER OF THIS AGREEMENT.
  233.         Should you have any questions concerning this Agreement, please
  234.      contact:
  235.  
  236.                  Michael G. Mlachak           Brian L. Cassista
  237.                  4318 Stewart Court           165 South Floyd Lane
  238.                  E. Chicago, IN. 46312        Chicago Heights, IL. 60411
  239.                  (219)-397-4066               (312)-756-3567
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.          MC-WINDOW                                                           2
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.     __________________________________________________________________________
  268.  
  269.  
  270.      Information in this document is subject to change without notice and
  271.      does not represent a commitment on the part of Michael G. Mlachak or
  272.      Brian L. Cassista.  The software described in this document is
  273.      furnished under a license agreement or nondisclosure agreement.  The
  274.      software may be used or copied only in accordance with the terms of
  275.      the agreement.  No part of this manual may be reproduced or transmitted
  276.      in any form or by any means, electronic or mechanical, including
  277.      photocopying and recording, for any purpose other than the purchaser's
  278.      personal use without the written permission of Michael G. Mlachak and
  279.      Brian L. Cassista.
  280.  
  281.  
  282.  
  283.       (C) Copyright 1987, 1988 by Michael G. Mlachak & Brian L. Cassista
  284.                               All Rights reserved
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.      Microsoft C 5.0, Microsoft Macro Assembler 4.0, Microsoft Macro
  292.      Assembler 5.0 ,Microsoft Quick-C 1.0 are registered trademarks of
  293.      Microsoft Corporation.
  294.  
  295.      IBM is a registered trademark of the the International Business
  296.      Machines Corporation.
  297.  
  298.      Turbo-C, Turbo Pascal are a registerd trademark of Borland International
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.          MC-WINDOW                                                           3
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.     REGISTRATION FORM
  333.     __________________________________________________________________________
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.                                REGISTRATION FORM
  344.  
  345.  
  346.      Please print:
  347.  
  348.      NAME: ______________________________________________________________
  349.  
  350.      COMPANY: ___________________________________________________________
  351.  
  352.      SHIPPING ADDRESS: __________________________________________________
  353.  
  354.      CITY: ______________________________________________________________
  355.  
  356.      STATE: ___________________________ ZIP: ____________________________
  357.  
  358.      PHONE: (WORK) _______________________ (HOME) _______________________
  359.  
  360.      SERIAL NUMBER: _____________________________________________________
  361.  
  362.      COMPILER SUPPORT: MSC 5.0 & Quick-C___  MSC 4.0 ___  TURBO-C ___
  363.  
  364.  
  365.      REGISTRATION TYPE: (See section 1.4.2 Obtaining the Latest Source
  366.                                 Code and Libraries)
  367.  
  368.         Full Registration    ____
  369.  
  370.         Novice Registration  ____
  371.  
  372.         Other                ____
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.          MC-WINDOW                                                           4
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.                                                              TABLE OF CONTENTS
  399.     __________________________________________________________________________
  400.  
  401.  
  402.      ⁿ PART 1 OVERVIEW
  403.  
  404.        1.1     INTRODUCTION................................................ 9
  405.  
  406.        1.1.1   About the Windows and Qwik Write Utilities..................10
  407.  
  408.        1.2     USING THE WINDOWS AND QWIK WRITE ROUTINES...................11
  409.  
  410.        1.2.1   Introduction................................................12
  411.        1.2.2   Memory Model Support........................................12
  412.        1.2.3   Global Variables and Types..................................13
  413.        1.2.4   Including Files.............................................16
  414.        1.2.5   Declaring Functions.........................................17
  415.        1.2.6   Argument-Type Checking......................................17
  416.        1.2.7   Error Handling..............................................17
  417.        1.2.8   Compiling and Linking.......................................18
  418.  
  419.        1.3     RUN-TIME ROUTINES BY CATEGORY...............................24
  420.  
  421.        1.3.1   Introduction................................................25
  422.        1.3.2   Screen Filling..............................................25
  423.        1.3.3   Screen Initialization.......................................25
  424.        1.3.4   Screen I/O..................................................26
  425.        1.3.5   Screen Manipulation.........................................26
  426.        1.3.6   Screen Storing and Restoring................................26
  427.        1.3.7   Screen Paging...............................................26
  428.        1.3.8   Screen Writing..............................................27
  429.        1.3.9   Windowing...................................................27
  430.        1.3.10  Menuing.....................................................28
  431.        1.3.11  Miscellaneous...............................................28
  432.  
  433.        1.4    COMPILING THE SOURCE CODE AND BUILDING LIBRARIES.............30
  434.  
  435.        1.4.1  Introduction.................................................31
  436.        1.4.2  Obtaining the Latest Source Code and Libraries...............31
  437.        1.4.3  Microsoft 5.0 Compiler.......................................31
  438.        1.4.4  Microsoft Quick-C 1.0 Compiler...............................32
  439.        1.4.5  Microsoft 4.0 Compiler.......................................33
  440.        1.4.6  Turbo-C  1.0 Compiler........................................33
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.          MC-WINDOW                                                           5
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.     TABLE OF CONTENTS
  465.     __________________________________________________________________________
  466.  
  467.  
  468.      ⁿ PART 2 REFERENCE....................................................35
  469.  
  470.        cursorchange...................35    qstore.........................63
  471.        delete.........................36    qwrite.........................65
  472.        egacheck.......................37    qwritec........................66
  473.        get_integer....................38    qwritef........................67
  474.        get_menu.......................39    qwritelv.......................69
  475.        get_string.....................42    qwritepage.....................70
  476.        get_video_mode.................44    remove_all_windows.............72
  477.        getkey.........................45    remove_windows.................73
  478.        gotorc.........................46    removewindow...................74
  479.        initwindow.....................47    scrollwindow...................75
  480.        insert.........................48    titlewindow....................77
  481.        makewindow.....................49    vwrite.........................79
  482.        qattr..........................51    where_col......................80
  483.        qattrc.........................52    where_row......................81
  484.        qbox...........................54    wiattr.........................82
  485.        qfill..........................56    window_bios_scroll.............83
  486.        qfillc.........................57    window_printf..................84
  487.        qinit..........................59    window_write...................86
  488.        qpage..........................60    wsleep.........................88
  489.        qrestore.......................61    wsound.........................89
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.          MC-WINDOW                                                           6
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.                                                              TABLE OF CONTENTS
  531.     __________________________________________________________________________
  532.  
  533.  
  534.      ⁿ APPENDIX............................................................90
  535.  
  536.        Function Names and Modules..........................................91
  537.        Module Names and Functions..........................................92
  538.  
  539.      ⁿ INDEX...............................................................93
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.          MC-WINDOW                                                           7
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.     PART 1 OVERVIEW
  597.     __________________________________________________________________________
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.      The first part of this manual provides information common to all of
  605.      the Windows and Qwik Write Utilities.
  606.  
  607.      Here you'll find definitions for global variables, data types, and
  608.      include files, and useful background information on the different
  609.      categories of run-time routines.
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.          MC-WINDOW                                                           8
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.                                                                      CHAPTER 1
  663.     __________________________________________________________________________
  664.  
  665.  
  666.  
  667.      1.1 INTRODUCTION
  668.  
  669.        1.1.1   About the Windows and Qwik Write Utilities..................10
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.          MC-WINDOW                                                           9
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.     INTRODUCTION
  729.     __________________________________________________________________________
  730.  
  731.  
  732.  
  733.      1.1.1 ABOUT THE WINDOWS AND QWIK WRITE UTILITIES
  734.  
  735.  
  736.      WINDOW ROUTINES
  737.  
  738.         These routines create incredibly quick multi-level windows as
  739.         library calls in C programs, for the IBM PC/XT/AT and 100%
  740.         compatibles.  They work on MDA, CGA, and EGA, adapters in any
  741.         column mode (40/80,etc).  The window routines use the Qwik
  742.         Utlities for screen writing and are also available in library
  743.         form.  The Qwik Utilities were translated from TURBO PASCAL
  744.         inline assembly to external assembly that is recognizeable by C.
  745.  
  746.  
  747.         To take a test drive and see how powerful, fast and easy to use
  748.         these window routines are compile and run the WTUTOR20.C file. A
  749.         compiled demo WTUTOR20.EXE is also supplied for your convenience.
  750.  
  751.  
  752.      QWIK WRITE UTILITIES
  753.  
  754.         The Qwik Write Utilities permit fast screen writing on IBM and
  755.         100% compatibles with MDA, CGA, or EGA adapters without "snow"
  756.         or flicker. These routines work with any column format on any
  757.         video page.  Written in Microsoft macro-assembler, these
  758.         routines are lightning fast.  The code has been optimized as
  759.         much as possible without sacrificing any speed.
  760.  
  761.  
  762.         To take a test drive and see how powerful, fast and easy to use
  763.         these Qwik routines are compile and run the QDEMO20.C file. A
  764.         compiled demo QDEMO20.EXE is also supplied for your convenience.
  765.  
  766.  
  767.         Many thanks go to Jim LeMay whose routines these are based upon.
  768.                  (Turbo Pascal version (C) 86,87 Jim H. LeMay)
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.         MC-WINDOW                                                           10
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.                                                                      CHAPTER 2
  795.     __________________________________________________________________________
  796.  
  797.  
  798.  
  799.      1.2 USING THE WINDOWS AND QWIK WRITE ROUTINES
  800.  
  801.        1.2.1   Introduction................................................12
  802.        1.2.2   Memory Model Support........................................12
  803.        1.2.3   Global Variables and Types..................................13
  804.        1.2.4   Include Files...............................................16
  805.        1.2.5   Declaring Functions.........................................17
  806.        1.2.6   Argument-Type Checking......................................17
  807.        1.2.7   Error Handling..............................................17
  808.        1.2.8   Compiling and Linking.......................................18
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.         MC-WINDOW                                                           11
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  861.     __________________________________________________________________________
  862.  
  863.  
  864.  
  865.      1.2.1 Introduction
  866.  
  867.  
  868.      To use a Window or Qwik Write routine, simply call it in your program,
  869.      just as if the routine were defined in your program. The Window and
  870.      Qwik Write Utilities are stored in compiled form in the library files
  871.      accompanying this disk. Only registered users will have access to
  872.      all memory model support libraries for a specific compiler. (See
  873.      section 1.2.2 for more info)
  874.  
  875.      At link time, your program must be linked with the appropriate library
  876.      file(s) to resolve the references to the library functions and
  877.      provide the code for the called library functions.  The procedures
  878.      for linking with the library are dicussed in detail section 1.2.8.
  879.  
  880.      In most cases you must prepare for the call to the run-time library
  881.      function by performing one or both of these steps.
  882.  
  883.         1. Include a given file in your program. Many routines require
  884.            definitions and declarations that are provided by an include
  885.            file.  (See 1.2.4)
  886.  
  887.         2. Provide declarations for library functions that return values
  888.            of any type but int.  (See 1.2.5)
  889.  
  890.  
  891.      1.2.2 Memory Model Support
  892.  
  893.  
  894.      The following libraries are available for registered users of a
  895.      specific compiler:
  896.  
  897.           Compiler                Model        Library Name
  898.  
  899.         Microsoft 5.0*            Small          m5swin20.lib
  900.         Microsoft 5.0             Compact        m5cwin20.lib
  901.         Microsoft 5.0             Medium         m5mwin20.lib
  902.         Microsoft 5.0             Large          m5lwin20.lib
  903.         Microsoft 4.0*            Small          m4swin20.lib
  904.         Microsoft 4.0             Compact        m4cwin20.lib
  905.         Microsoft 4.0             Medium         m4mwin20.lib
  906.         Microsoft 4.0             Large          m4lwin20.lib
  907.         Microsoft Quick-C*        Small          q1swin20.lib
  908.         Microsoft Quick-C         Compact        q1cwin20.lib
  909.         Microsoft Quick-C         Medium         q1mwin20.lib
  910.         Microsoft Quick-C         Large          q1lwin20.lib
  911.         Microsoft Quick-C**       Medium         q1mwin20.qlb
  912.         Turbo-C   1.0*            Small          t1swin20.lib
  913.         Turbo-C   1.0             Compact        t1cwin20.lib
  914.         Turbo-C   1.0             Medium         t1mwin20.lib
  915.         Turbo-C   1.0             Large          t1lwin20.lib
  916.  
  917.  
  918.         MC-WINDOW                                                           12
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  927.     __________________________________________________________________________
  928.  
  929.  
  930.  
  931.      If this is a distribution only copy of the routines you should
  932.      find one of the libraries on the disk that is marked with an
  933.      asterik (*).
  934.  
  935.      This library is need for linking from within the Quick-C 1.0
  936.      environment (**).
  937.  
  938.      See section 1.4.2 for information on how to order another memory
  939.      model, this documentation, or become a registered user.
  940.  
  941.  
  942.      1.2.3 Global Variables and Types
  943.  
  944.  
  945.      The Window and Qwik Write Utility library xxxwin20.lib contains
  946.      definitions for a number of variables and types used by the
  947.      library routines.  You can access these variables and types by
  948.      including in your program the files in which they are declared
  949.      (See section 1.2.4) or by giving appropriate declarations in your
  950.      program, as shown in the following explanations.
  951.  
  952.  
  953.      Global Variables and Constants
  954.  
  955.      MAXWNDOW                  - maximum number of windows that the library
  956.                                  routines can handle. Do not change this value
  957.                                  unless you are rebuilding the library.
  958.  
  959.      unsigned page0seg         - global variable used to hold the active
  960.                                  screen segment of the Qwik Write Utility page
  961.                                  we are on. This variable is initialized by a
  962.                                  call to qinit() and should only be modified
  963.                                  by a call to qwritepage(), which changes the
  964.                                  page the Qwik Write Utilities writes on.
  965.  
  966.      unsigned qseg             - global variable used to hold the base
  967.                                  address of the screen segment. This address
  968.                                  is also reset on any subsequent call to
  969.                                  qinit() or initwindow(). This variable could
  970.                                  be manually set if the user so desires.
  971.  
  972.      int maxpage               - global variable used to hold the maximum
  973.                                  number of video pages that a monitor can
  974.                                  support. This variable is also set by qinit()
  975.                                  and can range from 0-7.
  976.  
  977.      int cardwait              - global variable used to check to see if a
  978.                                  monitor needs to wait for the video retrace
  979.                                  signal. It may be modified after a call to
  980.                                  qinit() which sets it to 1 for retrace or
  981.                                  0 for no retrace.
  982.  
  983.  
  984.         MC-WINDOW                                                           13
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  993.     __________________________________________________________________________
  994.  
  995.  
  996.      int qwait                 - same as cardwait, but used externally by
  997.                                  the assembler modules.
  998.  
  999.      int zoomeffect            - global variable that turns on the exploding
  1000.                                  box effect. This variable may be set to
  1001.                                  TRUE (1) any time before a makewindow()
  1002.                                  command is executed. It remains in effect
  1003.                                  until explicitly turned off.
  1004.  
  1005.      int zoomdelay             - global variable used to compensate for fast
  1006.                                  exploding windows. If you find that your boxes
  1007.                                  are exploding faster than you like them, try
  1008.                                  experimenting with this value. It defaults to
  1009.                                  11 milliseconds, which is perfect for a MDA
  1010.                                  monitor.
  1011.  
  1012.      int oldcursor             - global variable used to store the current
  1013.                                  cursor shape. Can be used anywhere in program
  1014.                                  and has a default value of 8192 (invisible).
  1015.  
  1016.      int active_window_row     - global variable used by the qwritef() ,
  1017.                                  window_write() and window_printf() functions.
  1018.                                  this variable holds the position of the last
  1019.                                  row in the window that was written to. It may
  1020.                                  be modified at any time prior to any of the
  1021.                                  above window calls.
  1022.  
  1023.      int active_window_col     - global variable used by the qwritef() ,
  1024.                                  window_write() and window_printf() functions.
  1025.                                  this variable holds the position of the last
  1026.                                  column in the window that was written to. It
  1027.                                  may be modified at any time prior to any of
  1028.                                  the above window calls.
  1029.  
  1030.  
  1031.      enum DIRTYPE shadoweffect - global enumerated type variable that
  1032.                                  holds the type of shadow effect that is
  1033.                                  placed around the borders of a window.
  1034.                                  This must be set to the proper type
  1035.                                  before makewindow() is called. It
  1036.                                  defaults to no effect. (See next
  1037.                                  paragraph for type explanation)
  1038.  
  1039.  
  1040.      TYPES
  1041.  
  1042.  
  1043.      enum BORDERS { nobrdr,blankbrdr,singlebrdr,doublebrdr,mixedbrdr,
  1044.                     solidbrdr,evensolidbrdr,thinsolidbrdr,lhatchbrdr,
  1045.                     mhatchbrdr,hhatchbrdr,userbrdr
  1046.                   };
  1047.  
  1048.  
  1049.  
  1050.         MC-WINDOW                                                           14
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  1059.     __________________________________________________________________________
  1060.  
  1061.      Used for type of border on makewindow() and qbox():
  1062.  
  1063.                     nobrdr     - no border
  1064.                     blankbrdr  - no border
  1065.                     singlebrdr - single border
  1066.                     doublebrdr - double border
  1067.                     mixedbrdr  - single sides, double top and bottom
  1068.                     solidbrdr  - inverted space for all borders
  1069.                     evensolid  - even solid border
  1070.                     thinsolid  - thin solid border
  1071.                     lhatchbrdr - low intensity hatch border
  1072.                     mhatchbrdr - medium intensity hatch border
  1073.                     hhatchbrdr - high intensity hatch border
  1074.                     userbrdr   - user defined border (same as nobrdr)
  1075.  
  1076.         enum DIRTYPE { nodir,up,down,cleartop,clearbottom,clearleftside,
  1077.                        clearrightside, topleft,topright,topcenter,bottomleft,
  1078.                        bottomright,bottomcenter,leftside,rightside,left,right
  1079.                      };
  1080.  
  1081.         Has various uses depending on the function called or variable used:
  1082.  
  1083.         titlewindow():
  1084.  
  1085.                     topleft         - top line, left justified
  1086.                     topcenter       - top line, center justified
  1087.                     topright        - top line, right justified
  1088.                     bottomleft      - bottom line, left justified
  1089.                     bottomcenter    - bottom line, center justified
  1090.                     bottomright     - bottom line, right justified
  1091.                     clearbottom     - clear bottom line by placing
  1092.                                       the current bottom character there.
  1093.                     cleartop        - clear top line by placing
  1094.                                       the current top character there.
  1095.                     clearleftside   - clear left side line by placing
  1096.                                       the current left side character there.
  1097.                     clearrighttside - clear right side line by placing
  1098.                                       the current right side character there.
  1099.                     leftside        - left side of window centered
  1100.                     rightside       - right side of window centered
  1101.  
  1102.         scrollwindow():
  1103.  
  1104.                     up   - scroll window up
  1105.                     down - scroll window down
  1106.  
  1107.         shadoweffect: (see above)
  1108.  
  1109.                     bottomleft  - shadowfill on the left and bottom
  1110.                     bottomright - shadowfill on the right and bottom
  1111.                     topleft     - shadowfill on left and top
  1112.                     topright    - shadowfill on right and top
  1113.  
  1114.  
  1115.  
  1116.         MC-WINDOW                                                           15
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  1125.     __________________________________________________________________________
  1126.  
  1127.  
  1128.      1.2.4 Include Files
  1129.  
  1130.      The xxxwin20.lib routines use constants, variables and types that
  1131.      are defined in three separate include files. A fourth file is
  1132.      included that contains color constants. Each is explained in
  1133.      detail below.
  1134.  
  1135.      w.h        - contains the enumerated types needed by the window routines,
  1136.                   the window data structures, the border structure and
  1137.                   miscellaneous window pointers, variables and types. This
  1138.                   include file is only needed if you plan to recompile the
  1139.                   window routines and rebuild a specific library.
  1140.  
  1141.      w1.h       - contains the enumerated types needed by the window routines.
  1142.                   If you use any of the window routines this include file
  1143.                   must be at the top of your program.
  1144.  
  1145.      windprot.h - contains the prototypes for the functions in the
  1146.                   xxxwin20.lib. It also includes the global variables
  1147.                   that are needed to resolve references at link time.
  1148.                   Use this file always, especially if you want strong
  1149.                   type checking on parameters passed to the xxxwin20.lib
  1150.                   routines. (See 1.2.6)
  1151.  
  1152.      color.h    - contains the color constants that can be used by
  1153.                   the attribute function wiattr(), etc.
  1154.  
  1155.      A global constant USE_LOCAL should be defined before any of the
  1156.      above include files if the module you are compiling contains
  1157.      the main() function. Otherwise all references to the global
  1158.      variables defined in section 1.2.3 will be external. An example
  1159.      follows.
  1160.  
  1161.      Setup for main module
  1162.  
  1163.      #define USE_LOCAL
  1164.      #include <w1.h>                      /* define those types, if needed */
  1165.      #include <windprot.h>                /* invoke type checking */
  1166.      <your other include files go here>
  1167.                 :
  1168.                 :
  1169.      initwindow();                        /* if window routines used ,else */
  1170.      qinit();                             /* only if Qwik- utils used      */
  1171.      <main and it's code goes here>
  1172.                 :
  1173.                 :
  1174.                 :
  1175.  
  1176.  
  1177.      Setup for another module - All references are external
  1178.  
  1179.      #include <w1.h>                 /* define those types ,if needed */
  1180.  
  1181.  
  1182.         MC-WINDOW                                                           16
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  1191.     __________________________________________________________________________
  1192.  
  1193.      #include <windprot.h>           /* invoke type checking */
  1194.      <other include files go here>
  1195.                 :
  1196.                 :
  1197.      <main and it's code goes here>
  1198.                 :
  1199.                 :
  1200.                 :
  1201.  
  1202.  
  1203.      1.2.5 Declaring Functions
  1204.  
  1205.  
  1206.      Whenever you call a routine in the xxxwin20.lib that returns any
  1207.      type of value but an int, you should make sure that the function
  1208.      is declared before it is called. The easiest way to do this is to
  1209.      include the file containing declarations for the xxxwin20.lib
  1210.      functions (windprot.h), causing the appropriate declarations to
  1211.      be placed in your program.
  1212.  
  1213.      The windprot.h include file declares both the return type and
  1214.      the argument-type list for the xxxwin20.lib. This include file
  1215.      will allow you argument-type checking, (See 1.2.6) which is
  1216.      highly recommended, since type mismatches between a function's
  1217.      arguments and formal parameters can cause serious and possible
  1218.      hard to detect errors.
  1219.  
  1220.  
  1221.      1.2.6 Argument-Type Checking
  1222.  
  1223.  
  1224.      The compilers that were used to compile these routines offer a
  1225.      type-checking feature for the arguments in a function call.
  1226.      Type checking is performed whenever an argument-type list is
  1227.      present in a function declaration and the declaration appears
  1228.      before the definition or use of the function in a program. To
  1229.      invoke this feature on your compiler include the windprot.h
  1230.      header file at the top of your program and the compiler will
  1231.      do the rest, flagging errors as it goes along. (See example
  1232.      of sample setup in section 1.2.4)
  1233.  
  1234.  
  1235.      1.2.7 Error Handling
  1236.  
  1237.  
  1238.      Most of the xxxwin20.lib routines do minimal error checking. Only
  1239.      the most fatal errors are trapped for and are considered to be
  1240.      fatal enough to cause HAVOC if further processing continues. In all
  1241.      of these cases a message is printed on the screen with printf() and
  1242.      the user is returned to DOS.  (See Part2, "Reference", on each
  1243.      individual function for the specific amount of error checking). The
  1244.      following errors are considered to be fatal:
  1245.  
  1246.  
  1247.  
  1248.         MC-WINDOW                                                           17
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  1257.     __________________________________________________________________________
  1258.  
  1259.      Windows
  1260.  
  1261.         removewindow() - Attempt to remove a window that does not exist.
  1262.                          Possible call to removewindow() without a
  1263.                          makewindow. For every makewindow() there must
  1264.                          be a removewindow().
  1265.  
  1266.         makewindow()   - Maximum window count of xx exceeded. xx defaults
  1267.                          to 30 in all versions of the xxxwin20.lib. Possible
  1268.                          fix is to recompile source with MAXWNDW set to
  1269.                          some other constant.
  1270.  
  1271.                        - Not enough heap space for window xx. Not enough
  1272.                          heap space was available for allocation of the
  1273.                          window. Possible fix is to reduce the available
  1274.                          stack or move to the next higher memory model.
  1275.  
  1276.         scrollwindow() - Not enough heap space in Qscroll. Not enough
  1277.                          heap space  was avialble for allocation of the
  1278.                          window needed for scrolling. Possible fix is to
  1279.                          reduce the available stack or move to the next
  1280.                          higher memory model.
  1281.  
  1282.  
  1283.      1.2.8 Compiling and Linking
  1284.  
  1285.  
  1286.      To compile a module that uses the xxxwin20.lib routines, include
  1287.      the proper xxxwin20.lib header files and compile like you would
  1288.      compile any other C module. When it comes time to link make sure
  1289.      you have the right xxxwin20.lib library for the memory model and
  1290.      compiler you are using. If your compiler has environment variables
  1291.      you may want to use them to keep all your header files and library
  1292.      files in a separate directory. (See examples below)
  1293.  
  1294.      NOTE: Some advanced users of (C) and their compilers will set up
  1295.            make files for their programming chores. For more information
  1296.            on how to set up a make file see the documentation in your
  1297.            programming manual.
  1298.  
  1299.      Below is a sample program, and an explanation of how to compile
  1300.      and link it in the SMALL memory model for the following compilers:
  1301.      Microsoft 5.0, Microsoft 4.0, Turbo-C 1.0, and Quick-C 1.0. The sample
  1302.      program will be used for all 4 compilers. It explodes a window on the
  1303.      screen with a YELLOW on BLUE inside,a WHITE on RED double sided border,
  1304.      and a shadow on the top right. The window will start at row 4, column 1
  1305.      and end at row 25, col 74. Once the window is created it will then
  1306.      be removed and the program will terminate.
  1307.  
  1308.      Sample Program- sample.c
  1309.  
  1310.      #define USE_LOCAL
  1311.      #define WATTR 31                 /* window inside attribute */
  1312.  
  1313.  
  1314.         MC-WINDOW                                                           18
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  1323.     __________________________________________________________________________
  1324.  
  1325.      #define BATTR 79                 /* border attribute        */
  1326.  
  1327.      #include <w1.h>
  1328.      #include <windprot.h>
  1329.      #include <stdio.h>
  1330.  
  1331.      int main(int,char *[]);          /* prototype for error checking */
  1332.  
  1333.      int main(argc, argv)
  1334.        int argc;
  1335.        char *argv[];
  1336.      {
  1337.         int index;                    /* for delay */
  1338.  
  1339.         if ((argc != 1) && (argv[1] != NULL)) /* simple error check  */
  1340.            return(-1);
  1341.         initwindow(79,1);             /* initialize window routines */
  1342.         zoomeffect = 1;               /* turn expoding effect on    */
  1343.         shadoweffect = topright;      /* select shadow effect       */
  1344.         makewindow(4,1,21,74,WATTR,BATTR,doublebrdr);  /* window */
  1345.         for (index = 0; index < 30000; index++);       /* delay  */
  1346.         removewindow();               /* remove the window */
  1347.         return(0);
  1348.      } /* of main */
  1349.  
  1350.  
  1351.      Compile and Link Microsoft 5.0
  1352.  
  1353.  
  1354.      Assumptions - Compilation and link takes place on a hard disk
  1355.                    machine drive C:. On this drive the default setup
  1356.                    was used to install the compiler.
  1357.  
  1358.                  - The following path variables are set:
  1359.  
  1360.                      PATH = c:\msc5\bin
  1361.                      INCLUDE = c:\msc5\include
  1362.                      LIBRARY = c:\msc5\lib
  1363.                      TMP = c:\msc5\tmp
  1364.  
  1365.                  - The include files were copied from the distribution
  1366.                    disk to the c:\msc5\include subdirectory.
  1367.  
  1368.                  - The library file m5swin20.lib was copied off the
  1369.                    distribution disk to the c:\msc5\lib subdirectory.
  1370.  
  1371.                  - The active directory is c:\msc5\source. This is where
  1372.                    the sample program resides.
  1373.  
  1374.      Process - Invoke the compiler and have it call the linker to
  1375.                resolve our window function declarations. The sample.exe
  1376.                file will be in the current directory c:\msc5\source.
  1377.                Notice floating point emulation has been chosen (FPc) and
  1378.  
  1379.  
  1380.         MC-WINDOW                                                           19
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  1389.     __________________________________________________________________________
  1390.  
  1391.                strong type checking has been enabled with the most
  1392.                severe warning messages (W3 DLINT_ARGS) for the small
  1393.                memory model (AS).
  1394.  
  1395.                CL /AS /FPc /W3 /DLINT_ARGS sample.c /link m5swin20
  1396.  
  1397.  
  1398.      Compile and Link Microsoft 4.0
  1399.  
  1400.  
  1401.      Assumptions - Compilation and link takes place on a hard disk
  1402.                    machine drive C:. On this drive the default setup
  1403.                    was used to install the compiler.
  1404.  
  1405.                  - The following path variables are set:
  1406.  
  1407.                      PATH = c:\msc4\bin
  1408.                      INCLUDE = c:\msc4\include
  1409.                      LIBRARY = c:\msc4\lib
  1410.                      TMP = c:\msc4\tmp
  1411.  
  1412.                  - The include files were copied from the distribution
  1413.                    disk to the c:\msc4\include subdirectory.
  1414.  
  1415.                  - The library file m4swin20.lib was copied off the
  1416.                    distribution disk to the c:\msc4\lib subdirectory.
  1417.  
  1418.                  - The active directory is c:\msc4\source. This is where
  1419.                    the sample program resides.
  1420.  
  1421.      Process - Invoke the compiler and call the linker to resolve our
  1422.                window function declarations. The sample.exe file will
  1423.                be in the current directory c:\msc4\source. Notice floating
  1424.                point emulation has been chosen (FPc) and strong type
  1425.                checking has been enabled with the most severe warning
  1426.                messages (W3 DLINT_ARGS) for the small memory model (AS).
  1427.  
  1428.                MSC /AS /FPc /W3 /DLINT_ARGS sample.c
  1429.  
  1430.                LINK sample,sample,NUL,m4swin20.lib;
  1431.  
  1432.  
  1433.      Compile and Link Quick-C 1.0
  1434.  
  1435.  
  1436.      Assumptions - Compilation and link takes place on a hard disk
  1437.                    machine drive C:. On this drive the default setup
  1438.                    was used to install the compiler.
  1439.  
  1440.                  - The following path variables are set :
  1441.  
  1442.                         PATH = c:\msc5\bin
  1443.                         INCLUDE = c:\msc5\include
  1444.  
  1445.  
  1446.         MC-WINDOW                                                           20
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  1455.     __________________________________________________________________________
  1456.  
  1457.                         LIBRARY = c:\msc5\lib
  1458.                         TMP = c:\msc5\tmp
  1459.  
  1460.                  - The include directory is c:\msc5\include and the
  1461.                    header files from the window distribution disk were
  1462.                    copied here.
  1463.  
  1464.                  - The library directory is c:\msc5\lib and the library
  1465.                    files from the window distribution disk were copied
  1466.                    here.
  1467.  
  1468.                  - The active directory is c:\msc5\source. This is where
  1469.                    the sample program resides.
  1470.  
  1471.      Process - (A)  Invoke the compiler from the interactive environment
  1472.                     with the environment set to the above subdirectories.
  1473.                     Make sure that q1mwin20.lib and q1mwin20.qlb reside
  1474.                     in the library directory. Load Quick-C with the
  1475.                     following command:
  1476.  
  1477.                         qc /l q1mwin20 sample.c
  1478.  
  1479.                     Choose the FILE option "Set Program List". At the
  1480.                     filename prompt enter the following:
  1481.  
  1482.                         sample.mak <CR>
  1483.  
  1484.                     You are then prompted to create the file, select YES.
  1485.                     At the filename prompt enter the following:
  1486.  
  1487.                         sample.c <CR>
  1488.                         c:\msc5\lib\q1mwin20.lib <CR>
  1489.  
  1490.                     Now save the list by hitting the TAB key till
  1491.                     Save List is hilighted, then hit return. Next select
  1492.                     the RUN option Compile, and set the following options:
  1493.  
  1494.                         - Warning : level 3
  1495.                         - Output  : EXE
  1496.                         - Misc    : Stack Checking
  1497.                         - Misc    : Language Extensions
  1498.  
  1499.                     Hilight the Build Program selection and hit return
  1500.                     to build the program.
  1501.  
  1502.                (B)  Invoke the compiler from the command line by issuing
  1503.                     the following command. Notice the following options:
  1504.  
  1505.                         /AS         - small model
  1506.                         /DLINT_ARGS - enable argument checking
  1507.                         /W3         - set maximum warning level
  1508.                         /link       - specify the library to use in
  1509.                                       addition to the standard libraries.
  1510.  
  1511.  
  1512.         MC-WINDOW                                                           21
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.     USING THE WINDOWS AND QWIK WRITE ROUTINES
  1521.     __________________________________________________________________________
  1522.  
  1523.  
  1524.                     The last item on the command line MUST be a semi colon.
  1525.  
  1526.                         qcl /AS /DLINT_ARGS /W3 sample.c /link q1swin20;
  1527.  
  1528.  
  1529.      Compile and Link Turbo-C 1.0
  1530.  
  1531.  
  1532.      Assumptions - Compilation and link takes place on a hard disk
  1533.                    machine drive C:. On this drive the default setup
  1534.                    for Turbo-C was used.
  1535.  
  1536.                  - The following path variables are set:
  1537.  
  1538.                     PATH = c:\turboc
  1539.  
  1540.                  - The include directory is c:\turboc\include and the
  1541.                    header files from the window distribution disk were
  1542.                    copied here.
  1543.  
  1544.                  - The library directory is c:\turboc\lib and the library
  1545.                    files from the window distribution disk were copied
  1546.                    here.
  1547.  
  1548.                  - The active directory is c:\turboc and this is where
  1549.                    the source (sample.c) and the executable versions of the
  1550.                    interactive and command line version of the Turbo-C
  1551.                    compiler reside.
  1552.  
  1553.      Process - (A) Invoke the compiler from the interactive environment
  1554.                    with the environment set to the above subdirectories.
  1555.                    Create the following PRJ file (sample.prj).
  1556.  
  1557.                         sample.c  (w1.h, windprot.h)
  1558.                         c:\turboc\lib\t1swin20.lib
  1559.  
  1560.                    Load this file into the interactive environment
  1561.                    with the PROJECT option (main menu). Next load the
  1562.                    sample.c source file into the environment with the
  1563.                    FILE option on the main menu . All you do now is
  1564.                    hit the F9 key. This will make the file and do all
  1565.                    the linking. When it is done your sample.exe will be
  1566.                    in the directory specified in the environment option
  1567.                    output directory (OPTIONS on the main menu).
  1568.  
  1569.                (B) Invoke the compiler from the command line by issuing
  1570.                    the following command. Notice the syntax is spread out
  1571.                    over two lines. This is for display purposes only and
  1572.                    when this line is typed in at the DOS level it all
  1573.                    should be on one line. (There should be a space at
  1574.                    the end of the first line). Notice the following options:
  1575.  
  1576.  
  1577.  
  1578.         MC-WINDOW                                                           22
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.                                      USING THE WINDOWS AND QWIK WRITE ROUTINES
  1587.     __________________________________________________________________________
  1588.  
  1589.                       -Ixxx - include directory
  1590.                       -ixxx - maximum variable length
  1591.                       -w    - enable all warnings and invoke type checking
  1592.                       -ms   - small model
  1593.                       -Lxxx - library subdirectory for TURBO-C libraries
  1594.  
  1595.                       The last line at the end is our window library, and
  1596.                       you must prefix it with a path or the TURBO linker
  1597.                       will not be able to find it.
  1598.  
  1599.                    tcc -Ic:\turboc\include\ -i35 -w -ms -Lc:\turboc\lib\
  1600.                         sample.c c:\turboc\lib\t1swin20.lib
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.         MC-WINDOW                                                           23
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.     CHAPTER 3
  1653.     __________________________________________________________________________
  1654.  
  1655.  
  1656.  
  1657.      1.3 RUN-TIME ROUTINES BY CATEGORY
  1658.  
  1659.        1.3.1   Introduction................................................25
  1660.        1.3.2   Screen Filling..............................................25
  1661.        1.3.3   Screen Initialization.......................................25
  1662.        1.3.4   Screen I/O..................................................26
  1663.        1.3.5   Screen Manipulation.........................................26
  1664.        1.3.6   Screen Storing and Restoring................................26
  1665.        1.3.7   Screen Paging...............................................26
  1666.        1.3.8   Screen Writing..............................................27
  1667.        1.3.9   Windowing...................................................27
  1668.        1.3.10  Menuing.....................................................28
  1669.        1.3.11  Miscellaneous...............................................28
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.         MC-WINDOW                                                           24
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.                                                  RUN-TIME ROUTINES BY CATEGORY
  1719.     __________________________________________________________________________
  1720.  
  1721.  
  1722.  
  1723.      1.3.1 Introduction
  1724.  
  1725.  
  1726.      This chapter describes the major categories of routines included in
  1727.      the xxxwin20.lib run-time libraries. The discussions of these
  1728.      categories are intended to give a brief overview of the capabilities
  1729.      of the run-time library. For a complete description of the syntax and
  1730.      use of each routine, see Part 2, "Reference."
  1731.  
  1732.  
  1733.      1.3.2 Screen Filling
  1734.  
  1735.  
  1736.      Routine              Use
  1737.      ___________________________________________________________________________
  1738.      qattr                Fills a region of the screen starting at a certain
  1739.                           position with a color attribute. Original text is
  1740.                           left unchanged.
  1741.  
  1742.      qattrc               Fills a region of the screen starting at a certain
  1743.                           position with a color attribute while centering
  1744.                           between two specific column positions. Original text
  1745.                           is left unchanged.
  1746.  
  1747.      qfill                Fills a region of the screen starting at a certain
  1748.                           position with a color attribute and a specific
  1749.                           character.
  1750.  
  1751.      qfillc               Fills a region of the screen starting at a certain
  1752.                           position with a color attribute and a specific
  1753.                           character while centering between two specific
  1754.                           column positions.
  1755.  
  1756.  
  1757.      1.3.3 Screen Initialization
  1758.  
  1759.  
  1760.      Routine              Use
  1761.      ___________________________________________________________________________
  1762.      initwindow           Initializes the window structures, sets the
  1763.                           screen address and clears the initial screen
  1764.                           if so desired. This routine calls qinit(), and
  1765.                           should only be called once at the beginning of
  1766.                           a program if any of the window routines are
  1767.                           called. (See Section 1.3.9)
  1768.  
  1769.      qinit                Initializes the screen address, sets the number
  1770.                           of video pages, and determines if we need to wait
  1771.                           for retrace. This routine should only be called if
  1772.                           the Qwik Write Utilities are used alone without
  1773.                           the window routines, otherwise call initwindow().
  1774.  
  1775.  
  1776.         MC-WINDOW                                                           25
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.     RUN-TIME ROUTINES BY CATEGORY
  1785.     __________________________________________________________________________
  1786.  
  1787.  
  1788.  
  1789.      1.3.4 Screen I/O
  1790.  
  1791.  
  1792.      Routine              Use
  1793.      ___________________________________________________________________________
  1794.      get_integer          Gets an integer value from the console at a
  1795.                           specific position with various validation
  1796.                           capabilities.
  1797.  
  1798.      get_string           Gets a string value from the console at a
  1799.                           specific position with various validation
  1800.                           capabilities.
  1801.  
  1802.  
  1803.      1.3.5 Screen Manipulation
  1804.  
  1805.  
  1806.      Routine              Use
  1807.      ___________________________________________________________________________
  1808.      cursorchange         Changes the cursor shape of the cursor on the
  1809.                           current video page.
  1810.  
  1811.      gotorc               Position the cursor at a specific row and column
  1812.                           on the current video page.
  1813.  
  1814.      where_col            Get the value of the present column position
  1815.                           on the current video page.
  1816.  
  1817.      where_row            Get the value of the present row position
  1818.                           on the current video page.
  1819.  
  1820.  
  1821.      1.3.6 Screen Storing and Restoring
  1822.  
  1823.  
  1824.      Routine              Use
  1825.      ___________________________________________________________________________
  1826.      qrestore             Restore a region of the screen from a character
  1827.                           array or character pointer that holds the
  1828.                           character and attribute byte pairs for each
  1829.                           position.
  1830.  
  1831.      qstore               Store a region of the screen into a character
  1832.                           array or a character pointer that was allocated.
  1833.                           Both character and attribute byte for each
  1834.                           position will be stored.
  1835.  
  1836.  
  1837.      1.3.7 Screen Paging
  1838.  
  1839.  
  1840.  
  1841.  
  1842.         MC-WINDOW                                                           26
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.                                                  RUN-TIME ROUTINES BY CATEGORY
  1851.     __________________________________________________________________________
  1852.  
  1853.      Routine              Use
  1854.      ___________________________________________________________________________
  1855.      qpage                Changes the current video page to a new page
  1856.                           and makes that page active. In order for the
  1857.                           Qwik Write Utilities to recognize this as the
  1858.                           new page qwritepage() must be called.
  1859.  
  1860.      qwritepage           Changes the current Qwik Write Utility page to
  1861.                           a new page and makes it active.
  1862.  
  1863.  
  1864.      1.3.8 Screen Writing
  1865.  
  1866.  
  1867.      Routine              Use
  1868.      ___________________________________________________________________________
  1869.      qwrite               Writes a null terminated string to the screen at
  1870.                           a specific position with an attribute.
  1871.  
  1872.      qwritec              Writes a null terminated string to the screen at
  1873.                           a specific position, centered between two columns,
  1874.                           with an attribute.
  1875.  
  1876.      qwritef              Writes a string to the screen at a specific position
  1877.                           with an attribute in printf() like style format.
  1878.                           Any valid printf() format is available. Wrapping
  1879.                           takes place at end of lines, only if the \n option
  1880.                           is used. No scrolling takes place at the end of the
  1881.                           screen. Other special characters \b, \r, \t are
  1882.                           also supported.
  1883.  
  1884.      qwritelv             Writes a string of a specific length to the screen
  1885.                           at a specific position with an attribute.
  1886.  
  1887.      vwrite               Writes a null terminated string to the screen
  1888.                           vertically at a specific position with an
  1889.                           attribute. No wrapping takes place at end of
  1890.                           the current screen.
  1891.  
  1892.  
  1893.      1.3.9 Windowing
  1894.  
  1895.  
  1896.      Routine              Use
  1897.      ___________________________________________________________________________
  1898.      makewindow           Creates a window on the screen at a specific
  1899.                           position. Various types of borders are allowed
  1900.                           along with attributes for window and border
  1901.                           colors. Optional global variables can be set
  1902.                           to explode the box and set shadow effects.
  1903.                           (See section 1.2.3)
  1904.  
  1905.      remove_all_windows   Removes all of the windows that are on the screen,
  1906.  
  1907.  
  1908.         MC-WINDOW                                                           27
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.     RUN-TIME ROUTINES BY CATEGORY
  1917.     __________________________________________________________________________
  1918.  
  1919.                           restoring the screen under each one.
  1920.  
  1921.      remove_windows       Removes a specific number of windows from the
  1922.                           screen. The screen contents under these windows
  1923.                           are restored.
  1924.  
  1925.      removewindow         Removes the last created window from the screen.
  1926.                           The screen contents under this window are restored.
  1927.  
  1928.      scrollwindow         Scrolls a window a specific number of lines in
  1929.                           an upward or downward direction.
  1930.  
  1931.      titlewindow          Place a title on a window border with a specific
  1932.                           justification and attribute.
  1933.  
  1934.      window_bios_scroll   Scrolls a region of the screen upward using BIOS
  1935.                           services. The scrolled region is replaced with
  1936.                           a blank line that has a specific attribute.
  1937.  
  1938.      window_printf        Writes a string to the current window with an
  1939.                           attribute in printf() like format. All printf()
  1940.                           formats are supported as well as the special
  1941.                           characters \n, \b, \r, \t.
  1942.  
  1943.      window_write         Writes a null terminated string to the current
  1944.                           window using successive calls to qwrite().
  1945.  
  1946.  
  1947.      1.3.10 Menuing
  1948.  
  1949.  
  1950.      Routine              Use
  1951.      ___________________________________________________________________________
  1952.      get_menu             Places a menu on the screen by drawing a
  1953.                           box (optional) around the users choices. The menu
  1954.                           may be vertical or horizontal, have attributes, and
  1955.                           even invoke other functions if a special
  1956.                           terminating key sequence is hit. The vertical
  1957.                           menu supports multiple pages, while the horizontal
  1958.                           menu supports 144 choices. The parameter list is
  1959.                           quite lengthy for this function, so to make sure
  1960.                           you have the proper types, try to invoke type-
  1961.                           checking during your compile.
  1962.  
  1963.  
  1964.      1.3.11 Miscellaneous
  1965.  
  1966.  
  1967.      Routine              Use
  1968.      ___________________________________________________________________________
  1969.  
  1970.      delete              Remove the specified number of characters
  1971.                          starting at a specified position from a string.
  1972.  
  1973.  
  1974.         MC-WINDOW                                                           28
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.                                                  RUN-TIME ROUTINES BY CATEGORY
  1983.     __________________________________________________________________________
  1984.  
  1985.                          The resulting string is the string minus the
  1986.                          deleted characters.
  1987.  
  1988.      egacheck            Check to see if an EGA card is present in the
  1989.                          system.
  1990.  
  1991.      getkey              Get a keystroke from the keyboard returning the
  1992.                          character and scan code. CTRL-C is locked out.
  1993.  
  1994.      get_video_mode      Gets the current video mode for display purposes.
  1995.  
  1996.      insert              Inserts a single character at the specified
  1997.                          position in a string.
  1998.  
  1999.      qbox                Draw a box around a region with optional borders.
  2000.                          The inside of the box is cleared to a specific
  2001.                          attribute.
  2002.  
  2003.      wiattr              Determine the attribute byte given a foreground
  2004.                          and background masking off background color high
  2005.                          bits.
  2006.  
  2007.      wsleep              Suspend processing for a specified number of timer
  2008.                          ticks.
  2009.  
  2010.      wsound              Make a sound at a specified frequency for a
  2011.                          specific number of timer ticks.
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.         MC-WINDOW                                                           29
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.     CHAPTER 4
  2049.     __________________________________________________________________________
  2050.  
  2051.  
  2052.  
  2053.      1.4 COMPILING THE SOURCE CODE AND BUILDING LIBRARIES
  2054.  
  2055.        1.4.1  Introduction.................................................31
  2056.        1.4.2  Obtaining the Latest Source Code and Libraries...............31
  2057.        1.4.3  Microsoft 5.0 Compiler.......................................31
  2058.        1.4.4  Microsoft Quick-C 1.0 Compiler...............................32
  2059.        1.4.5  Microsoft 4.0 Compiler.......................................33
  2060.        1.4.6  Turboc-C  1.0 Compiler.......................................33
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.         MC-WINDOW                                                           30
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.                               COMPILING THE SOURCE CODE AND BUILDING LIBRARIES
  2115.     __________________________________________________________________________
  2116.  
  2117.  
  2118.  
  2119.  
  2120.      1.4.1 Introduction
  2121.  
  2122.  
  2123.      This chapter explains how to compile the source code and build it
  2124.      into a library. This is necessary if the user wishes to add or modify
  2125.      an existing function. The steps that are necessary for each compiler
  2126.      are explained in detail. It also tells how to obtain the latest source
  2127.      code and the pricing scheme for each item.
  2128.  
  2129.  
  2130.      1.4.2 Obtaining the Latest Source Code and Libraries
  2131.  
  2132.  
  2133.      The latest source code and libraries for each compiler are available
  2134.      immediately. Simply fill out the ORDER FORM at the back of this manual
  2135.      and you will be shipped the latest source code or libraries: The current
  2136.      prices are as follows:
  2137.  
  2138.         Registered user:      $55.00, Entitles you complete source code for
  2139.                               a specific compiler, with pre-compiled ready
  2140.                               to run libraries for all memory models and a
  2141.                               printed bound manual.
  2142.  
  2143.         Novice registration:  $35.00, Entitles you to pre-compiled ready
  2144.                               to run libraries for all memory models of a
  2145.                               specific compiler, and a printed bound manual.
  2146.  
  2147.         Other:                Source code alone             - $25.00
  2148.  
  2149.                               Any compiler supported,
  2150.                               Specific memory model library - $10.00
  2151.  
  2152.                               Printed bound manual          - $10.00
  2153.  
  2154.         Updates:              All registered users will be entitled to updates
  2155.                               for minimal charges. All other users will be
  2156.                               charged an update fee plus the cost of the item
  2157.                               desired.
  2158.  
  2159.  
  2160.      1.4.3 Microsoft 5.0 Compiler
  2161.  
  2162.  
  2163.      The following are needed to compile the MSC 5.0 version of these
  2164.      utilities:
  2165.  
  2166.         - MASM 4.0 or MASM 5.0
  2167.         - Microsoft MAKE utility
  2168.         - Microsoft LIB utility
  2169.         - Microsoft 5.0 C compiler
  2170.  
  2171.  
  2172.         MC-WINDOW                                                           31
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.     COMPILING THE SOURCE CODE AND BUILDING LIBRARIES
  2181.     __________________________________________________________________________
  2182.  
  2183.         - Touch Utility
  2184.  
  2185.      Process
  2186.  
  2187.         - You must be pathed to the MASM 4.0 or MASM 5.0 assembler
  2188.         - You must be pathed to the LIB, MAKE, & 5.0 compiler
  2189.         - You must have your environment variables set for the compiler
  2190.         - Copy all the C (.C) files from the distribution disk to your
  2191.           source directory
  2192.         - Copy all the header (.H) files from the distribution disk to your
  2193.           include directory
  2194.         - Copy all of the (.EXE) & (.MK) files from the distribution disk
  2195.           to your source directory.
  2196.         - Edit the (.MK) files to make sure your include directory is
  2197.           correct.  Look for the line that says INCLUDE = xxxxxx, and
  2198.           change it to what ever your include directory is.
  2199.      (A)- Run the COMPILE.EXE program choosing the compiler and memory
  2200.           model you want to use. Only one model can be compiled at a
  2201.           time.
  2202.         - Library will exist in the source directory. (See section
  2203.           1.2.2 for the actual library naming conventions).
  2204.         - To build another, touch the .C files or delete all
  2205.           of the m5xwin20.lib (.objs), then go to step (A). A list of the
  2206.           (.C) & (.ASM) files appears in appendix A.
  2207.  
  2208.  
  2209.      1.4.4 Microsoft Quick-C 1.0 Compiler
  2210.  
  2211.  
  2212.      The following are needed to compile the Quick-C 1.0 version of these
  2213.      utilities:
  2214.  
  2215.         - MASM 4.0 or MASM 5.0
  2216.         - Microsoft MAKE utility
  2217.         - Microsoft LIB utility
  2218.         - Microsoft Quick-C 1.0 compiler
  2219.         - Touch utility
  2220.  
  2221.      Process
  2222.  
  2223.         - You must be pathed to the MASM 4.0 or MASM 5.0 assembler
  2224.         - You must be pathed to the LIB, MAKE, & Quick-C compiler
  2225.         - You must have your environment variables set for the compiler
  2226.         - Copy all the C (.C) files from the distribution disk to your
  2227.           source directory
  2228.         - Copy all the header (.H) files from the distribution disk to your
  2229.           include directory
  2230.         - Copy all the (.EXE) & (.MK) files from the distribution disk
  2231.           to your source directory
  2232.         - Edit the (.MK) files to make sure your include directory is
  2233.           correct. Look for the line that says INCLUDE = xxxxxx, and
  2234.           change it to whatever your include directory is.
  2235.      (A)- Run the COMPILE.EXE program, choosing the compiler and memory
  2236.  
  2237.  
  2238.         MC-WINDOW                                                           32
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.                               COMPILING THE SOURCE CODE AND BUILDING LIBRARIES
  2247.     __________________________________________________________________________
  2248.  
  2249.           model you want to use. Only one model can be compiled at a time.
  2250.         - Library will exist in the source directory. (See section
  2251.           1.2.2 for the actual library naming conventions).
  2252.         - To build another, touch the .C files or delete all
  2253.           of the q1xwin20.lib (.objs), then go to step (A). A list of the
  2254.           .C files appears in appendix A.
  2255.  
  2256.  
  2257.      1.4.5 Microsoft 4.0 Compiler
  2258.  
  2259.  
  2260.      The following are needed to compile the MSC 4.0 version of these
  2261.      utilities:
  2262.  
  2263.         - MASM 4.0 or MASM 5.0
  2264.         - Microsoft MAKE utility
  2265.         - Microsoft LIB utility
  2266.         - Microsoft 4.0 C compiler
  2267.         - Touch Utility
  2268.  
  2269.      Process
  2270.  
  2271.         - You must be pathed to the MASM 4.0 or MASM 5.0 assembler
  2272.         - You must be pathed to the LIB, MAKE, & 4.0 compiler
  2273.         - You must have your environment variables set for the compiler
  2274.         - Copy all the C (.C) files from the distribution disk to your
  2275.           source directory
  2276.         - Copy all the header (.H) files from the distribution disk to your
  2277.           include directory
  2278.         - Copy all of the (.EXE) & (.MK) files from the distribution disk
  2279.           to your source directory.
  2280.         - Edit the (.MK) files to make sure your include directory is
  2281.           correct.  Look for the line that says INCLUDE = xxxxxx, and
  2282.           change it to what ever your include directory is.
  2283.      (A)- Run the COMPILE.EXE program choosing the compiler and memory
  2284.           model you want to use. Only one model can be compiled at a
  2285.           time.
  2286.         - Library will exist in the source directory. (See section
  2287.           1.2.2 for the actual library naming conventions).
  2288.         - To build another, touch the .C files or delete all
  2289.           of the m4xwin20.lib (.objs), the go to step (A). A list of the
  2290.           (.C) & (.ASM) files appears in appendix A.
  2291.  
  2292.  
  2293.      1.4.6 Turbo-C 1.0 Compiler
  2294.  
  2295.  
  2296.      The following are needed to compile the Turbo-C 1.0 version of these
  2297.      utilities:
  2298.  
  2299.         - MASM 4.0 or MASM 5.0
  2300.         - Microsoft MAKE utility
  2301.         - Microsoft LIB utility
  2302.  
  2303.  
  2304.         MC-WINDOW                                                           33
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.     COMPILING THE SOURCE CODE AND BUILDING LIBRARIES
  2313.     __________________________________________________________________________
  2314.  
  2315.         - Turbo-C 1.0 C compiler
  2316.         - Touch Utility
  2317.  
  2318.      NOTE: Some users may wish to edit the t1win20.mk file so that it
  2319.            works with the Turbo-C MAKE Utility.
  2320.  
  2321.      Process
  2322.  
  2323.         - You must be pathed to the MASM 4.0 or MASM 5.0 assembler
  2324.         - You must be pathed to the LIB, MAKE, & Turbo-C (TCC.EXE) compiler
  2325.         - Copy all the C (.C) files from the distribution disk to your
  2326.           source directory
  2327.         - Copy all the header (.H) files from the distribution disk to your
  2328.           include directory
  2329.         - Copy all of the (.EXE) & (.MK) files from the distribution disk
  2330.           to your source directory.
  2331.         - Edit the (.MK) files to make sure your include directory is
  2332.           correct.  Look for the line that says INCLUDE = xxxxxx, and
  2333.           change it to what ever your include directory is.
  2334.      (A)- Run the COMPILE.EXE program choosing the compiler and memory
  2335.           model you want to use. Only one model can be compiled at a
  2336.           time.
  2337.         - Library will exist in the source directory. (See section
  2338.           1.2.2 for the actual library naming conventions).
  2339.         - To build another, touch the .C files or delete all
  2340.           of the t1xwin20.lib (.objs), the go to step (A). A list of the
  2341.           (.C) & (.ASM) files appears in appendix A.
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.         MC-WINDOW                                                           34
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.                                                                   CURSORCHANGE
  2379.     __________________________________________________________________________
  2380.  
  2381.  
  2382.      ⁿ NAME           cursorchange - change size of cursor (qcursor.asm)
  2383.  
  2384.      ⁿ USAGE          int cursorchange(new_type);
  2385.                       int new_type - new value for cursor
  2386.  
  2387.  
  2388.      ⁿ PROTOTYPE IN   #include <w1.h>
  2389.                       #include <windprot.h>
  2390.  
  2391.      ⁿ DESCRIPTION    The cursorchange function changes the physical shape
  2392.                       of the cursor, while returning the original shape.
  2393.  
  2394.                       Works only on the current video page.
  2395.  
  2396.                        SHAPE: Monochrome - top row = 0; bottom row = 13;
  2397.                                            (DEFAULT is 12,13)
  2398.                               CGA        - top row = 0; bottom row = 7;
  2399.                                            (DEFAULT is 6,7)
  2400.                        INVISIBILITY:     - set top row = 32 (bits 5,6,7 = 01)
  2401.                                          - setting top row > bottom also works
  2402.                        BLINKING:         - set top row + 96 (bits 5,6 = 11)
  2403.                                          - also try top row << 8 + bottom
  2404.                        OTHER:            - block cursor, set new_type = 13
  2405.                                          - invisible, set new_type = 8192
  2406.  
  2407.      ⁿ RETURN VALUE   (int) - Old cursor shape
  2408.  
  2409.      ⁿ SEE ALSO
  2410.  
  2411.      ⁿ EXAMPLE
  2412.  
  2413.        #define USE_LOCAL         /* used for resolving externals */
  2414.  
  2415.        #include <w1.h>
  2416.        #include <windprot.h>     /* prototype for cursorchange  */
  2417.  
  2418.        #define INVISIBLE 8192    /* invisible cursor constant   */
  2419.  
  2420.        int old_cursor;           /* saved cursor value          */
  2421.        void main(void);
  2422.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  2423.  
  2424.           old_cursor = cursorchange(INVISIBLE);   /* save old cursor and set  */
  2425.                  :                                /* it to an invisible state */
  2426.                  :
  2427.           cursorchange(old_cursor);               /* restore to original      */
  2428.  
  2429.        }
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.         MC-WINDOW                                                           35
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.     DELETE
  2445.     __________________________________________________________________________
  2446.  
  2447.  
  2448.      ⁿ NAME           delete - delete characters from a string
  2449.                                (getstr.c)
  2450.  
  2451.      ⁿ USAGE          void delete(str,pos,howmany);
  2452.                       char *str   - string to be altered
  2453.                       int pos     - position in string where deletion is to
  2454.                                     occur
  2455.                       int howmany - number of characters to delete
  2456.  
  2457.      ⁿ PROTOTYPE IN   #include <w1.h>
  2458.                       #include <windprot.h>
  2459.  
  2460.      ⁿ DESCRIPTION    The delete function removes the specified number
  2461.                       of characters starting at the specified position.
  2462.                       The resulting string is the original string minus
  2463.                       the deleted characters. Position starts at 0 and
  2464.                       goes to length of the string.
  2465.  
  2466.      ⁿ RETURN VALUE   None
  2467.  
  2468.      ⁿ SEE ALSO       insert
  2469.  
  2470.      ⁿ EXAMPLE
  2471.  
  2472.        #define USE_LOCAL         /* used for resolving externals */
  2473.  
  2474.        #include <stdio.h>        /* for printf function */
  2475.        #include <w1.h>
  2476.        #include <windprot.h>     /* prototype for delete */
  2477.  
  2478.        void main(void);
  2479.  
  2480.        char *test= "this is not a normal string";
  2481.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  2482.           delete(test,8,4);      /* make string normal           */
  2483.           printf("new string is %s\n",test);
  2484.        }
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.         MC-WINDOW                                                           36
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.                                                                       EGACHECK
  2511.     __________________________________________________________________________
  2512.  
  2513.  
  2514.      ⁿ NAME           egacheck - check for EGA monitor (qpage.asm)
  2515.  
  2516.      ⁿ USAGE          int egacheck(void);
  2517.  
  2518.  
  2519.      ⁿ PROTOTYPE IN   #include <w1.h>
  2520.                       #include <windprot.h>
  2521.  
  2522.      ⁿ DESCRIPTION    The egacheck function checks for the presence
  2523.                       of an EGA card. Used by qinit() to set number
  2524.                       of active video pages for EGA.
  2525.  
  2526.      ⁿ RETURN VALUE   (int) 0 - EGA card is not present
  2527.                       (int) 1 - EGA card is present
  2528.  
  2529.      ⁿ SEE ALSO
  2530.  
  2531.      ⁿ EXAMPLE
  2532.  
  2533.        #define USE_LOCAL         /* used for resolving externals */
  2534.  
  2535.        #include <stdio.h>        /* for printf function */
  2536.        #include <w1.h>
  2537.        #include <windprot.h>     /* prototype for egacheck */
  2538.  
  2539.        void main(void);
  2540.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  2541.           if (egacheck())
  2542.              printf("EGA Monitor is present\n");
  2543.           else
  2544.              printf("EGA Monitor is not present\n");
  2545.  
  2546.        }
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.         MC-WINDOW                                                           37
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.     GET_INTEGER
  2577.     __________________________________________________________________________
  2578.  
  2579.  
  2580.      ⁿ NAME           get_integer - get an integer (getint.c)
  2581.  
  2582.      ⁿ USAGE          int get_integer(def, row, col, attr, min,
  2583.                                       max, prompt, tstr, &tchar);
  2584.                       int   def      - default integer
  2585.                       int   row, col - position coordinates
  2586.                       int   attr     - color attribute
  2587.                       int   min      - minimum integer value
  2588.                       int   max      - maximum integer value
  2589.                       char *prompt   - string to prompt for integer with
  2590.                       char *tstr     - characters that will terminate
  2591.                                        get_integer()
  2592.                       int  *tchar    - character that terminated get_integer()
  2593.  
  2594.      ⁿ PROTOTYPE IN   #include <w1.h>
  2595.                       #include <windprot.h>
  2596.  
  2597.      ⁿ DESCRIPTION    Get an integer from the console with various
  2598.                       validation capabilties. Input is handle the same way
  2599.                       that a calculator handles it, pushing the numbers
  2600.                       to the left.
  2601.  
  2602.                       The maximum value that get_integer() can handle is
  2603.                       32767
  2604.  
  2605.      ⁿ RETURN VALUE   Integer entered at console or default if abnormal
  2606.                       termination.
  2607.  
  2608.      ⁿ SEE ALSO       get_string
  2609.  
  2610.      ⁿ EXAMPLE
  2611.  
  2612.        #include <w1.h>
  2613.        #include <windprot.h>     /* prototype for get_integer    */
  2614.  
  2615.        void main(void);
  2616.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  2617.           char  term_string[2];  /* terminating string           */
  2618.           int   term_char,       /* char that terminated         */
  2619.                 my_integer;      /* integer to get               */
  2620.  
  2621.           my_integer  = 123;     /* set default value            */
  2622.           sprintf(term_string, "%c", 59);  /* F1 will terminate  */
  2623.           /* get an integer with a white on red attribute (79)   */
  2624.           my_integer = get_integer(my_integer, 5, 5, 79, 0, 900,
  2625.                                    "Enter a value between 0 and 900 : ",
  2626.                                    term_string, &term_char);
  2627.                   :
  2628.                   :
  2629.           printf("my integer = %d\n", my_integer);
  2630.        }
  2631.  
  2632.  
  2633.  
  2634.         MC-WINDOW                                                           38
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.                                                                       GET_MENU
  2643.     __________________________________________________________________________
  2644.  
  2645.  
  2646.      ⁿ NAME           get_menu - display a vertical or horizontal menu
  2647.                                    (gmenu.c)
  2648.  
  2649.      ⁿ USAGE          int get_menu(row, col, rows, cols, attr, inv_attr,
  2650.                                         brd_attr, items, tstr, spacing,
  2651.                                         vertical, bord_type, title_pos,
  2652.                                         &last_item, clear_win, special);
  2653.                       int   row, col         - window coordinates
  2654.                       int   rows, cols       - height and width of window
  2655.                       int   attr             - color attribute
  2656.                       int   inv_attr         - inverse screen attribute for
  2657.                                                 highlighting
  2658.                       int   brd_attr         - color attribute for the window
  2659.                                                 border
  2660.                       char *items[]          - array of item names to be
  2661.                                                 displayed and/or selected.
  2662.                                                 The last item in the array
  2663.                                                 will appear at the bottom
  2664.                                                 of the window, the second to
  2665.                                                 the last will be the title
  2666.                                                 line of the window(top).
  2667.                                                 If either of these two is
  2668.                                                 not wanted just set that
  2669.                                                 item to ONE character.
  2670.                       char *tstr             - characters that will call a
  2671.                                                 function from within get_menu()
  2672.                       int   spacing          - number of spaces between items
  2673.                       int   vertical         - boolean for forcing into one
  2674.                                                 column or not
  2675.                       enum BORDERS bord_type - border type if any for drawing
  2676.                                                 window
  2677.                       enum DIRTYPE title_pos - positioning of the window title
  2678.                       int  *last_item        - the array omdex of the item
  2679.                                                 highlighted when ENTER was hit
  2680.                       int   clear_win        - boolean for removing window on
  2681.                                                 exit or not
  2682.                       int (*)() special      - function to be called when a
  2683.                                                 character in tstr is
  2684.                                                 encountered. This function
  2685.                                                 should be declared as follows:
  2686.                                                     int special(int, int *);
  2687.                                                 where:
  2688.                                                     the first int is the char
  2689.                                                      int tstr that caused
  2690.                                                      special() to be called.
  2691.                                                     the second int * is the
  2692.                                                      done boolean that
  2693.                                                      indicates whether to
  2694.                                                      continue in get_menu or
  2695.                                                      terminate.
  2696.                                                 special() should return the
  2697.                                                 value that the program calling
  2698.  
  2699.  
  2700.         MC-WINDOW                                                           39
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.     GET_MENU
  2709.     __________________________________________________________________________
  2710.  
  2711.                                                 get_menu() expects.
  2712.      ⁿ PROTOTYPE IN   #include <w1.h>
  2713.                       #include <windprot.h>
  2714.  
  2715.      ⁿ DESCRIPTION    Displays items to the screen in vertical or
  2716.                       horizontal fashion allowing cursor movement to
  2717.                       item. The window depth is dynamically built based
  2718.                       on the number of items and number of columns to
  2719.                       be displayed.
  2720.  
  2721.                       The function special() must be declared in the
  2722.                       calling program.
  2723.  
  2724.                       The items array MUST have a NULL string as the
  2725.                       very last char * in the array
  2726.  
  2727.                       Last_item MUST be initialized to a valid array
  2728.                       index before the call to get_menu().
  2729.  
  2730.      ⁿ RETURN VALUE   The ascii value of the character that terminated
  2731.                       get_menu().
  2732.  
  2733.      ⁿ SEE ALSO
  2734.  
  2735.      ⁿ EXAMPLE
  2736.  
  2737.        #define TRUE      1
  2738.        #include <w1.h>
  2739.        #include <windprot.h>     /* prototype for get_menu       */
  2740.  
  2741.        static char *display[6] = { "test1", "test2", "test3",
  2742.                                    "title", "bottom", ""};
  2743.        void main(void);
  2744.        int  my_function(int, int *);
  2745.  
  2746.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  2747.           char  term_string[2];  /* terminating string           */
  2748.           int   term_char;       /* terminating character        */
  2749.           int   norm_attr, inv_attr, brdr_attr;   /* menu colors */
  2750.  
  2751.           sprintf(term_string, "%c", 59);  /* F1 will terminate  */
  2752.           term_char = get_menu(5, 5, 15, 50, norm_attr, inv_attr, brdr_attr,
  2753.                                display, term_string, 2, TRUE, doublebrdr,
  2754.                                topcenter, &disp_index, TRUE, my_function);
  2755.                   :
  2756.                   :
  2757.        }
  2758.  
  2759.        int my_function(int chr, int *end_get_menu) {
  2760.          if (chr == 59)     /* F1 key was hit , so termninate */
  2761.            *end_get_menu = TRUE;
  2762.          else
  2763.            *end_get_menu = FALSE;
  2764.  
  2765.  
  2766.         MC-WINDOW                                                           40
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.                                                                       GET_MENU
  2775.     __________________________________________________________________________
  2776.  
  2777.        }  /* my_function() */
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.         MC-WINDOW                                                           41
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.     GET_STRING
  2841.     __________________________________________________________________________
  2842.  
  2843.  
  2844.      ⁿ NAME           get_string - get a string (getstr.c)
  2845.  
  2846.      ⁿ USAGE          char *get_string(def, row, col, attr, maxlen,
  2847.                                         upcase, legal_set, display,
  2848.                                         tstr, padchar, &tchar);
  2849.                       char *def       - default string
  2850.                       int   row, col  - position coordinates
  2851.                       int   attr      - color attribute
  2852.                       int   maxlen    - maximum string length
  2853.                       int   upcase    - force uppercase conversion boolean
  2854.                       int   legal_set - indicates valid characters
  2855.                       int   display   - show string or asterisks boolean
  2856.                       char *tstr      - characters that will terminate
  2857.                                          get_string()
  2858.                       char  padchar   - character to pad string with.
  2859.                                          (usually underscore or space)
  2860.                       int  *tchar     - character that terminated get_string()
  2861.  
  2862.      ⁿ PROTOTYPE IN   #include <w1.h>
  2863.                       #include <windprot.h>
  2864.  
  2865.      ⁿ DESCRIPTION    Get a string from the console with various
  2866.                       validation capabilties.
  2867.  
  2868.                       The default must have space allocated for it and be
  2869.                       initialized before the call to get_string()
  2870.  
  2871.      ⁿ RETURN VALUE   String entered at console or default if abnormal
  2872.                       termination.
  2873.  
  2874.      ⁿ SEE ALSO       get_integer
  2875.  
  2876.      ⁿ EXAMPLE
  2877.  
  2878.        #include <w1.h>
  2879.        #include <windprot.h>     /* prototype for get_string           */
  2880.  
  2881.        #define ALPHA_NUMERIC  3  /* allows a-z,A-Z, 0-9, & punctuation */
  2882.        #define MAX_LEN        79 /* max length for the string          */
  2883.  
  2884.        void main(void);
  2885.        void main (void) {        /* MSC 5.0 and Turbo-C specific       */
  2886.           char  term_string[2];  /* terminating string                 */
  2887.           int   term_char,       /* char that terminated               */
  2888.                 my_string;       /* string to get                      */
  2889.  
  2890.           /* allocate space and initialize my_string */
  2891.           my_string = (char *)calloc(1, (80 * sizeof(char)));
  2892.  
  2893.           sprintf(term_string, "%c", 59);  /* F1 will terminate        */
  2894.  
  2895.           /* get a string with a yellow on blue attribute (30)         */
  2896.  
  2897.  
  2898.         MC-WINDOW                                                           42
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.                                                                     GET_STRING
  2907.     __________________________________________________________________________
  2908.  
  2909.           my_string = get_string(my_string, 5, 5, 30, MAX_LEN, TRUE,
  2910.                                    ALPHA_NUMERIC, TRUE, term_string,
  2911.                                    (char)'_', &term_char);
  2912.                   :
  2913.                   :
  2914.           printf("my string = %s\n", my_string);
  2915.           free(my_string);
  2916.        }
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.         MC-WINDOW                                                           43
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.     GET_VIDEO_MODE
  2973.     __________________________________________________________________________
  2974.  
  2975.  
  2976.      ⁿ NAME           get_video_mode - get the current video mode for
  2977.                                        display purposes (wind20.c)
  2978.  
  2979.      ⁿ USAGE          int get_video_mode(void);
  2980.  
  2981.      ⁿ PROTOTYPE IN   #include <w1.h>
  2982.                       #include <windprot.h>
  2983.  
  2984.      ⁿ DESCRIPTION    The get_video_mode function gets the current
  2985.                       video mode for the display.
  2986.  
  2987.      ⁿ RETURN VALUE   (int) display mode
  2988.  
  2989.                       0 - 40x25 black & white text, color adapter
  2990.                       1 - 40x25 color text
  2991.                       2 - 80x25 black & white text
  2992.                       3 - 80x25 color text
  2993.                       7 - Monochrome adapter text display
  2994.      ⁿ SEE ALSO
  2995.  
  2996.      ⁿ EXAMPLE
  2997.  
  2998.        #define USE_LOCAL         /* used for resolving externals */
  2999.  
  3000.        #include <stdio.h>        /* for printf function */
  3001.        #include <w1.h>
  3002.        #include <windprot.h>     /* prototype for get_video_mode */
  3003.  
  3004.        void main(void);
  3005.  
  3006.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  3007.           int mode;
  3008.  
  3009.           mode = get_video_mode();  /* get_video mode            */
  3010.           printf("mode =  %d\n",mode);
  3011.        }
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.         MC-WINDOW                                                           44
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.                                                                         GETKEY
  3039.     __________________________________________________________________________
  3040.  
  3041.  
  3042.      ⁿ NAME           getkey - get a character and its scan code
  3043.                                from the keyboard. (getstr.c)
  3044.  
  3045.      ⁿ USAGE          int getkey(scancode);
  3046.                       int *scancode - scan code of the key pressed.
  3047.  
  3048.      ⁿ PROTOTYPE IN   #include <w1.h>
  3049.                       #include <windprot.h>
  3050.  
  3051.      ⁿ DESCRIPTION    The getkey function gets a keystroke from the
  3052.                       keyboard. The ascii character is returned as an
  3053.                       integer,as well as the scan code of the key.
  3054.  
  3055.      ⁿ RETURN VALUE   (int) character that was typed
  3056.  
  3057.      ⁿ SEE ALSO
  3058.  
  3059.      ⁿ EXAMPLE
  3060.  
  3061.        #define USE_LOCAL         /* used for resolving externals */
  3062.  
  3063.        #include <stdio.h>        /* for printf function */
  3064.        #include <w1.h>
  3065.        #include <windprot.h>     /* prototype for getkey */
  3066.  
  3067.        void main(void);
  3068.  
  3069.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  3070.           int scancode,key;
  3071.  
  3072.           key = getkey(&scancode);  /* get a key            */
  3073.           printf("key as int is %d, scancode is %d\n",key,scancode);
  3074.        }
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.         MC-WINDOW                                                           45
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.     GOTORC
  3105.     __________________________________________________________________________
  3106.  
  3107.  
  3108.      ⁿ NAME           gotorc -  go to a specific position (qcursor.asm)
  3109.  
  3110.      ⁿ USAGE          void gotorc(row,col);
  3111.                       int row - row to position cursor (1 based)
  3112.                       int col - col to position cursor (1 based)
  3113.  
  3114.      ⁿ PROTOTYPE IN   #include <w1.h>
  3115.                       #include <windprot.h>
  3116.  
  3117.      ⁿ DESCRIPTION    The gotorc function positions the cursor at
  3118.                       the defined row and column on the current
  3119.                       active video page. Top left corner of the
  3120.                       screen is 1,1 and bottom right corner of
  3121.                       the screen is 25,80. No error checking is
  3122.                       done for invalid coordinates.
  3123.  
  3124.                       Works only on the current video page.
  3125.  
  3126.      ⁿ RETURN VALUE   None
  3127.  
  3128.      ⁿ SEE ALSO
  3129.  
  3130.      ⁿ EXAMPLE
  3131.  
  3132.        #define USE_LOCAL         /* used for resolving externals */
  3133.  
  3134.        #include <stdio.h>        /* for printf */
  3135.        #include <w1.h>
  3136.        #include <windprot.h>     /* prototype for gotorc */
  3137.  
  3138.        void main(void);
  3139.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3140.           gotorc(12,40);          /* position cursor in center of screen */
  3141.           printf("MC-WINDOWS\n"); /* print a message */
  3142.        }
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.         MC-WINDOW                                                           46
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.                                                                     INITWINDOW
  3171.     __________________________________________________________________________
  3172.  
  3173.  
  3174.      ⁿ NAME           initwindow -  initialize window routines (wind20.c)
  3175.  
  3176.      ⁿ USAGE          void initwindow(wattr,clear_screen);
  3177.                       int wattr        - attribute for initial window
  3178.                       int clear_screen - boolean to clear the screen
  3179.  
  3180.      ⁿ PROTOTYPE IN   #include <w1.h>
  3181.                       #include <windprot.h>
  3182.  
  3183.      ⁿ DESCRIPTION    The initwindow function initializes the window
  3184.                       structures and if clear_screen is set, clears the
  3185.                       the whole screen with the attribute wattr.  If
  3186.                       the screen under the very first screen needs to be
  3187.                       saved use qstore() and store its contents for use
  3188.                       later (see example). All other screens are saved
  3189.                       dynamically.
  3190.  
  3191.                       NOTE:This routine must be called only once before any
  3192.                            of the window routines are used.
  3193.  
  3194.      ⁿ RETURN VALUE   None
  3195.  
  3196.      ⁿ SEE ALSO       qstore, qrestore
  3197.  
  3198.      ⁿ EXAMPLE
  3199.  
  3200.        #define USE_LOCAL         /* used for resolving externals */
  3201.  
  3202.        #include <w1.h>
  3203.        #include <windprot.h>     /* prototype for initwindow */
  3204.  
  3205.        void main(void);
  3206.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3207.           char first_screen[2000]; /* size of screen, chars and attr */
  3208.  
  3209.           initwindow(79,1);       /* clear whole screen with red on white */
  3210.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  3211.                  :
  3212.                  :
  3213.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  3214.        }
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.         MC-WINDOW                                                           47
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.     INSERT
  3237.     __________________________________________________________________________
  3238.  
  3239.  
  3240.      ⁿ NAME           insert - insert a character at a specified position
  3241.                                in a string (getstr.c)
  3242.  
  3243.      ⁿ USAGE          void insert(ch,str,pos);
  3244.                       int ch    - character to be inserted
  3245.                       char *str - string to be altered
  3246.                       int pos   - position in string where insertion is to
  3247.                                   occur
  3248.  
  3249.      ⁿ PROTOTYPE IN   #include <w1.h>
  3250.                       #include <windprot.h>
  3251.  
  3252.      ⁿ DESCRIPTION    The insert function inserts the specified
  3253.                       character starting at the specified position into
  3254.                       the string. The resultant string is the original
  3255.                       string plus the inserted character. Position starts
  3256.                       at 0 and goes to length of the string.
  3257.  
  3258.      ⁿ RETURN VALUE   None
  3259.  
  3260.      ⁿ SEE ALSO       delete
  3261.  
  3262.      ⁿ EXAMPLE
  3263.  
  3264.        #define USE_LOCAL         /* used for resolving externals */
  3265.  
  3266.        #include <stdio.h>        /* for printf function */
  3267.        #include <w1.h>
  3268.        #include <windprot.h>     /* prototype for insert */
  3269.  
  3270.        void main(void);
  3271.  
  3272.        char *test= "this is a abnormal string";
  3273.        void main (void) {          /* MSC 5.0 and Turbo-C specific */
  3274.           insert(110,test,9);      /* correct string               */
  3275.           printf("new string is %s\n",test);
  3276.        }
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.         MC-WINDOW                                                           48
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.                                                                     MAKEWINDOW
  3303.     __________________________________________________________________________
  3304.  
  3305.  
  3306.      ⁿ NAME           makewindow -  create a window (wind20.c)
  3307.  
  3308.      ⁿ USAGE          void makewindow(row,col,rows,cols,wattr,battr,brdsel);
  3309.                       int row             - row to start window, (1 based)
  3310.                       int col             - column to start window,
  3311.                                             (1 based)
  3312.                       int rows            - number of rows in window,
  3313.                                             (1 based)
  3314.                       int cols            - number of columns in window,
  3315.                                             (1 based)
  3316.                       int wattr           - attribute for inside of window
  3317.                       int battr           - attribute for border of window
  3318.                       enum BORDERS brdsel - border selection:
  3319.  
  3320.                         nobrdr     - no border
  3321.                         blankbrdr  - no border
  3322.                         singlebrdr - single border
  3323.                         doublebrdr - double border
  3324.                         mixedbrdr  - single sides, double top and bottom
  3325.                         solidbrdr  - inverted space for all borders
  3326.                         evensolid  - even solid border
  3327.                         thinsolid  - thin solid border
  3328.                         lhatchbrdr - low intensity hatch border
  3329.                         mhatchbrdr - medium intensity hatch border
  3330.                         hhatchbrdr - high intensity hatch border
  3331.                         userbrdr   - user defined border (same as nobrdr)
  3332.  
  3333.      ⁿ PROTOTYPE IN   #include <w1.h>
  3334.                       #include <windprot.h>
  3335.  
  3336.      ⁿ DESCRIPTION    The makewindow function creates a window on the
  3337.                       screen with optional border type. In addition, the
  3338.                       global variables shadoweffect and zoomeffect can be
  3339.                       set to effect the look of the window as follows:
  3340.  
  3341.                          zoomeffect   : 1 - windows will explode from center
  3342.                                             to their full dimension.
  3343.                                         0 - no explosion takes place
  3344.  
  3345.                          shadoweffect : bottomleft  - shadowfill on the left
  3346.                                                       and bottom
  3347.                                         bottomright - shadowfill on the right
  3348.                                                       and bottom
  3349.                                         topleft     - shadowfill on left and
  3350.                                                       top
  3351.                                         topright    - shadowfill on right and
  3352.                                                       top
  3353.  
  3354.                       The two global variables defined above would remain
  3355.                       in effect until they are changed, so sucessive calls
  3356.                       to makewindow would also use these defined values.
  3357.  
  3358.  
  3359.  
  3360.         MC-WINDOW                                                           49
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.     MAKEWINDOW
  3369.     __________________________________________________________________________
  3370.  
  3371.                       If there is not enough memory or the maximum allowable
  3372.                       number of windows is exceeded, an error is printed and
  3373.                       the user is returned to DOS. No error checking is
  3374.                       done on the row,col,rows or cols coordinates.
  3375.  
  3376.                       NOTE:The routine initwindow() must be called before
  3377.                            using this function.
  3378.  
  3379.      ⁿ RETURN VALUE   None
  3380.  
  3381.      ⁿ SEE ALSO       removewindow,titlewindow,remove_windows,
  3382.                       remove_all_windows
  3383.  
  3384.      ⁿ EXAMPLE
  3385.  
  3386.        #define USE_LOCAL         /* used for resolving externals */
  3387.  
  3388.        #include <w1.h>
  3389.        #include <windprot.h>     /* prototype for makewindow */
  3390.  
  3391.        void main(void);
  3392.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3393.           char first_screen[2000]; /* size of screen, chars and attr */
  3394.  
  3395.           initwindow(79,1);       /* clear whole screen with red on white */
  3396.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  3397.           /*=======================================================*/
  3398.           /* Create a window in the upper half of the screen with  */
  3399.           /* a BLUE background and YELLOW foreground, a RED on     */
  3400.           /* WHITE double lined border. Also explode the window    */
  3401.           /* and set a shadow on the bottom right                  */
  3402.           /*=======================================================*/
  3403.           zoomeffect = 1;
  3404.           shadoweffect = bottomright;
  3405.           makewindow(1,1,11,76,31,79,doublebrdr);
  3406.                  :
  3407.                  :
  3408.           removewindow();  /* get rid of the window */
  3409.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  3410.        }
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.         MC-WINDOW                                                           50
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.                                                                          QATTR
  3435.     __________________________________________________________________________
  3436.  
  3437.  
  3438.      ⁿ NAME           qattr -  fill an area of with attribute (qfill.asm)
  3439.  
  3440.      ⁿ USAGE          void qattr(row,col,rows,cols,attr);
  3441.                       int row  - row to start attribute fill, (1 based)
  3442.                       int col  - col to start attribute fill, (1 based)
  3443.                       int rows - number of rows to attribute fill
  3444.                       int cols - number of columns to attribute fill
  3445.                       int attr - attribute to use for fill
  3446.  
  3447.      ⁿ PROTOTYPE IN   #include <w1.h>
  3448.                       #include <windprot.h>
  3449.  
  3450.      ⁿ DESCRIPTION    The qattr function fills a region of the screen
  3451.                       with an attribute. The text, if any ,that is present
  3452.                       on the screen is unchanged. The region is defined by:
  3453.                       starting position: row,col
  3454.                       ending position:   row+rows,col+cols
  3455.  
  3456.                       If the attribute is less than 0 the current screen
  3457.                       attribute will be used in its place. Error
  3458.                       checking is done on the row,col parameters to
  3459.                       ensure they are greater than zero. If they are not
  3460.                       the function just exits and does nothing.
  3461.  
  3462.                       NOTE:The routine qinit() must be called before using
  3463.                            this function, if no other window routines
  3464.                            are used. If you plan to use the window
  3465.                            routines call initwindow() instead.
  3466.  
  3467.      ⁿ RETURN VALUE   None
  3468.  
  3469.      ⁿ SEE ALSO       qattrc
  3470.  
  3471.      ⁿ EXAMPLE
  3472.  
  3473.        #define USE_LOCAL         /* used for resolving externals */
  3474.  
  3475.        #include <w1.h>
  3476.        #include <windprot.h>     /* prototype for qattr */
  3477.  
  3478.        void main(void);
  3479.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3480.           qinit();                /* initialize screen, etc */
  3481.           qattr(1,1,25,80,79);   /* change whole screen to RED on WHITE */
  3482.                  :
  3483.                  :
  3484.        }
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.         MC-WINDOW                                                           51
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.     QATTRC
  3501.     __________________________________________________________________________
  3502.  
  3503.  
  3504.      ⁿ NAME           qattrc -  fill an area (self centered) with
  3505.                                   attribute (qfill.asm)
  3506.  
  3507.      ⁿ USAGE          void qattrc(row,colL,colR,rows,cols,attr);
  3508.                       int row       - row to start attribute fill,
  3509.                                       (1 based)
  3510.                       int colL,colR - columns to center attribute,
  3511.                                       (1 based)
  3512.                       int rows      - number of rows to attribute fill
  3513.                       int cols      - number of columns to attribute fill
  3514.                       int attr      - attribute to use for fill
  3515.  
  3516.      ⁿ PROTOTYPE IN   #include <w1.h>
  3517.                       #include <windprot.h>
  3518.  
  3519.      ⁿ DESCRIPTION    The qattrc function centers a region of the screen
  3520.                       with an attribute. The region between colL and colR
  3521.                       is centered for the number of columns specified in
  3522.                       the cols parameter. This process is repeated for
  3523.                       the number of rows in the rows parameter starting
  3524.                       at row.  The text, if any, that is present on
  3525.                       the screen is left unchanged.
  3526.  
  3527.                       If the attribute is less than 0 the current screen
  3528.                       attribute will be used in its place. Error
  3529.                       checking is done on the row,col parameters to
  3530.                       ensure they are greater than zero. If they are not
  3531.                       the function just exits and does nothing.
  3532.  
  3533.                       NOTE:The routine qinit() must be called before using
  3534.                            this function, if no other window routines
  3535.                            are used. If you plan to use the window
  3536.                            routines call initwindow() instead.
  3537.  
  3538.      ⁿ RETURN VALUE   None
  3539.  
  3540.      ⁿ SEE ALSO       qattr
  3541.  
  3542.      ⁿ EXAMPLE
  3543.  
  3544.        #define USE_LOCAL         /* used for resolving externals */
  3545.  
  3546.        #include <w1.h>
  3547.        #include <windprot.h>     /* prototype for qattrc */
  3548.  
  3549.        void main(void);
  3550.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3551.  
  3552.           qinit();                /* initialize screen, etc */
  3553.           /*=====================================================*/
  3554.           /* Change the attribute of the region centered by      */
  3555.           /* column 2 and 77 for 10 columns and 7 rows starting  */
  3556.  
  3557.  
  3558.         MC-WINDOW                                                           52
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.                                                                         QATTRC
  3567.     __________________________________________________________________________
  3568.  
  3569.           /* at row 2 to RED on WHITE.                           */
  3570.           /*=====================================================*/
  3571.           qattrc(2,2,77,7,10,79);
  3572.                  :
  3573.                  :
  3574.        }
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.  
  3597.  
  3598.  
  3599.  
  3600.  
  3601.  
  3602.  
  3603.  
  3604.  
  3605.  
  3606.  
  3607.  
  3608.  
  3609.  
  3610.  
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.         MC-WINDOW                                                           53
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.     QBOX
  3633.     __________________________________________________________________________
  3634.  
  3635.  
  3636.      ⁿ NAME           qbox -  draw a box with border type (wind20.c)
  3637.  
  3638.      ⁿ USAGE          void qbox(row,col,rows,cols,box_attr,battr,brdsel);
  3639.                       int row             - row to start window,
  3640.                                             (1 based)
  3641.                       int col             - column to start window,
  3642.                                             (1 based)
  3643.                       int rows            - number of rows in window,
  3644.                                             (1 based)
  3645.                       int cols            - number of columns in window,
  3646.                                             (1 based)
  3647.                       int box_attr        - attribute for inside of box
  3648.                       int battr           - attribute for border of box
  3649.                       enum BORDERS brdsel - border selection:
  3650.  
  3651.                         nobrdr     - no border
  3652.                         blankbrdr  - no border
  3653.                         singlebrdr - single border
  3654.                         doublebrdr - double border
  3655.                         mixedbrdr  - single sides, double top and bottom
  3656.                         solidbrdr  - inverted space for all borders
  3657.                         evensolid  - even solid border
  3658.                         thinsolid  - thin solid border
  3659.                         lhatchbrdr - low intensity hatch border
  3660.                         mhatchbrdr - medium intensity hatch border
  3661.                         hhatchbrdr - high intensity hatch border
  3662.                         userbrdr   - user defined border (same as nobrdr)
  3663.  
  3664.      ⁿ PROTOTYPE IN   #include <w1.h>
  3665.                       #include <windprot.h>
  3666.  
  3667.      ⁿ DESCRIPTION    The qbox function draws a box on the screen with
  3668.                       optional border type. No part of the active screen
  3669.                       is saved, and no error checking is done for valid
  3670.                       screen coordinates.
  3671.  
  3672.                       If box_attr or battr is less than 0 the current
  3673.                       screen attribute will be used in its place.
  3674.  
  3675.                       NOTE:The routine qinit() must be called before using
  3676.                            this function, if no other window routines
  3677.                            are used. If you plan to use the window
  3678.                            routines call initwindow() instead.
  3679.  
  3680.      ⁿ RETURN VALUE   None
  3681.  
  3682.      ⁿ SEE ALSO       makewindow
  3683.  
  3684.      ⁿ EXAMPLE
  3685.  
  3686.        #define USE_LOCAL         /* used for resolving externals */
  3687.  
  3688.  
  3689.  
  3690.         MC-WINDOW                                                           54
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.                                                                           QBOX
  3699.     __________________________________________________________________________
  3700.  
  3701.        #include <w1.h>
  3702.        #include <windprot.h>     /* prototype for qbox */
  3703.  
  3704.        void main(void);
  3705.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3706.           /*=======================================================*/
  3707.           /* Draw a box around the whole screen with the inside    */
  3708.           /* YELLOW on BLUE with a thin solid RED on WHITE BORDER  */
  3709.           /*=======================================================*/
  3710.           qinit();
  3711.           qbox(1,1,25,80,31,79,thinsolid);
  3712.                    :
  3713.                    :
  3714.        }
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.         MC-WINDOW                                                           55
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.     QFILL
  3765.     __________________________________________________________________________
  3766.  
  3767.  
  3768.      ⁿ NAME           qfill -  fill an area of with a character
  3769.                                (qfill.asm)
  3770.  
  3771.      ⁿ USAGE          void qfill(row,col,rows,cols,attr,char1);
  3772.                       int row             - character fill start row, (1 based)
  3773.                       int col             - character fill start col, (1 based)
  3774.                       int rows            - number of rows to fill
  3775.                       int cols            - number of columns to fill
  3776.                       int attr            - attribute to use for fill
  3777.                       unsigned char char1 - charcter to use
  3778.  
  3779.      ⁿ PROTOTYPE IN   #include <w1.h>
  3780.                       #include <windprot.h>
  3781.  
  3782.      ⁿ DESCRIPTION    The qfill function fills a region of the screen
  3783.                       with a character and attribute. The region is defined
  3784.                       by:
  3785.  
  3786.                       starting position : row,col
  3787.                       ending position   : row+rows,col+cols
  3788.  
  3789.                       If the attribute is less than 0 the current screen
  3790.                       attribute will be used in its place. Error
  3791.                       checking is done on the row,col parameters to
  3792.                       ensure they are greater than zero. If they are not
  3793.                       the function just exits and does nothing.
  3794.  
  3795.                       NOTE:The routine qinit() must be called before using
  3796.                            this function, if no other window routines
  3797.                            are used. If you plan to use the window
  3798.                            routines call initwindow() instead.
  3799.  
  3800.      ⁿ RETURN VALUE   None
  3801.  
  3802.      ⁿ SEE ALSO       qfillc
  3803.  
  3804.      ⁿ EXAMPLE
  3805.  
  3806.        #define USE_LOCAL         /* used for resolving externals */
  3807.        #define CLEAR   ' '
  3808.  
  3809.        #include <w1.h>
  3810.        #include <windprot.h>     /* prototype for qfill */
  3811.  
  3812.        void main(void);
  3813.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3814.           qinit();                /* initialize screen, etc */
  3815.           qfill(1,1,25,80,79,CLEAR);   /* clear whole screen to RED on WHITE */
  3816.                  :
  3817.                  :
  3818.        }
  3819.  
  3820.  
  3821.  
  3822.         MC-WINDOW                                                           56
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.                                                                         QFILLC
  3831.     __________________________________________________________________________
  3832.  
  3833.  
  3834.      ⁿ NAME           qfillc -  fill an area (self centered) with
  3835.                                   attribute and character (qfill.asm)
  3836.  
  3837.      ⁿ USAGE          void qfillc(row,colL,colR,rows,cols,attr,char1);
  3838.                       int row             - row to start character attribute
  3839.                                             fill, (1 based)
  3840.                       int colL,colR       - columns to center attribute
  3841.                                             fill, (1 based)
  3842.                       int rows            - number of rows to character
  3843.                                             attribute fill
  3844.                       int cols            - number of columns to character
  3845.                                             attribute fill
  3846.                       int attr            - attribute to use for character
  3847.                                             fill
  3848.                       unsigned char char1 - charcter to use
  3849.  
  3850.      ⁿ PROTOTYPE IN   #include <w1.h>
  3851.                       #include <windprot.h>
  3852.  
  3853.      ⁿ DESCRIPTION    The qfillc function centers a region of the screen
  3854.                       with a character & attribute. The region between colL
  3855.                       and colR is centered for the number of columns specified
  3856.                       in the cols parameter. This process is repeated for
  3857.                       the number of rows in the rows parameter starting
  3858.                       at row.  The text, if any, that is present on
  3859.                       the screen is changed.
  3860.  
  3861.                       If the attribute is less than 0 the current screen
  3862.                       attribute will be used in its place. Error
  3863.                       checking is done on the row,col parameters to
  3864.                       ensure they are greater than zero. If they are not
  3865.                       the function just exits and does nothing.
  3866.  
  3867.                       NOTE:The routine qinit() must be called before using
  3868.                            this function, if no other window routines
  3869.                            are used. If you plan to use the window
  3870.                            routines call initwindow() instead.
  3871.  
  3872.      ⁿ RETURN VALUE   None
  3873.  
  3874.      ⁿ SEE ALSO       qfill
  3875.  
  3876.      ⁿ EXAMPLE
  3877.  
  3878.        #define USE_LOCAL         /* used for resolving externals */
  3879.        #define CAPITAL_A  65
  3880.  
  3881.        #include <w1.h>
  3882.        #include <windprot.h>     /* prototype for qfillc */
  3883.  
  3884.        void main(void);
  3885.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  3886.  
  3887.  
  3888.         MC-WINDOW                                                           57
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.     QFILLC
  3897.     __________________________________________________________________________
  3898.  
  3899.           qinit();                /* initialize screen, etc */
  3900.           /*==============================================================*/
  3901.           /* Change the text and attribute of the region centered by      */
  3902.           /* column 2 and 77 for 10 columns and 7 rows starting           */
  3903.           /* at row 2 to RED on WHITE capital A's                         */
  3904.           /*==============================================================*/
  3905.           qfillc(2,2,77,7,10,79,CAPITAL_A);
  3906.                  :
  3907.                  :
  3908.        }
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.         MC-WINDOW                                                           58
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.                                                                          QINIT
  3963.     __________________________________________________________________________
  3964.  
  3965.  
  3966.      ⁿ NAME           qinit -  initialize Qwik - Utilities
  3967.  
  3968.      ⁿ USAGE          void qinit(void);
  3969.  
  3970.      ⁿ PROTOTYPE IN   #include <w1.h>
  3971.                       #include <windprot.h>
  3972.  
  3973.      ⁿ DESCRIPTION    The qinit function initializes all of the local and
  3974.                       external variables used by the Qwik - Utilities.
  3975.                       The following get initialized:
  3976.  
  3977.                       unsigned page0seg - screen segment of current video
  3978.                                           page (local).
  3979.                       unsigned qseg     - screen segment of current page
  3980.                                           (global).
  3981.                       int qwait         - video retrace global variable
  3982.                       int cardwait      - video retrace local variable
  3983.                       int maxpage       - maximum video pages monitor
  3984.                                           supports:
  3985.  
  3986.                                     MDA - 0
  3987.                                     CGA - 3
  3988.                                     EGA - 7
  3989.  
  3990.                       NOTE:The routine qinit() must be called before using
  3991.                            any Qwik - Utility functions. If you plan to use
  3992.                            the window routines call initwindow() instead.
  3993.  
  3994.      ⁿ RETURN VALUE   None
  3995.  
  3996.      ⁿ SEE ALSO       initwindow
  3997.  
  3998.      ⁿ EXAMPLE
  3999.  
  4000.        #define USE_LOCAL         /* used for resolving externals */
  4001.  
  4002.        #include <w1.h>
  4003.        #include <windprot.h>     /* prototype for qinit */
  4004.  
  4005.        void main(void);
  4006.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4007.           qinit();                /* initialize screen, etc */
  4008.              :
  4009.              :
  4010.              :
  4011.        }
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.         MC-WINDOW                                                           59
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.     QPAGE
  4029.     __________________________________________________________________________
  4030.  
  4031.  
  4032.      ⁿ NAME           qpage -  change active video page  (qpage.asm)
  4033.  
  4034.      ⁿ USAGE          void qpage(new_page);
  4035.                       int new_page - new page for display
  4036.  
  4037.      ⁿ PROTOTYPE IN   #include <w1.h>
  4038.                       #include <windprot.h>
  4039.  
  4040.      ⁿ DESCRIPTION    The qpage function changes the active video page.
  4041.                       The default is page 0. New_page can support the
  4042.                       following pages:
  4043.  
  4044.                              EGA - 0-maxpage (7)
  4045.                              CGA - 0-maxpage (3)
  4046.                              MDA - 0
  4047.  
  4048.                       Error checking is performed based on the monitor type.
  4049.                       Values of less than zero and greater than maxpage
  4050.                       are igmored.  Maxpage is set by calling qinit() or
  4051.                       the initwindow() function. If you use this function
  4052.                       to change pages make sure you return it to video
  4053.                       page zero before leaving your application, or all
  4054.                       subsequent commands will affect only the last active
  4055.                       video page.
  4056.  
  4057.                       NOTE:The routine qinit() must be called before using
  4058.                            this function, if no other window routines
  4059.                            are used. If you plan to use the window
  4060.                            routines call initwindow() instead.
  4061.  
  4062.      ⁿ RETURN VALUE   None
  4063.  
  4064.      ⁿ SEE ALSO       qwritepage
  4065.  
  4066.      ⁿ EXAMPLE
  4067.  
  4068.        #define USE_LOCAL         /* used for resolving externals */
  4069.        #define VIDEO_PAGE_ONE   1
  4070.        #define VIDEO_PAGE_ZERO  0
  4071.  
  4072.        #include <w1.h>
  4073.        #include <windprot.h>     /* prototype for qpage */
  4074.  
  4075.        void main(void);
  4076.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4077.           qinit();                /* initialize screen, etc */
  4078.           qpage(VIDEO_PAGE_ONE);  /* change to video page one */
  4079.              :
  4080.              :
  4081.           qpage(VIDEO_PAGE_ZERO); /* change back to zero for DOS, etc */
  4082.        }
  4083.  
  4084.  
  4085.  
  4086.         MC-WINDOW                                                           60
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.                                                                       QRESTORE
  4095.     __________________________________________________________________________
  4096.  
  4097.  
  4098.      ⁿ NAME           qrestore -  restore buffer to screen  (qstore.asm)
  4099.  
  4100.      ⁿ USAGE          void qrestore(row,col,rows,cols,buffer);
  4101.                       int row      - row to start restore, (1 based)
  4102.                       int col      - col to start restore, (1 based)
  4103.                       int rows     - number of rows to restore
  4104.                       int cols     - number of columns to restore
  4105.                       char *buffer - buffer to restore to screen
  4106.  
  4107.      ⁿ PROTOTYPE IN   #include <w1.h>
  4108.                       #include <windprot.h>
  4109.  
  4110.      ⁿ DESCRIPTION    The qrestore function restores a region of the screen
  4111.                       from the character variable buffer.  Buffer holds the
  4112.                       character and attribute pairs for the region defined,
  4113.                       usually from a previous call to qstore(). Buffer can be
  4114.                       a character array of the defined dimensions or a
  4115.                       allocated pointer (see example);
  4116.  
  4117.                       No error checking is done on boundary conditions.
  4118.                       This function only works on the current active video
  4119.                       page.
  4120.  
  4121.                       NOTE:The routine qinit() must be called before using
  4122.                            this function, if no other window routines
  4123.                            are used. If you plan to use the window
  4124.                            routines call initwindow() instead.
  4125.  
  4126.      ⁿ RETURN VALUE   None
  4127.  
  4128.      ⁿ SEE ALSO       qstore
  4129.  
  4130.      ⁿ EXAMPLE
  4131.  
  4132.        #define USE_LOCAL         /* used for resolving externals */
  4133.  
  4134.        #include <stdio.h>
  4135.        #include <malloc.h>       /* MSC5, TURBO-C = alloc.h */
  4136.        #include <w1.h>
  4137.        #include <windprot.h>     /* prototype for qrestore */
  4138.  
  4139.        void main(void);
  4140.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4141.           char first_screen[2000]; /* size of screen, chars and attr */
  4142.           char *screen;            /* pointer to store screen to */
  4143.  
  4144.           initwindow(79,1);       /* clear whole screen with red on white */
  4145.           screen = (char *)calloc(1,2000*sizeof(char));
  4146.           if (screen == NULL)
  4147.              exit(3);             /* not enough heap space , so exit */
  4148.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  4149.           qstore(1,1,25,80,screen);       /* save 1st screen using pointer */
  4150.  
  4151.  
  4152.         MC-WINDOW                                                           61
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.     QRESTORE
  4161.     __________________________________________________________________________
  4162.  
  4163.           qfill(1,1,25,80,31,' ');    /*clear screen with YELLOW on BLUE */
  4164.                  :
  4165.                  :
  4166.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  4167.           qrestore(1,1,25,80,screen); /* restore 1st screen using pointer
  4168.        }
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.         MC-WINDOW                                                           62
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.                                                                         QSTORE
  4227.     __________________________________________________________________________
  4228.  
  4229.  
  4230.      ⁿ NAME           qstore -  store buffer to screen  (qstore.asm)
  4231.  
  4232.      ⁿ USAGE          void qstore(row,col,rows,cols,buffer);
  4233.                       int row      - row to start store, 1 based
  4234.                       int col      - col to start sore, 1 based
  4235.                       int rows     - number of rows to store
  4236.                       int cols     - number of columns to store
  4237.                       char *buffer - buffer to store screen to
  4238.  
  4239.      ⁿ PROTOTYPE IN   #include <w1.h>
  4240.                       #include <windprot.h>
  4241.  
  4242.      ⁿ DESCRIPTION    The qstore function stores a region of the screen
  4243.                       to the character variable buffer.  Buffer will hold the
  4244.                       character and attribute pairs for the region defined,
  4245.                       and can be restored with a call to qrestore().  Buffer
  4246.                       can be a character array of the defined dimensions or a
  4247.                       allocated pointer (see example);
  4248.  
  4249.                       No error checking is done on boundary conditions.
  4250.                       This function only works on the current active video
  4251.                       page.
  4252.  
  4253.                       NOTE:The routine qinit() must be called before using
  4254.                            this function, if no other window routines
  4255.                            are used. If you plan to use the window
  4256.                            routines call initwindow() instead.
  4257.  
  4258.      ⁿ RETURN VALUE   None
  4259.  
  4260.      ⁿ SEE ALSO       qrestore
  4261.  
  4262.      ⁿ EXAMPLE
  4263.  
  4264.        #define USE_LOCAL         /* used for resolving externals */
  4265.  
  4266.        #include <stdio.h>        /* for NULL */
  4267.        #include <malloc.h>       /* MSC5, TURBO-C = alloc.h */
  4268.        #include <w1.h>
  4269.        #include <windprot.h>     /* prototype for qstore  */
  4270.  
  4271.        void main(void);
  4272.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4273.           char first_screen[2000]; /* size of screen, chars and attr */
  4274.           char *screen;            /* pointer to store screen to */
  4275.  
  4276.           initwindow(79,1);       /* clear whole screen with red on white */
  4277.           screen = (char *)calloc(1,2000*sizeof(char));
  4278.           if (screen == NULL)
  4279.              exit(3);             /* not enough heap space , so exit */
  4280.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  4281.           qstore(1,1,25,80,screen);       /* save 1st screen using pointer */
  4282.  
  4283.  
  4284.         MC-WINDOW                                                           63
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.     QSTORE
  4293.     __________________________________________________________________________
  4294.  
  4295.           qfill(1,1,25,80,31,' ');    /*clear screen with YELLOW on BLUE */
  4296.                  :
  4297.                  :
  4298.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  4299.           qrestore(1,1,25,80,screen); /* restore 1st screen using pointer
  4300.        }
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.         MC-WINDOW                                                           64
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.                                                                         QWRITE
  4359.     __________________________________________________________________________
  4360.  
  4361.  
  4362.      ⁿ NAME           qwrite -  write a string to the screen (qwrite.asm)
  4363.  
  4364.      ⁿ USAGE          void qwrite(row,col,attr,string);
  4365.                       int row      - row to start write, (1 based)
  4366.                       int col      - col to start write, (1 based)
  4367.                       int attr     - attribute to write string in
  4368.                       char *string - string to write to screen
  4369.  
  4370.      ⁿ PROTOTYPE IN   #include <w1.h>
  4371.                       #include <windprot.h>
  4372.  
  4373.      ⁿ DESCRIPTION    The qwrite function writes a null terminated string
  4374.                       on the screen at a specified position with a specific
  4375.                       attribute.
  4376.  
  4377.                       This function only works on the active video page and
  4378.                       no error checking is done on boundary conditions. If the
  4379.                       string reaches the end of the current line it wraps back
  4380.                       to column 1 of the same line.
  4381.  
  4382.                       If the attribute is less than 0 the current screen
  4383.                       attribute will be used in its place.
  4384.  
  4385.                       NOTE:The routine qinit() must be called before using
  4386.                            this function, if no other window routines
  4387.                            are used. If you plan to use the window
  4388.                            routines call initwindow() instead.
  4389.  
  4390.      ⁿ RETURN VALUE   None
  4391.  
  4392.      ⁿ SEE ALSO       qwritec, qwritelv, qwritef
  4393.  
  4394.      ⁿ EXAMPLE
  4395.  
  4396.        #define USE_LOCAL         /* used for resolving externals  */
  4397.  
  4398.        #include <w1.h>
  4399.        #include <windprot.h>     /* prototype for qwrite          */
  4400.  
  4401.        void main(void);
  4402.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4403.  
  4404.          qinit();                 /* initialize screen, etc       */
  4405.          qwrite(12,1,79,"HELLO"); /* write hello in RED on WHITE  */
  4406.        }                          /* on line 12 column 1          */
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.         MC-WINDOW                                                           65
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.     QWRITEC
  4425.     __________________________________________________________________________
  4426.  
  4427.  
  4428.      ⁿ NAME           qwritec -  write a string to the screen
  4429.                                  self centered (qwrite.asm)
  4430.  
  4431.      ⁿ USAGE          void qwritec(row,colL,colR,attr,string);
  4432.                       int row        - row to start write, (1 based)
  4433.                       int colL,colR  - columns to center the string write,
  4434.                                        (1 based)
  4435.                       int attr       - attribute to write string in
  4436.                       char *string   - string to center on screen
  4437.  
  4438.      ⁿ PROTOTYPE IN   #include <w1.h>
  4439.                       #include <windprot.h>
  4440.  
  4441.      ⁿ DESCRIPTION    The qwritec function writes a null terminated string
  4442.                       centered on the screen at a specified position with a
  4443.                       specific attribute. The string is centered between colL
  4444.                       and colR.
  4445.  
  4446.                       This function only works on the active video page and
  4447.                       no error checking is done on boundary conditions. If the
  4448.                       string reaches the end of the current line it wraps back
  4449.                       to column 1 of the same line.
  4450.  
  4451.                       If the attribute is less than 0 the current screen
  4452.                       attribute will be used in its place.
  4453.  
  4454.                       NOTE:The routine qinit() must be called before using
  4455.                            this function, if no other window routines
  4456.                            are used. If you plan to use the window
  4457.                            routines call initwindow() instead.
  4458.  
  4459.      ⁿ RETURN VALUE   None
  4460.  
  4461.      ⁿ SEE ALSO       qwrite, qwritelv, qwritef
  4462.  
  4463.      ⁿ EXAMPLE
  4464.  
  4465.        #define USE_LOCAL         /* used for resolving externals       */
  4466.  
  4467.        #include <w1.h>
  4468.        #include <windprot.h>     /* prototype for qwrite               */
  4469.  
  4470.        void main(void);
  4471.        void main (void) {         /* MSC 5.0 and Turbo-C specific      */
  4472.  
  4473.          qinit();                 /* initialize screen, etc            */
  4474.          qwritec(12,1,80,79,"HELLO"); /* center hello in RED on WHITE  */
  4475.        }                              /* on line 12                    */
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.         MC-WINDOW                                                           66
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.                                                                        QWRITEF
  4491.     __________________________________________________________________________
  4492.  
  4493.  
  4494.      ⁿ NAME           qwritef -  write a string to the screen
  4495.                                  with printf like format (qprint.c)
  4496.  
  4497.      ⁿ USAGE          int qwritef(row,col,attr,format, ....);
  4498.                       int row      - row to start the string write,
  4499.                                      (1 based)
  4500.                       int col      - column to start the string write,
  4501.                                      (1 based)
  4502.                       int attr     - attribute to write string in
  4503.                       char *format - printf like format for string
  4504.  
  4505.      ⁿ PROTOTYPE IN   #include <w1.h>
  4506.                       #include <windprot.h>
  4507.  
  4508.      ⁿ DESCRIPTION    The qwritef function writes a string to the screen
  4509.                       at row, col with an attribute in printf like style
  4510.                       format. Any valid format that can be supported by
  4511.                       printf() , is acceptable here. See the reference
  4512.                       section of your C manual for the various printf()
  4513.                       formats.
  4514.  
  4515.                       This function only works on the active video page and
  4516.                       no error checking is done on boundary conditions. If the
  4517.                       string reaches the end of the current line it wraps back
  4518.                       to column 1 of the same line. The standard C extensions
  4519.                       of \t, \b, \n, \r are supported. If the string reaches
  4520.                       the end of current page no scrolling will take place.
  4521.  
  4522.                       If the attribute is less than 0 the current screen
  4523.                       attribute will be used in its place.
  4524.  
  4525.                       NOTE:The routine qinit() must be called before using
  4526.                            this function, if no other window routines
  4527.                            are used. If you plan to use the window
  4528.                            routines call initwindow() instead.
  4529.  
  4530.      ⁿ RETURN VALUE   None
  4531.  
  4532.      ⁿ SEE ALSO       window_printf
  4533.  
  4534.      ⁿ EXAMPLE
  4535.  
  4536.        #define USE_LOCAL         /* used for resolving externals       */
  4537.  
  4538.        #include <w1.h>
  4539.        #include <windprot.h>     /* prototype for qwritef              */
  4540.  
  4541.        void main(void);
  4542.        void main (void) {         /* MSC 5.0 and Turbo-C specific      */
  4543.  
  4544.          register int index;
  4545.          qinit();                 /* initialize screen, etc            */
  4546.  
  4547.  
  4548.         MC-WINDOW                                                           67
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.     QWRITEF
  4557.     __________________________________________________________________________
  4558.  
  4559.          /*=============================================*/
  4560.          /* Display this is row number xx for each of   */
  4561.          /* first 12 lines...                           */
  4562.          /*=============================================*/
  4563.          for (index = 1; index < 12; index++)
  4564.            qwritef(index,1,79,"This is row number:[%d]",index);
  4565.        }
  4566.  
  4567.  
  4568.  
  4569.  
  4570.  
  4571.  
  4572.  
  4573.  
  4574.  
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.  
  4613.  
  4614.         MC-WINDOW                                                           68
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.                                                                       QWRITELV
  4623.     __________________________________________________________________________
  4624.  
  4625.  
  4626.      ⁿ NAME           qwritelv -  write a string to the screen
  4627.                                   of a specified length (qwrite.asm)
  4628.  
  4629.      ⁿ USAGE          void qwritelv(row,col,attr,length,string);
  4630.                       int row      - row to start write, (1 based)
  4631.                       int col      - col to start write, (1 based)
  4632.                       int attr     - attribute to write string in
  4633.                       int length   - how many characters to write
  4634.                       char *string - string to write to screen
  4635.  
  4636.      ⁿ PROTOTYPE IN   #include <w1.h>
  4637.                       #include <windprot.h>
  4638.  
  4639.      ⁿ DESCRIPTION    The qwritelv function writes a null terminated string
  4640.                       on the screen at a specified position with a specific
  4641.                       attribute for only length number of characters.
  4642.                       Only length characters will be displayed.
  4643.  
  4644.                       This function only works on the active video page and
  4645.                       no error checking is done on boundary conditions. If the
  4646.                       string reaches the end of the current line it wraps back
  4647.                       to column 1 of the same line.
  4648.  
  4649.                       If the attribute is less than 0 the current screen
  4650.                       attribute will be used in its place.
  4651.  
  4652.                       NOTE:The routine qinit() must be called before using
  4653.                            this function, if no other window routines
  4654.                            are used. If you plan to use the window
  4655.                            routines call initwindow() instead.
  4656.  
  4657.      ⁿ RETURN VALUE   None
  4658.  
  4659.      ⁿ SEE ALSO       qwritec, qwritev, qwritef, window_write
  4660.  
  4661.      ⁿ EXAMPLE
  4662.  
  4663.        #define USE_LOCAL                    /* used for resolving externals  */
  4664.  
  4665.        #include <w1.h>
  4666.        #include <windprot.h>                /* prototype for qwritelv        */
  4667.  
  4668.        void main(void);
  4669.        void main (void) {                   /* MSC 5.0 and Turbo-C specific */
  4670.  
  4671.          qinit();                           /* initialize screen, etc       */
  4672.          qwritelv(12,1,79,5,"HELLO WORLD"); /* write hello in RED on WHITE  */
  4673.        }                                    /* on line 12 column 1          */
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.         MC-WINDOW                                                           69
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.     QWRITEPAGE
  4689.     __________________________________________________________________________
  4690.  
  4691.  
  4692.      ⁿ NAME           qwritepage -  change active video page
  4693.                                     of the Qwik - Utilities  (qpage.asm)
  4694.  
  4695.      ⁿ USAGE          void qwritepage(new_page);
  4696.                       int new_page - new page for display of the
  4697.                                      Qwik - Utilities
  4698.  
  4699.      ⁿ PROTOTYPE IN   #include <w1.h>
  4700.                       #include <windprot.h>
  4701.  
  4702.      ⁿ DESCRIPTION    The qwritepage function changes the active video page
  4703.                       to be written to by the Qwik - Utilities.  All of the
  4704.                       Qwik - Utilities only write to the page defined by this
  4705.                       procedure.  The default is page 0. New_page can
  4706.                       support the following pages:
  4707.  
  4708.                              EGA - 0-maxpage (7)
  4709.                              CGA - 0-maxpage (3)
  4710.                              MDA - 0
  4711.  
  4712.                       Error checking is performed based on the monitor type.
  4713.                       Values of less than zero and greater than maxpage
  4714.                       are igmored.  Maxpage is set by calling qinit() or
  4715.                       the initwindow() function. If you use this function
  4716.                       to change pages make sure you return it to Qwik -
  4717.                       Utilty page zero before leaving your application,
  4718.                       or all subsequent commands will affect only the last
  4719.                       active Qwik - Utility page.
  4720.  
  4721.                       NOTE:The routine qinit() must be called before using
  4722.                            this function, if no other window routines
  4723.                            are used. If you plan to use the window
  4724.                            routines call initwindow() instead.
  4725.  
  4726.      ⁿ RETURN VALUE   None
  4727.  
  4728.      ⁿ SEE ALSO       qpage
  4729.  
  4730.      ⁿ EXAMPLE
  4731.  
  4732.        #define USE_LOCAL         /* used for resolving externals */
  4733.        #define VIDEO_PAGE_ONE   1
  4734.        #define VIDEO_PAGE_ZERO  0
  4735.  
  4736.        #include <w1.h>
  4737.        #include <windprot.h>     /* prototype for qwritepage */
  4738.  
  4739.        void main(void);
  4740.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  4741.           qinit();                /* initialize screen, etc */
  4742.           qpage(VIDEO_PAGE_ONE);  /* change to video page one */
  4743.           qwritepage(VIDEO_PAGE_ONE);  /* now Q -Utils can write to 1 */
  4744.  
  4745.  
  4746.         MC-WINDOW                                                           70
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.                                                                     QWRITEPAGE
  4755.     __________________________________________________________________________
  4756.  
  4757.              :
  4758.              :
  4759.           qpage(VIDEO_PAGE_ZERO); /* change back to zero for DOS, etc */
  4760.           qwritepage(VIDEO_PAGE_ZERO);  /* now Q -Utils can write to 0 */
  4761.        }
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771.  
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.         MC-WINDOW                                                           71
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.     REMOVE_ALL_WINDOWS
  4821.     __________________________________________________________________________
  4822.  
  4823.  
  4824.      ⁿ NAME           remove_all_windows - remove all windows currently
  4825.                                            allocated (wind20.c)
  4826.  
  4827.      ⁿ USAGE          void remove_all_windows(void);
  4828.  
  4829.      ⁿ PROTOTYPE IN   #include <w1.h>
  4830.                       #include <windprot.h>
  4831.  
  4832.      ⁿ DESCRIPTION    Removes all windows from the screen.
  4833.  
  4834.                       All limitations of removewindow apply here.
  4835.  
  4836.      ⁿ RETURN VALUE   Nothing.
  4837.  
  4838.      ⁿ SEE ALSO       initwindow, makewindow, titlewindow,
  4839.                       removewindow, remove_windows, scrollwindow
  4840.  
  4841.      ⁿ EXAMPLE
  4842.  
  4843.        #include <w1.h>
  4844.        #include <windprot.h>     /* prototype for remove_all_windows  */
  4845.  
  4846.        #define TRUE    1
  4847.  
  4848.        void main(void);
  4849.        void main (void) {        /* MSC 5.0 and Turbo-C specific      */
  4850.  
  4851.           initwindow(31, TRUE);
  4852.           makewindow(1, 1, 25, 80, 31, 31, doublebrdr);
  4853.           makewindow(2, 2, 24, 79, 30, 30, singlebrdr);
  4854.           makewindow(3, 3, 23, 78, 112, 112, nobrdr);
  4855.                   :
  4856.                   :
  4857.           remove_all_windows();
  4858.        }
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.  
  4878.         MC-WINDOW                                                           72
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.                                                                 REMOVE_WINDOWS
  4887.     __________________________________________________________________________
  4888.  
  4889.  
  4890.      ⁿ NAME           remove_windows - remove the specified number
  4891.                                        of windows (wind20.c)
  4892.  
  4893.      ⁿ USAGE          void remove_windows(number);
  4894.                       int number - number of windows to remove
  4895.  
  4896.      ⁿ PROTOTYPE IN   #include <w1.h>
  4897.                       #include <windprot.h>
  4898.  
  4899.      ⁿ DESCRIPTION    Removes the number of windows specified from
  4900.                       the screen.
  4901.  
  4902.                       All limitations of removewindow apply here.
  4903.                       If you try to remove too many windows an error
  4904.                       message will be displayed and the program terminated.
  4905.  
  4906.      ⁿ RETURN VALUE   Nothing.
  4907.  
  4908.      ⁿ SEE ALSO       initwindow, makewindow, titlewindow,
  4909.                       remove_all_windows, removewindow, scrollwindow
  4910.  
  4911.      ⁿ EXAMPLE
  4912.  
  4913.        #include <w1.h>
  4914.        #include <windprot.h>     /* prototype for remove_windows */
  4915.  
  4916.        #define TRUE    1
  4917.  
  4918.        void main(void);
  4919.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  4920.  
  4921.           initwindow(31, TRUE);
  4922.           makewindow(1, 1, 25, 80, 31, 31, doublebrdr);
  4923.           makewindow(2, 2, 24, 79, 30, 30, singlebrdr);
  4924.           makewindow(3, 3, 23, 78, 112, 112, nobrdr);
  4925.                   :
  4926.                   :
  4927.           remove_windows(3);
  4928.        }
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.         MC-WINDOW                                                           73
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.     REMOVEWINDOW
  4953.     __________________________________________________________________________
  4954.  
  4955.  
  4956.      ⁿ NAME           removewindow - remove a window (wind20.c)
  4957.  
  4958.      ⁿ USAGE          void removewindow(void);
  4959.  
  4960.      ⁿ PROTOTYPE IN   #include <w1.h>
  4961.                       #include <windprot.h>
  4962.  
  4963.      ⁿ DESCRIPTION    Removes the active window from the screen.
  4964.                       To get back to the original screen, there must
  4965.                       be as many removewindow(s) as there are makewindow(s).
  4966.  
  4967.                       There must be a window to remove or removewindow
  4968.                       terminates the program.
  4969.  
  4970.      ⁿ RETURN VALUE   None
  4971.  
  4972.      ⁿ SEE ALSO       initwindow, makewindow, titlewindow,
  4973.                       remove_all_windows, remove_windows, scrollwindow
  4974.  
  4975.      ⁿ EXAMPLE
  4976.  
  4977.        #include <w1.h>
  4978.        #include <windprot.h>     /* prototype for removewindow   */
  4979.  
  4980.        #define TRUE    1
  4981.  
  4982.        void main(void);
  4983.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  4984.  
  4985.           initwindow(31, TRUE);
  4986.           makewindow(1, 1, 25, 80, 31, 31, nobrdr);
  4987.                   :
  4988.                   :
  4989.           removewindow();
  4990.        }
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.         MC-WINDOW                                                           74
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.                                                                   SCROLLWINDOW
  5019.     __________________________________________________________________________
  5020.  
  5021.  
  5022.      ⁿ NAME           scrollwindow -  scroll a window (wind20.c)
  5023.  
  5024.      ⁿ USAGE          void scrollwindow(rowbegin,rowend,dir);
  5025.                       int rowbegin     - starting row in window for scroll
  5026.                       int rowend       - ending row in window for scroll
  5027.                       enum DIRTYPE dir - direction for scroll:
  5028.  
  5029.                         up   - scroll window upward
  5030.                         down - scroll window downward
  5031.  
  5032.      ⁿ PROTOTYPE IN   #include <w1.h>
  5033.                       #include <windprot.h>
  5034.  
  5035.      ⁿ DESCRIPTION    The scrollwindow function scrolls a window on the
  5036.                       current active video page.  Only the lines from
  5037.                       rowbegin to rowend are scrolled. The window must be
  5038.                       created with a makewindow() command, and no error
  5039.                       checking is done for valid row coordinates. The
  5040.                       window is scrolled with the current windows atttibute.
  5041.  
  5042.                       NOTE:The routine initwindow() must be called before
  5043.                            using this function.
  5044.  
  5045.      ⁿ RETURN VALUE   None
  5046.  
  5047.      ⁿ SEE ALSO       makewindow,removewindow,titlewindow,
  5048.                       removewindows, remove_all_windows
  5049.  
  5050.      ⁿ EXAMPLE
  5051.  
  5052.        #define USE_LOCAL         /* used for resolving externals */
  5053.  
  5054.        #include <w1.h>
  5055.        #include <windprot.h>     /* prototype for scrollwindow */
  5056.  
  5057.        void main(void);
  5058.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  5059.           char first_screen[2000]; /* size of screen, chars and attr */
  5060.  
  5061.           initwindow(79,1);       /* clear whole screen with red on white */
  5062.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  5063.           /*=======================================================*/
  5064.           /* Create a window in the upper half of the screen with  */
  5065.           /* a BLUE background and YELLOW foreground, a RED on     */
  5066.           /* WHITE double lined border. Also explode the window    */
  5067.           /* and set a shadow on the bottom right. Scroll the      */
  5068.           /* window contents up 1 row.                             */
  5069.           /*=======================================================*/
  5070.           zoomeffect = 1;
  5071.           shadoweffect = bottomright;
  5072.           makewindow(1,1,11,76,31,79,doublebrdr);
  5073.           scrollwindow(1,11,up);
  5074.  
  5075.  
  5076.         MC-WINDOW                                                           75
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.     SCROLLWINDOW
  5085.     __________________________________________________________________________
  5086.  
  5087.                  :
  5088.                  :
  5089.           removewindow();  /* get rid of the window */
  5090.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  5091.        }
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.  
  5126.  
  5127.  
  5128.  
  5129.  
  5130.  
  5131.  
  5132.  
  5133.  
  5134.  
  5135.  
  5136.  
  5137.  
  5138.  
  5139.  
  5140.  
  5141.  
  5142.         MC-WINDOW                                                           76
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.                                                                    TITLEWINDOW
  5151.     __________________________________________________________________________
  5152.  
  5153.  
  5154.      ⁿ NAME           titlewindow -  title a window (wind20.c)
  5155.  
  5156.      ⁿ USAGE          void titleindow(justify,title,tattr);
  5157.                       enum DIRTYPE justify - type of justification:
  5158.  
  5159.                         topleft         - top line left justified
  5160.                         topcenter       - top line center justified
  5161.                         topright        - top line right justified
  5162.                         bottomleft      - bottom line left justified
  5163.                         bottomcenter    - bottom line center justified
  5164.                         bottomright     - bottom line right justified
  5165.                         clearbottom     - clear bottom line by placing
  5166.                                           the current bottom character
  5167.                                           there.
  5168.                         cleartop        - clear top line by placing
  5169.                                           the current top character there.
  5170.                         clearleftside   - clear left side line by placing
  5171.                                           the current left side character
  5172.                                           there.
  5173.                         clearrighttside - clear right side line by placing
  5174.                                           the current right side character
  5175.                                           there.
  5176.                         leftside        - left side of window centered
  5177.                         rightside       - right side of window centered
  5178.  
  5179.                       char *title       - title to display
  5180.                       int tattr         - attribute to use for title
  5181.  
  5182.  
  5183.      ⁿ PROTOTYPE IN   #include <w1.h>
  5184.                       #include <windprot.h>
  5185.  
  5186.      ⁿ DESCRIPTION    The titlewindow function places a justified
  5187.                       title at the top, bottom or sides of a window
  5188.                       using tattr as the attribute. A window must be
  5189.                       created with the makewindow() function before
  5190.                       calling this function. No error checking is done
  5191.                       on the length of title, so it is possible for it
  5192.                       to extend beyond the borders, if you are not
  5193.                       careful.
  5194.  
  5195.                       If the attribute is less than 0 the current screen
  5196.                       attribute will be used in its place.
  5197.  
  5198.                       NOTE:The routine initwindow() must be called before
  5199.                            using this function.
  5200.  
  5201.      ⁿ RETURN VALUE   None
  5202.  
  5203.      ⁿ SEE ALSO       removewindow,makewindow,remove_windows,
  5204.                       remove_all_windows
  5205.  
  5206.  
  5207.  
  5208.         MC-WINDOW                                                           77
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.     TITLEWINDOW
  5217.     __________________________________________________________________________
  5218.  
  5219.      ⁿ EXAMPLE
  5220.  
  5221.        #define USE_LOCAL         /* used for resolving externals */
  5222.  
  5223.        #include <w1.h>
  5224.        #include <windprot.h>     /* prototype for makewindow */
  5225.  
  5226.        void main(void);
  5227.        void main (void) {         /* MSC 5.0 and Turbo-C specific */
  5228.           char first_screen[2000]; /* size of screen, chars and attr */
  5229.  
  5230.           initwindow(79,1);       /* clear whole screen with red on white */
  5231.           qstore(1,1,25,80,first_screen); /* save 1st screen */
  5232.           /*=======================================================*/
  5233.           /* Create a window in the upper half of the screen with  */
  5234.           /* a BLUE background and YELLOW foreground, a RED on     */
  5235.           /* WHITE double lined border. Also explode the window    */
  5236.           /* and set a shadow on the bottom right. Place a title   */
  5237.           /* on the top line and center it using the current       */
  5238.           /* attribute.                                            */
  5239.           /*=======================================================*/
  5240.           zoomeffect = 1;
  5241.           shadoweffect = bottomright;
  5242.           makewindow(1,1,11,76,31,79,doublebrdr);
  5243.           titlewindow(topcenter,"< TOP BORDER (CENTERED) >",-1);
  5244.                  :
  5245.                  :
  5246.           removewindow();  /* get rid of the window */
  5247.           qrestore(1,1,25,80,first_screen); /* restore 1st screen */
  5248.        }
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.         MC-WINDOW                                                           78
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.                                                                         VWRITE
  5283.     __________________________________________________________________________
  5284.  
  5285.  
  5286.      ⁿ NAME           vwrite -  write a string to the screen
  5287.                                 vertically (qprint.c)
  5288.  
  5289.      ⁿ USAGE          void vwrite(row,col,attr,string);
  5290.                       int row      - row to start vertical write, (1 based)
  5291.                       int col      - col to start vertical write, (1 based)
  5292.                       int attr     - attribute to write vertical string in
  5293.                       char *string - string to write vertical to screen
  5294.  
  5295.      ⁿ PROTOTYPE IN   #include <w1.h>
  5296.                       #include <windprot.h>
  5297.  
  5298.      ⁿ DESCRIPTION    The vwrite function writes a null terminated string
  5299.                       vertically on the screen at a specified position with
  5300.                       a specific attribute for the length of the string.
  5301.  
  5302.                       This function only works on the active video page and
  5303.                       no error checking is done on boundary conditions. If the
  5304.                       string reaches the end of the screen it wraps back
  5305.                       to the same column of the same line.
  5306.  
  5307.                       If the attribute is less than 0 the current screen
  5308.                       attribute will be used in its place.
  5309.  
  5310.                       NOTE:The routine qinit() must be called before using
  5311.                            this function, if no other window routines
  5312.                            are used. If you plan to use the window
  5313.                            routines call initwindow() instead.
  5314.  
  5315.      ⁿ RETURN VALUE   None
  5316.  
  5317.      ⁿ SEE ALSO       qwritec, qwritelv, qwritef, qwrite
  5318.  
  5319.      ⁿ EXAMPLE
  5320.  
  5321.        #define USE_LOCAL         /* used for resolving externals     */
  5322.  
  5323.        #include <w1.h>
  5324.        #include <windprot.h>     /* prototype for qwrite             */
  5325.  
  5326.        void main(void);
  5327.        void main (void) {         /* MSC 5.0 and Turbo-C specific    */
  5328.  
  5329.          qinit();                 /* initialize screen, etc          */
  5330.          vwrite(10,40,79,"HELLO"); /* write hello in RED on WHITE    */
  5331.        }                           /* vertically centered on screen  */
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.         MC-WINDOW                                                           79
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.     WHERE_COL
  5349.     __________________________________________________________________________
  5350.  
  5351.  
  5352.      ⁿ NAME           where_col - get current column (qcursor.asm)
  5353.  
  5354.      ⁿ USAGE          char where_col(void);
  5355.  
  5356.  
  5357.      ⁿ PROTOTYPE IN   #include <w1.h>
  5358.                       #include <windprot.h>
  5359.  
  5360.      ⁿ DESCRIPTION    The where_col function gets the current column
  5361.                       position of the cursor on the current video page.
  5362.  
  5363.                       Works only on the current video page.
  5364.  
  5365.  
  5366.      ⁿ RETURN VALUE   (char) - cursor column position
  5367.  
  5368.      ⁿ SEE ALSO       where_row
  5369.  
  5370.      ⁿ EXAMPLE
  5371.  
  5372.        #define USE_LOCAL         /* used for resolving externals */
  5373.  
  5374.        #include <w1.h>
  5375.        #include <windprot.h>     /* prototype for where_col         */
  5376.  
  5377.        void main(void);
  5378.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  5379.           char old_column;       /* saved column value           */
  5380.  
  5381.           old_column = where_col();   /* save old column            */
  5382.                  :
  5383.                  :
  5384.                  :
  5385.        }
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.         MC-WINDOW                                                           80
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.                                                                      WHERE_ROW
  5415.     __________________________________________________________________________
  5416.  
  5417.  
  5418.      ⁿ NAME           where_row - get current row (qcursor.asm)
  5419.  
  5420.      ⁿ USAGE          char where_row(void);
  5421.  
  5422.  
  5423.      ⁿ PROTOTYPE IN   #include <w1.h>
  5424.                       #include <windprot.h>
  5425.  
  5426.      ⁿ DESCRIPTION    The where_row function gets the current row
  5427.                       position of the cursor on the current video page.
  5428.  
  5429.                       Works only on the current video page.
  5430.  
  5431.  
  5432.      ⁿ RETURN VALUE   (char) - cursor row position
  5433.  
  5434.      ⁿ SEE ALSO       where_col
  5435.  
  5436.      ⁿ EXAMPLE
  5437.  
  5438.        #define USE_LOCAL         /* used for resolving externals */
  5439.  
  5440.        #include <w1.h>
  5441.        #include <windprot.h>     /* prototype for where_row         */
  5442.  
  5443.        void main(void);
  5444.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  5445.           char old_row;          /* saved row value              */
  5446.  
  5447.           old_row = where_row();   /* save old row                  */
  5448.                  :
  5449.                  :
  5450.                  :
  5451.        }
  5452.  
  5453.  
  5454.  
  5455.  
  5456.  
  5457.  
  5458.  
  5459.  
  5460.  
  5461.  
  5462.  
  5463.  
  5464.  
  5465.  
  5466.  
  5467.  
  5468.  
  5469.  
  5470.  
  5471.  
  5472.         MC-WINDOW                                                           81
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.     WIATTR
  5481.     __________________________________________________________________________
  5482.  
  5483.  
  5484.      ⁿ NAME           wiattr - calculate attribute byte (wind20.c)
  5485.  
  5486.      ⁿ USAGE          int wiattr(foreground,background);
  5487.                       int foreground - foreground color
  5488.                       int background - background color
  5489.  
  5490.      ⁿ PROTOTYPE IN   #include <w1.h>
  5491.                       #include <windprot.h>
  5492.  
  5493.      ⁿ DESCRIPTION    The wiattr function converts the foreground and
  5494.                       background colors into an attribute value,masking off
  5495.                       the background color high bits.
  5496.  
  5497.      ⁿ RETURN VALUE   (int) - calculated attribute
  5498.  
  5499.      ⁿ SEE ALSO
  5500.  
  5501.      ⁿ EXAMPLE
  5502.  
  5503.        #define USE_LOCAL         /* used for resolving externals */
  5504.  
  5505.        #include <w1.h>
  5506.        #include <windprot.h>     /* prototype for wiattr         */
  5507.        #include <color.h>        /* for color constants          */
  5508.  
  5509.        void main(void);
  5510.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  5511.           /*==================================================*/
  5512.           /* Calculate color attribute for WHITE on RED and   */
  5513.           /* use it to center a message on the screen.        */
  5514.           /*==================================================*/
  5515.           qinit();              /* for initialization */
  5516.           qwritec(12,1,80,wiattr(WHITE,RED),"MESSAGE IS WHITE ON RED");
  5517.                  :
  5518.                  :
  5519.                  :
  5520.        }
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.         MC-WINDOW                                                           82
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.                                                             WINDOW_BIOS_SCROLL
  5547.     __________________________________________________________________________
  5548.  
  5549.  
  5550.      ⁿ NAME           window_bios_scroll - define and scroll a window
  5551.                                            using BIOS services.
  5552.                                            (qcursor.asm)
  5553.  
  5554.      ⁿ USAGE          void window_bios_scroll(ucol,urow,bcol,brow,attr);
  5555.                       int ucol - upper left column of window  (1 based)
  5556.                       int urow - upper left row of window     (1 based)
  5557.                       int bcol - bottom right col of window   (1 based)
  5558.                       int brow - bottom right row of window   (1 based)
  5559.                       int attr - attribute to use for scrolled line
  5560.  
  5561.      ⁿ PROTOTYPE IN   #include <w1.h>
  5562.                       #include <windprot.h>
  5563.  
  5564.      ⁿ DESCRIPTION    The window_bios_scroll function defines a window
  5565.                       and uses BIOS to scroll the window up a single line ,
  5566.                       replacing the last line with a blank line of type
  5567.                       attr. No error checking is performed on boundary
  5568.                       conditions, and attr must be supplied for this
  5569.                       function to work properly.
  5570.  
  5571.      ⁿ RETURN VALUE   None
  5572.  
  5573.      ⁿ SEE ALSO       Scrollwindow
  5574.  
  5575.      ⁿ EXAMPLE
  5576.  
  5577.        #define USE_LOCAL         /* used for resolving externals */
  5578.  
  5579.        #include <w1.h>
  5580.        #include <windprot.h>     /* prototype for window_biso_scroll */
  5581.  
  5582.        void main(void);
  5583.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  5584.           /*==================================================*/
  5585.           /* Scroll the whole screen up one line and replace  */
  5586.           /* the last line with WHITE on RED.                 */
  5587.           /*==================================================*/
  5588.           window_bios_scroll(1,1,80,25,79);
  5589.                  :
  5590.                  :
  5591.                  :
  5592.        }
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.         MC-WINDOW                                                           83
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.     WINDOW_PRINTF
  5613.     __________________________________________________________________________
  5614.  
  5615.  
  5616.      ⁿ NAME           window_printf -  write a string to the current window
  5617.                                        with printf like format (qprint.c)
  5618.  
  5619.      ⁿ USAGE          int window_printf(attr,format, ....);
  5620.                       int attr     - attribute to write in
  5621.                       char *format - printf like format for string
  5622.  
  5623.      ⁿ PROTOTYPE IN   #include <w1.h>
  5624.                       #include <windprot.h>
  5625.  
  5626.      ⁿ DESCRIPTION    The window_printf function writes a string to the
  5627.                       current window with an attribute in printf like style
  5628.                       format. Any valid format that can be supported by
  5629.                       printf() , is acceptable here. See the reference
  5630.                       section of your C manual for the various printf()
  5631.                       formats.
  5632.  
  5633.                       Two global variables active_window_row and
  5634.                       active_window_col are set and used for the
  5635.                       active window. These may be changed at will if
  5636.                       the user wishes to place text at some other
  5637.                       window position. (see example)  The standard C
  5638.                       extensions will change these global variables.
  5639.                       These global variables only retain there values
  5640.                       for the current active window. Calling removewindow()
  5641.                       will reset the global variables to their prior states.
  5642.  
  5643.                       This function only works on the active video page and
  5644.                       no error checking is done on boundary conditions. If the
  5645.                       string reaches the end of the current line it wraps back
  5646.                       to column 1 of the same line. The standard C extensions
  5647.                       of \t, \b, \n, \r are supported. If the string reaches
  5648.                       the end of current page no scrolling will take place.
  5649.  
  5650.                       If the attribute is less than 0 the current screen
  5651.                       attribute will be used in its place.
  5652.  
  5653.                       NOTE:The routine initwindow() must be called before using
  5654.                            this function.
  5655.  
  5656.      ⁿ RETURN VALUE   None
  5657.  
  5658.      ⁿ SEE ALSO       qwritef, window_write
  5659.  
  5660.      ⁿ EXAMPLE
  5661.  
  5662.        #define USE_LOCAL         /* used for resolving externals       */
  5663.  
  5664.        #include <w1.h>
  5665.        #include <windprot.h>     /* prototype for window_printf        */
  5666.  
  5667.        void main(void);
  5668.  
  5669.  
  5670.         MC-WINDOW                                                           84
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.                                                                  WINDOW_PRINTF
  5679.     __________________________________________________________________________
  5680.  
  5681.        void main (void) {         /* MSC 5.0 and Turbo-C specific      */
  5682.  
  5683.          register int index;
  5684.          initwindow(79,1);        /* initialize screen, etc            */
  5685.          /*=============================================*/
  5686.          /* Create a window on the screen, start to     */
  5687.          /* display text 5 lines down with an attribute */
  5688.          /* of WHITE on RED.                            */
  5689.          /*=============================================*/
  5690.          makewindow(1,1,25,80,31,31,doublebrdr);
  5691.          active_window_row = 5;
  5692.          window_printf(79,"This is row number:[%d]",active_window_row);
  5693.                  :
  5694.                  :
  5695.          removewindow();          /* remove the window */
  5696.                  :
  5697.                  :
  5698.        }
  5699.  
  5700.  
  5701.  
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.         MC-WINDOW                                                           85
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.     WINDOW_WRITE
  5745.     __________________________________________________________________________
  5746.  
  5747.  
  5748.      ⁿ NAME           window_write -  write a string to the current window
  5749.                                       (qprint.c)
  5750.  
  5751.      ⁿ USAGE          int window_write(attr,string);
  5752.                       int attr     - attribute to write in
  5753.                       char *string - string to write to window
  5754.  
  5755.      ⁿ PROTOTYPE IN   #include <w1.h>
  5756.                       #include <windprot.h>
  5757.  
  5758.      ⁿ DESCRIPTION    The window_write function writes a null
  5759.                       terminated string to the current window with an
  5760.                       attribute.
  5761.  
  5762.                       Two global variables active_window_row and
  5763.                       active_window_col are set and used for the
  5764.                       active window. These may be changed at will if
  5765.                       the user wishes to place text at some other
  5766.                       window position. (see example)
  5767.  
  5768.                       This function only works on the active video page and
  5769.                       no error checking is done on boundary conditions. If the
  5770.                       string reaches the end of the current line it wraps back
  5771.                       to column 1 of the same line. No scrolling is supported
  5772.                       on exceeding window boundaries.
  5773.  
  5774.                       If the attribute is less than 0 the current screen
  5775.                       attribute will be used in its place.
  5776.  
  5777.                       NOTE:The routine initwindow() must be called before using
  5778.                            this function.
  5779.  
  5780.      ⁿ RETURN VALUE   None
  5781.  
  5782.      ⁿ SEE ALSO       qwritef, window_printf
  5783.  
  5784.      ⁿ EXAMPLE
  5785.  
  5786.        #define USE_LOCAL         /* used for resolving externals       */
  5787.  
  5788.        #include <w1.h>
  5789.        #include <windprot.h>     /* prototype for window_write         */
  5790.  
  5791.        static char *text[] = {
  5792.               "This should be line 5",
  5793.               "This should be line 6",
  5794.               "This should be line 7"
  5795.        };
  5796.  
  5797.        void main(void);
  5798.        void main (void) {         /* MSC 5.0 and Turbo-C specific      */
  5799.  
  5800.  
  5801.  
  5802.         MC-WINDOW                                                           86
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.                                                                   WINDOW_WRITE
  5811.     __________________________________________________________________________
  5812.  
  5813.          register int index;
  5814.  
  5815.          initwindow(79,1);        /* initialize screen, etc            */
  5816.          /*=============================================*/
  5817.          /* Create a window on the screen, start to     */
  5818.          /* display text 5 lines down with an attribute */
  5819.          /* of WHITE on RED.                            */
  5820.          /*=============================================*/
  5821.          makewindow(1,1,25,80,31,31,doublebrdr);
  5822.          active_window_row = 5;
  5823.          for (index = 0; index < 3; index++)
  5824.             window_write(79,"text[i]);          /* display the text    */
  5825.                  :
  5826.                  :
  5827.          removewindow();          /* remove the window */
  5828.                  :
  5829.                  :
  5830.        }
  5831.  
  5832.  
  5833.  
  5834.  
  5835.  
  5836.  
  5837.  
  5838.  
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854.  
  5855.  
  5856.  
  5857.  
  5858.  
  5859.  
  5860.  
  5861.  
  5862.  
  5863.  
  5864.  
  5865.  
  5866.  
  5867.  
  5868.         MC-WINDOW                                                           87
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.     WSLEEP
  5877.     __________________________________________________________________________
  5878.  
  5879.  
  5880.      ⁿ NAME           wsleep - suspend processing for specified duration
  5881.                                (wsound.c)
  5882.  
  5883.      ⁿ USAGE          unsigned wsleep(period);
  5884.  
  5885.                       unsigned period - number of timer ticks the process
  5886.                                         is to be suspended.
  5887.  
  5888.      ⁿ PROTOTYPE IN   #include <w1.h>
  5889.                       #include <windprot.h>
  5890.  
  5891.      ⁿ DESCRIPTION    suspends the processing for at least the number of
  5892.                       requested. Because the function checks the system clock
  5893.                       to determine if the period has transpired, the actual
  5894.                       duration may be longer than that requested.
  5895.  
  5896.                       On standard IBM PC's, timer ticks occur 1193180/65536
  5897.                       (about 18.2) times per second.
  5898.  
  5899.                       This function temporarily enables hardware interrupts,
  5900.                       but restores the state of the interrupt flag before it
  5901.                       returns.
  5902.  
  5903.      ⁿ RETURN VALUE   number of timer ticks the process was actually
  5904.                       suspended.
  5905.  
  5906.      ⁿ SEE ALSO       wsound
  5907.  
  5908.      ⁿ EXAMPLE
  5909.  
  5910.        #include <w1.h>
  5911.        #include <windprot.h>     /* prototype for wsleep         */
  5912.  
  5913.        void main(void);
  5914.        void main (void) {        /* MSC 5.0 and Turbo-C specific */
  5915.  
  5916.                   :
  5917.                   :
  5918.           printf("\nToday is the first day of the rest of your life ...\n");
  5919.           wsleep(75);            /* wait for 75 timer ticks      */
  5920.                   :
  5921.                   :
  5922.        }
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.         MC-WINDOW                                                           88
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.                                                                         WSOUND
  5943.     __________________________________________________________________________
  5944.  
  5945.  
  5946.      ⁿ NAME           wsound - make a sound (wsound.c)
  5947.  
  5948.      ⁿ USAGE          void wsound(freq, dura);
  5949.  
  5950.                       unsigned freq - desired frequency
  5951.                       unsigned dura - number of timer ticks to make sound
  5952.  
  5953.      ⁿ PROTOTYPE IN   #include <w1.h>
  5954.                       #include <windprot.h>
  5955.  
  5956.      ⁿ DESCRIPTION    Make a sound at the requested frequency for the
  5957.                       number of timer ticks specified.
  5958.  
  5959.      ⁿ RETURN VALUE   None.
  5960.  
  5961.      ⁿ SEE ALSO       wsleep
  5962.  
  5963.      ⁿ EXAMPLE
  5964.  
  5965.        #include <w1.h>
  5966.        #include <windprot.h>     /* prototype for wsound           */
  5967.  
  5968.        void main(void);
  5969.        void main (void) {        /* MSC 5.0 and Turbo-C specific   */
  5970.  
  5971.                   :
  5972.                   :
  5973.           printf("Incorrect input\n");
  5974.           wsound(450, 4);        /* make same sound as IBM PC bell */
  5975.                   :
  5976.                   :
  5977.        }
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.         MC-WINDOW                                                           89
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.     APPENDIX
  6009.     __________________________________________________________________________
  6010.  
  6011.  
  6012.  
  6013.      Function Names and Modules.............................................91
  6014.      Module Names and Functions.............................................92
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.         MC-WINDOW                                                           90
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.                                                                       APPENDIX
  6075.     __________________________________________________________________________
  6076.  
  6077.  
  6078.  
  6079.      Function Names and Modules
  6080.  
  6081.  
  6082.                  Function                    Module Defined in
  6083.  
  6084.                cursorchange................... (qcursor.asm)
  6085.                delete......................... (getstr.c)
  6086.                egacheck....................... (qpage.asm)
  6087.                getkey......................... (getstr.c)
  6088.                get_integer.................... (getint.c)
  6089.                get_menu....................... (gmenu.c)
  6090.                get_string..................... (getstr.c)
  6091.                get_video_mode................. (wind20.c)
  6092.                gotorc......................... (qcursor.asm)
  6093.                initwindow..................... (wind20.c)
  6094.                insert......................... (getstr.c)
  6095.                makewindow..................... (wind20.c)
  6096.                qattr.......................... (qfill.asm)
  6097.                qattrc......................... (qfill.asm)
  6098.                qbox........................... (wind20.c)
  6099.                qfill.......................... (qfill.asm)
  6100.                qfillc......................... (qfill.asm)
  6101.                qinit.......................... (wind20.c)
  6102.                qpage.......................... (qpage.asm)
  6103.                qrestore....................... (qstore.asm)
  6104.                qstore......................... (qstore.asm)
  6105.                qwrite......................... (qwrite.asm)
  6106.                qwritec........................ (qwrite.asm)
  6107.                qwritef........................ (qprint.c)
  6108.                qwritelv....................... (qwrite.asm)
  6109.                qwritepage..................... (qpage.asm)
  6110.                removewindow................... (wind20.c)
  6111.                remove_all_windows............. (wind20.c)
  6112.                remove_windows................. (wind20.c)
  6113.                scrollwindow................... (wind20.c)
  6114.                titlewindow.................... (wind20.c)
  6115.                vwrite......................... (qprint.c)
  6116.                where_col...................... (qcursor.asm)
  6117.                where_row...................... (qcursor.asm)
  6118.                wiattr......................... (wind20.c)
  6119.                window_bios_scroll............. (qcursor.asm)
  6120.                window_printf.................. (qprint.c)
  6121.                window_write................... (qprint.c)
  6122.                wsleep......................... (wsound.c)
  6123.                wsound......................... (wsound.c)
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.  
  6132.         MC-WINDOW                                                           91
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.     APPENDIX
  6141.     __________________________________________________________________________
  6142.  
  6143.  
  6144.      Module Names and Functions
  6145.  
  6146.  
  6147.                Module                 Functions Defined:
  6148.  
  6149.               getint.c                  get_integer
  6150.               getstr.c                  delete
  6151.                                         insert
  6152.                                         getkey
  6153.                                         get_string
  6154.               gmenu.c                   get_menu
  6155.               qcursor.asm               cursorchange
  6156.                                         gotorc
  6157.                                         where_col
  6158.                                         where_row
  6159.                                         window_bios_scroll
  6160.               qfill.asm                 qattr
  6161.                                         qattrc
  6162.                                         qfill
  6163.                                         qfillc
  6164.               qpage.asm                 egacheck
  6165.                                         qpage
  6166.                                         qwritepage
  6167.               qprint.c                  qwritef
  6168.                                         vwrite
  6169.                                         window_printf
  6170.                                         window_write
  6171.               qstore.asm                qrestore
  6172.                                         qstore
  6173.               qwrite.asm                qwrite
  6174.                                         qwritec
  6175.                                         qwritelv
  6176.               wind20.c                  get_video_mode
  6177.                                         initwindow
  6178.                                         makewindow
  6179.                                         qinit
  6180.                                         removewindow
  6181.                                         remove_all_windows
  6182.                                         remove_windows
  6183.                                         scrollwindow
  6184.                                         titlewindow
  6185.               wsound.c                  wsleep
  6186.                                         wsound
  6187.  
  6188.  
  6189.  
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.         MC-WINDOW                                                           92
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.                                                                          INDEX
  6207.     __________________________________________________________________________
  6208.  
  6209.  
  6210.       active_window_col, 14, 84, 86
  6211.       active_window_row, 14, 84, 85, 86, 87
  6212.       agreement, 1, 2, 3
  6213.       backup, 1
  6214.       border, 14, 15, 19, 27, 28, 39, 49, 50, 54, 55, 77, 78
  6215.       cardwait, 13, 14, 59
  6216.       color, 16, 25, 27, 29, 38, 39, 40, 42, 44, 82
  6217.       compile, 1, 5, 10, 12, 17, 18, 19, 20, 21, 22, 30, 31, 32, 33
  6218.       copyright, 1, 3
  6219.       cursorchange, 6, 26, 35, 91, 92
  6220.       declaration, 12, 13, 17, 19, 20
  6221.       delete, 6, 28, 36, 48, 91, 92
  6222.       demo, 1, 10
  6223.       dirtype, 14, 15, 39, 75, 77
  6224.       egacheck, 6, 29, 37, 91, 92
  6225.       error, 5, 11, 17, 46, 50, 51, 52, 54, 56, 57, 60, 61, 63, 65,
  6226.              66, 67, 69, 70, 73, 75, 77, 79, 83, 84, 86
  6227.       error handling, 5, 11, 17
  6228.       file, 5, 8, 10, 11, 12, 13, 16, 17, 18, 21
  6229.       function, 5, 7, 11, 12, 14, 15, 16, 17, 19, 20, 28, 31, 35, 36,
  6230.                 90, 91, 92
  6231.       getkey, 6, 29, 45, 91, 92
  6232.       get_integer, 6, 26, 38, 42, 91, 92
  6233.       get_menu, 6, 28, 39, 40, 41, 91, 92
  6234.       get_string, 6, 26, 38, 42, 43, 91, 92
  6235.       get_video_mode, 6, 29, 44, 91, 92
  6236.       gotorc, 6, 26, 46, 91, 92
  6237.       header, 17, 18, 21, 22, 32, 33, 34
  6238.       include, 8, 11, 12, 16, 17, 18, 19, 20, 21, 22, 23, 25, 32, 33,
  6239.                34, 44
  6240.       initwindow, 6, 13, 16, 19, 25, 47, 50, 51, 52, 54, 56, 57, 59,
  6241.                   60, 61, 63, 65, 66, 67, 69, 70, 72, 73, 74, 75, 77,
  6242.                   78, 79, 84, 85, 86, 87, 91, 92
  6243.       insert, 6, 29, 36, 48, 91, 92
  6244.       lib, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 25, 32, 33, 34
  6245.       libraries, 4, 5, 12, 13, 21, 23, 25, 30, 31, 32, 33, 34
  6246.       library, 10, 12, 13, 16, 18, 19, 20, 21, 22, 23, 25, 31, 32, 33,
  6247.                34, 94
  6248.       license, 1, 2, 3
  6249.       link, 12, 16, 18, 19, 20, 21, 22
  6250.       make, 18, 31, 32, 33, 34
  6251.       makewindow, 6, 14, 15, 18, 19, 27, 49, 50, 54, 72, 73, 74, 75,
  6252.                   77, 78, 85, 87, 91, 92
  6253.       manual, 3, 8, 18, 31, 94
  6254.       masm, 31, 32, 33, 34
  6255.       maxpage, 13, 59, 60, 70
  6256.       maxwndow, 13
  6257.       memory model support, 5, 11, 12
  6258.       menuing, 5, 24, 28
  6259.       microsoft, 3, 5, 10, 12, 18, 19, 20, 30, 31, 32, 33
  6260.       miscellaneous, 1, 5, 16, 24, 28
  6261.       old_cursor, 35
  6262.  
  6263.  
  6264.         MC-WINDOW                                                           93
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.     INDEX
  6273.     __________________________________________________________________________
  6274.  
  6275.       order, 13, 31, 94
  6276.       page0seg, 13, 59
  6277.       prototype, 16
  6278.       qattr, 6, 25, 51, 52, 91, 92
  6279.       qattrc, 6, 25, 51, 52, 53, 91, 92
  6280.       qbox, 6, 15, 29, 54, 55, 91
  6281.       qdemo20, 10
  6282.       qfill, 6, 25, 56, 57, 62, 64, 91, 92
  6283.       qfillc, 6, 25, 56, 57, 58, 91, 92
  6284.       qinit, 6, 13, 16, 25, 37, 51, 52, 54, 55, 56, 57, 58, 59, 60,
  6285.              61, 63, 65, 66, 67, 69, 70, 79, 82, 91, 92
  6286.       qpage, 6, 27, 60, 70, 71, 91, 92
  6287.       qrestore, 6, 26, 47, 50, 61, 62, 63, 64, 76, 78, 91, 92
  6288.       qseg, 13, 59
  6289.       qstore, 6, 26, 47, 50, 61, 63, 64, 75, 78, 91, 92
  6290.       quick-c, 3, 4, 5, 12, 13, 18, 20, 21, 30, 32, 94
  6291.       qwait, 14, 59
  6292.       qwik write utilities, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  6293.                            18, 19, 20, 21, 22, 23, 25, 27, 59, 70
  6294.       qwrite, 6, 27, 28, 65, 66, 79, 91, 92
  6295.       qwritec, 6, 27, 65, 66, 69, 79, 82, 91, 92
  6296.       qwritef, 6, 14, 27, 65, 66, 67, 68, 69, 79, 84, 86, 91, 92
  6297.       qwritelv, 6, 27, 65, 66, 69, 79, 91, 92
  6298.       qwritepage, 6, 13, 27, 60, 70, 71, 91, 92
  6299.       registration, 2, 4, 31, 94
  6300.       removewindow, 6, 18, 19, 28, 50, 72, 73, 74, 75, 76, 77, 78,
  6301.                     84, 85, 87, 91, 92
  6302.       remove_all_windows, 6, 27, 50, 72, 73, 74, 75, 77, 91, 92
  6303.       remove_windows, 6, 28, 50, 72, 73, 74, 77, 91, 92
  6304.       screen, 5, 10, 13, 17, 24, 25, 26, 27, 28, 39, 40, 46, 47, 49,
  6305.               51, 52, 54, 56, 57, 59, 61, 63, 65, 66, 67, 69, 74, 79
  6306.       screen filling, 5, 24, 25
  6307.       screen i/o, 5, 24, 26
  6308.       screen initialization, 5, 24, 25
  6309.       screen manipulation, 5, 24, 26
  6310.       screen paging, 5, 24, 26
  6311.       screen storing and restoring, 5, 24, 26
  6312.       screen writing, 5, 10, 24, 27
  6313.       scrollwindow, 6, 15, 18, 28, 72, 73, 74, 75, 76, 83, 91, 92
  6314.       shadoweffect, 14, 15, 19, 49, 50, 75, 78
  6315.       source code, 1, 5, 30, 31, 32, 33, 34, 94
  6316.       titlewindow, 6, 15, 28, 50, 72, 73, 74, 75, 77, 78, 91, 92
  6317.       turbo-c, 3, 4, 5, 12, 18, 22, 23, 33, 34, 35, 94
  6318.       type, 5, 8, 11, 12, 13, 14, 15, 16, 17, 20, 23, 27, 28, 54, 60
  6319.       type checking, 5, 11, 16, 17, 20, 23
  6320.       update, 2, 31
  6321.       use_local, 16, 18
  6322.       variable, 5, 8, 11, 13, 14, 15, 16, 18, 19, 20, 22, 23, 27, 32,
  6323.                 33, 49, 59, 61, 63, 84, 86
  6324.       vwrite, 6, 27, 79, 91, 92
  6325.       warranty, 1, 2
  6326.       where_col, 6, 26, 80, 81, 91, 92
  6327.       where_row, 6, 26, 80, 81, 91, 92
  6328.  
  6329.  
  6330.         MC-WINDOW                                                           94
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.                                                                          INDEX
  6339.     __________________________________________________________________________
  6340.  
  6341.       wiattr, 6, 16, 29, 82, 91
  6342.       window, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  6343.               22, 23, 24, 27, 39, 49, 50
  6344.       windowing, 5, 24, 27
  6345.       window_bios_scroll, 6, 28, 83, 91, 92
  6346.       window_printf, 6, 14, 28, 67, 84, 85, 86, 91, 92
  6347.       window_write, 6, 14, 28, 69, 84, 86, 87, 91, 92
  6348.       wsleep, 6, 29, 88, 89, 91, 92
  6349.       wsound, 6, 29, 88, 89, 91, 92
  6350.       wtutor20, 10
  6351.       zoomdelay, 14
  6352.       zoomeffect, 14, 19, 49, 50, 75, 78
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.         MC-WINDOW                                                           95
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434.  
  6435.  
  6436.  
  6437.  
  6438.  
  6439.  
  6440.  
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.                                ORDER FORM
  6471.  
  6472.  
  6473.      NAME: ______________________________________________________________
  6474.  
  6475.      COMPANY: ___________________________________________________________
  6476.  
  6477.      SHIPPING ADDRESS: __________________________________________________
  6478.  
  6479.      CITY: ______________________________________________________________
  6480.  
  6481.      STATE: ___________________________ ZIP: ____________________________
  6482.  
  6483.      PHONE: (WORK) _______________________ (HOME) _______________________
  6484.  
  6485.      COMPILER SUPPORT: MSC 5.0 & Quick-C ___  MSC 4.0 ___  TURBO-C ___
  6486.  
  6487.  
  6488.                            QUANTITY     PRICE       GROUP       TOTAL
  6489.                                      (US Dollars)  DISCOUNT
  6490.  
  6491.      Full Registration       ____   X   $55.00   -  _____  =   _______
  6492.  
  6493.      Novice Registration     ____   X   $35.00   -  _____  =   _______
  6494.  
  6495.      Source Code Only        ____   X   $25.00             =   _______
  6496.  
  6497.      ________ Library Only   ____   X   $10.00             =   _______
  6498.  
  6499.      Printed Bound Manual    ____   X   $10.00             =   _______
  6500.  
  6501.      SUBTOTAL                                                 $_______
  6502.  
  6503.      Sales Tax  (Illinois residents add 7%,
  6504.                  Indiana residents add 5%)                     _______
  6505.  
  6506.      Shipping (US Residents add $4.00, per copy
  6507.                Foreign orders add $7.00, per copy)             _______
  6508.  
  6509.      TOTAL  (Make Checks or Money Orders Payble to            $
  6510.              Michael G. Mlachak or Brian L. Cassista)          =======
  6511.  
  6512.  
  6513.      DISCOUNTS:  (Applies to registration orders only !!!)
  6514.  
  6515.                    QUANTITY       DISCOUNT
  6516.                      5-10           10%
  6517.                     11-25           15%
  6518.                     26-50           20%
  6519.                     51-??           25%
  6520.  
  6521.      Available only on 5 1/4 low density DS/DD diskettes.
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.