home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / EDITORES / TSCREDD2.ZIP / SCRDISK3.EXE / MANUAL.PT3 < prev   
Encoding:
Text File  |  1990-04-29  |  95.1 KB  |  2,301 lines

  1.                                   Page I-8
  2.       
  3.       
  4.       POP UP WINDOW SUPPORT (registered version only).......(Section W)
  5.          Introduction to Turbo ScrEdit Windows (TSW).............. W-1
  6.          Including Turbo ScrEdit Windows in your porgrams......... W-1 
  7.          Intializing Turbo ScrEdit Windows........................ W-3   
  8.          Memory usage and fragmentation considerations............ W-4 
  9.          How many windows can you use............................. M-4
  10.          How the screen memory is used............................ M-4
  11.          Terms used in this document.............................. M-5
  12.          Access a window by name or number........................ M-5
  13.          MAXWINDOWS............................................... W-6
  14.          USERWINDOW............................................... W-6
  15.          ChangeWindow............................................. W-7
  16.          ChgWindowBackGround...................................... W-9
  17.          ClearWindow.............................................. W-11
  18.          DefineWindow............................................. W-12
  19.          EraseWindow.............................................. W-15
  20.          MoveWindow............................................... W-15
  21.          OpenWindow............................................... W-17
  22.          PopWindow................................................ W-17
  23.          PauseWindowUpdates....................................... W-19
  24.          PushWindow............................................... W-18
  25.          ReadWindowField.......................................... W-21
  26.          ReadWindowLine........................................... W-24   
  27.          SaveWindow............................................... W-25
  28.          ShutWindow............................................... W-26
  29.          WindowsEnd............................................... W-27
  30.          WindowsInit.............................................. W-28
  31.          WriteWindowField......................................... W-29
  32.          WriteWindowLine.......................................... W-32
  33.       
  34.       
  35.       
  36.       
  37.       
  38.       
  39.       
  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.                                   Page W-1
  68.       
  69.       Introduction to Turbo ScrEdit Windows
  70.       -----------------------------------------------------------------
  71.       Before you can begin using Turbo ScrEdit Window's procedures  and 
  72.       functions, you must compile the source code files "Windows.C" and 
  73.       "Windows.Pas".   If  you  have installed Turbo  ScrEdit  on  your 
  74.       system  correctly  this  has  already  been  done.  For  complete 
  75.       instructions  on how to install Turbo ScrEdit on your system  and 
  76.       prepare  the window procedures for use,  see pages 4 & 5  of  the 
  77.       Turbo  ScrEdit  users  manual, "Creating the  Turbo  Pascal  Unit 
  78.       Files" and "Creating the Turbo C Libraries".
  79.       
  80.       Once you have installed Turbo ScrEdit in you system you are ready 
  81.       to begin using Turbo ScrEdit  and Turbo ScrEdit Windows.
  82.       
  83.       From this point forward, throughout this document, I will   refer 
  84.       to Turbo ScrEdit Windows as "TSW".
  85.       
  86.       TSW  is a set of companion routines  to  Turbo ScrEdit.   You  do 
  87.       not  have  to include the window routines in  your  programs   to  
  88.       use  Turbo  ScrEdit,  but  you do have  to   include   the  Turbo  
  89.       ScrEdit   procedures  in  your program  to  use   Turbo   ScrEdit 
  90.       Windows.  
  91.       
  92.       
  93.       
  94.       
  95.       
  96.       Including Turbo ScrEdit Windows procedures in your programs.
  97.       -----------------------------------------------------------------
  98.       
  99.       Examples:
  100.       Pascal                           C
  101.       -------------------------------   --------------------------------
  102.                                         #include <stdlib.h>
  103.       Uses Windows, ScrMouse, ScrEdit;  #include "ScrEdit.H" 
  104.       -------------------------------   --------------------------------
  105.       
  106.       Pascal example:
  107.       
  108.           In  the  pascal example above we see that  the  "UNIT"  files 
  109.           "Windows.Tpu",  "ScrMouse.Tpu", and "ScrEdit.Tpu"  are  being 
  110.           used in the current program. 
  111.       
  112.       
  113.       C example:
  114.       
  115.           There  is  five  steps required to use TSW  in  a  Turbo  "C" 
  116.           program.
  117.       
  118.           Step 1: In  the C example above we see that the header  files 
  119.                   "ScrEdit.H"  and  "Windows.H" are included  into  the 
  120.                   source file. These file contain the prototypes for  all 
  121.                   of  Turbo ScrEdit's and TSW's procedures  and  global 
  122.                   variables.
  123.       
  124.           Step 2: Decide  which memory model you wish to use  for  your 
  125.                   program, MEDIUM, COMPACT, LARGE, or HUGE.
  126.       
  127.       
  128.       
  129.       
  130.       
  131.       
  132.       
  133.                                     Page W-2
  134.       
  135.       
  136.           Step 3: Prepare  a  project file for your program.  For  this 
  137.                   example  lets  say we are going to create  a  program 
  138.                   called  PAYROLL.C.  Lets  also assume  that  we  have 
  139.                   copied  the Turbo ScrEdit and TSW library files  into 
  140.                   the  library  directory  of  the  Turbo  C   compiler 
  141.                   "C:\TC\LIBRARY."
  142.       
  143.                   For  the  above scenario we would create one  of  the 
  144.                   following  project  files depending on  which  memory 
  145.                   model  we  selected,  and store it in  a  file  named 
  146.                   "PAYROLL.PRJ".
  147.       
  148.                   For MEDIUM memory model:
  149.       
  150.                        PAYROLL
  151.                        C:\TC\LIBRARY\SCREDITM.LIB
  152.                        C:\TC\LIBRARY\WINDOWSM.LIB
  153.       
  154.                   For COMPACT memory model:
  155.       
  156.                        PAYROLL
  157.                        C:\TC\LIBRARY\SCREDITC.LIB
  158.                        C:\TC\LIBRARY\WINDOWSC.LIB
  159.       
  160.                   For LARGE memory model:
  161.       
  162.                        PAYROLL
  163.                        C:\TC\LIBRARY\SCREDITL.LIB
  164.                        C:\TC\LIBRARY\WINDOWSL.LIB
  165.       
  166.                   For HUGE memory model:
  167.       
  168.                        PAYROLL
  169.                        C:\TC\LIBRARY\SCREDITH.LIB
  170.                        C:\TC\LIBRARY\WINDOWSH.LIB
  171.       
  172.           Step 4: Set the Turbo C programming environment menu  options 
  173.                   PROJECT/PROJECT NAME to read "PAYROLL.PRJ".
  174.       
  175.           Step 5: Set the Turbo C programming environment menu  options 
  176.                   OPTIONS/COMPILER/MODEL to read COMPACT (or which ever 
  177.                   memory model that you have selected.)
  178.       
  179.       
  180.           When  the  above five steps are completed, you are  ready  to 
  181.           begin compiling and linking programs using Turbo ScrEdit  and 
  182.           Turbo ScrEdit Windows.
  183.       
  184.       
  185.       
  186.       
  187.       
  188.       
  189.       
  190.       
  191.       
  192.       
  193.       
  194.       
  195.       
  196.       
  197.       
  198.       
  199.                                     Page W-3
  200.       
  201.       Initializing Turbo ScrEdit Windows.. 
  202.       -----------------------------------------------------------------
  203.       Pascal example:
  204.       
  205.           No example is needed, initialization is automatic in pascal.
  206.       
  207.       
  208.       C Examples 1:
  209.            ----------------------------------------------------------
  210.            .
  211.            .
  212.            S_OpenScreenFile("FileName");
  213.            if (!WindowsInit)
  214.               {
  215.               cprintf("%s","Not enough free memory for Window");
  216.               S_CloseScreenFile();
  217.               exit(0);
  218.               }
  219.            .
  220.            .
  221.            ----------------------------------------------------------
  222.       
  223.       
  224.       C Examples 2:
  225.            ----------------------------------------------------------
  226.            .
  227.            .
  228.            S_Init();
  229.            if (!WindowsInit)
  230.               {
  231.               cprintf("%s","Not enough free memory for Window");
  232.               S_CloseScreenFile();
  233.               exit(0);
  234.               }
  235.           .
  236.           .
  237.           -----------------------------------------------------------
  238.           You  will notice in the two examples above that  the  windows 
  239.           initialization  procedure "WindowsInit" is called  after  the 
  240.           call  to "S_OpenScreenFile"  in example 1 and after the  call 
  241.           to "S_Init" in example 2. It is important that Turbo  ScrEdit 
  242.           Windows  be initialized AFTER Turbo ScrEdit  is  initialized. 
  243.           You will find more information on using "WindowsInit" in  the 
  244.           procedure description of this manual.
  245.           
  246.           After   you  have done the above steps, you can then   define  
  247.           as many windows as you wish for use in your programs.
  248.       
  249.       
  250.       
  251.       
  252.       
  253.       
  254.       
  255.       
  256.       
  257.       
  258.       
  259.       
  260.       
  261.       
  262.       
  263.       
  264.       
  265.                                     Page W-4
  266.       
  267.       Memory usage and fragmentation considerations.
  268.       -----------------------------------------------------------------
  269.       TSW  allocates  memory work space on the far heap.  Each  time  a 
  270.       window is defined TSW allocates two blocks of memory large enough 
  271.       to  hold  the window image as well as the screen image  that  has 
  272.       been overlaid by the window image. When windows are defined using 
  273.       "DefineWindow"  the  memory is allocate. When windows  are  erase 
  274.       from memory using "EraseWindow" the memory is re-leased back to the 
  275.       heap  manager. The next time memory is allocated by your  program 
  276.       the  heap  manager will search for a contiguous block  of  memory 
  277.       large  enough to meet the request. This process can small  unused 
  278.       blocks of memory that can lead to memory fragmentation. 
  279.       
  280.       To avoid memory fragmentation and possibly running out of  memory 
  281.       while your program is running,  it is recommended that you define 
  282.       all  the windows that you want to use in your program during  the 
  283.       initialization section of your program. This will have all window 
  284.       memory allocated from the heap in a contiguous block.
  285.       
  286.       This  is a recommendation only. You can define windows  and  erase 
  287.       them  any  way  that  you  wish. But you  can  run  the  risk  of 
  288.       fragmenting  memory  and running out of blocks large  enough  for 
  289.       dynamic allocation of the local variables for your procedures, as 
  290.       well as when you try to define additional windows.
  291.       
  292.       
  293.       
  294.       Additional information about using Turbo ScrEdit Windows
  295.       -----------------------------------------------------------------
  296.       How many windows can you use:
  297.       
  298.          You can define as many windows as will fit in your  computer's 
  299.          memory.  Each  window you define  requires  approximately  120 
  300.          bytes  of data segment memory, with the actual  window  memory 
  301.          being  allocated  from the "heap".   You can set  the  maximum 
  302.          number of windows that will be allowed by setting the value of 
  303.          the global constant MAXWINDOWS. 
  304.       
  305.          
  306.       How TSW uses screen memory:
  307.       
  308.          Imagine  if you will that you could stack transparent  screens 
  309.          one  on top of another up to MAXWINDOWS deep in front of  your 
  310.          video  monitor  screen. The first (or bottom)  screen  of  the 
  311.          stack  would  be your video monitor screen, and the  stack  of 
  312.          transparent screens would be called the "window layer stack".
  313.       
  314.          The  most  important layer of the window layer  stack  is  the 
  315.          surface layer, the one that would physically be furthest  away 
  316.          from your video monitor screen and closest to you. This  layer 
  317.          is called the "active" window layer.
  318.       
  319.          Each time you define a window using TSW, the window is  placed 
  320.          on  top of the window layer stack and any  windows  previously 
  321.          defined  are pushed down a layer, or overlapped by  the  newly 
  322.          defined window.
  323.       
  324.       
  325.       
  326.       
  327.       
  328.       
  329.       
  330.       
  331.                                     Page W-5
  332.       
  333.       Terms Used in this document:
  334.       
  335.          "WINDOW LAYER"  - An imaginary layer on the screen. TSW places 
  336.                            each  window  in  its own  "layer".  No  two  
  337.                            windows may occupy the same window layer.
  338.       
  339.          "WINDOW LAYER STACK"  - A term used to illustrate one or  more 
  340.                            overlapping window layers on a screen.
  341.       
  342.          "ACTIVE WINDOW" - The  active window will be the  open  window 
  343.                            that  occupies  the  surface  layer  of  the 
  344.                            window  stack.  If  you  use  the   "clrscr" 
  345.                            statement   in  your   program  the   active 
  346.                            window   would   have its  contents  erased. 
  347.                            Likewise  using  a   Write  or  WriteLn,  or 
  348.                            cprintf  will display text  in  the   active  
  349.                            window.   When  no  windows   are  displayed  
  350.                            the normal monitor screen is  considered the 
  351.                            active window.
  352.       
  353.          "OPEN WINDOW"   - An  open  window  will  be  visible  on  the 
  354.                            screen, or may be on the screen but  covered 
  355.                            by another window.
  356.       
  357.          "HIDDEN WINDOW" - A  window  that  has been shut  and  is  not 
  358.                            visible on the window.
  359.       
  360.          "WINDOW NUMBER" - The   window  number  is  assigned  by   the 
  361.                            DefineWindow  function.  This number  can be 
  362.                            used  to specify the target window  of  most 
  363.                            of TSW's procedures.
  364.       
  365.          "WINDOW NAME"   - The window name is specified when the window 
  366.                            is  defined and can be used in place of  the 
  367.                            window  number to specify the target  window 
  368.                            of  many of TSW's procedures.  Window   name  
  369.                            is optional in  all  procedure calls  except 
  370.                            Definewindow.
  371.       
  372.       
  373.       Accessing Windows by Name and Number:
  374.       
  375.          Most of TSW's procedures for manipulating windows give you two 
  376.          options  for specifying the target window to be acted upon  by 
  377.          the procedure:
  378.       
  379.          1 - Using the unique number that was returned by  DefineWindow 
  380.              when  you defined the window.  This is the  most  efficient 
  381.              way of referencing a window.
  382.       
  383.          2 - Using  the window name that you specify when you define  a 
  384.              window. When a window name is specified the window  number 
  385.              argument is ignored. This is the least efficient method  of 
  386.              accessing a window because the window list must be  search 
  387.              and  a string comparison made until the target  window  is 
  388.              located.
  389.       
  390.       
  391.       
  392.       
  393.       
  394.       
  395.       
  396.       
  397.                                     Page W-6
  398.       
  399.       
  400.       Global Variables and Constants:
  401.       -----------------------------------------------------------------
  402.       MAXWINDOW
  403.           Function : Sets  the  maximum  number  of  windows  that  any 
  404.                      program  using  the windows "UNIT"  or  "LIRBRARY" 
  405.                      file will be allowed to define.
  406.           Remarks  : MAXWINDOW must be set to a value BEFORE THE SOURCE 
  407.                      FILES "Windows.Pas" or "Windows.C" are compiled.
  408.       
  409.                      MAXWINDOW may be set to  any  value that you wish, 
  410.                      limited  only  by the  amount  of memory  that  is 
  411.                      available in your machine.
  412.       
  413.                      MAXWINDOW  is a constant defined at the  beginning 
  414.                      of     the   source   files   "Windows.Pas"    and 
  415.                      "Windows.C."
  416.       
  417.           Default  : MAXWINDOW  has  a  default value  of  20,  meaning 
  418.                      by  default  a program may have no  more  that  20 
  419.                      active windows at any given time.
  420.       
  421.       
  422.           defined in C:
  423.       
  424.                #define MAXWINDOW 20
  425.       
  426.           defined in Pascal:
  427.       
  428.                Const
  429.                MAXWINDOW = 20;
  430.       
  431.       
  432.       
  433.       
  434.       
  435.       USERWINDOW
  436.       
  437.           Integer : UserWindow will always contain the window number of 
  438.                     the window that is currently the active window. The 
  439.                     active  window  will always be the window  that  is 
  440.                     occupying  the  surface layer of  the  screen.
  441.       
  442.       
  443.       
  444.       
  445.       
  446.       
  447.       
  448.       
  449.       
  450.       
  451.       
  452.       
  453.       
  454.       
  455.       
  456.       
  457.       
  458.       
  459.       
  460.       
  461.       
  462.       
  463.                                     Page W-7
  464.       
  465.       ChangeWindow
  466.       ----------------------------------------------------------------
  467.       Function: Changes an existing window's characteristics that were 
  468.                 assigned when the window was created. 
  469.       
  470.       Remarks: Use  this procedure to re-configure an  existing  window. 
  471.                You  can change any of the visible characteristics.  You 
  472.                cannot change the Row, or Column position of the window. 
  473.                Use  MoveWindow to relocate a window. You cannot  change 
  474.                the  size of a window, that is, the lines in the  window 
  475.                or  the line length. To change a window size,  create  a 
  476.                new window and copy the contents of the existing  window 
  477.                to the new window. 
  478.       
  479.       Defined for Turbo C as:
  480.       
  481.             void ChangeWindow(char *WindowName,
  482.                              int WindowNo,
  483.                              int BorderStyle,
  484.                              int BorderBg,
  485.                              int BorderFg,
  486.                              char *WindowNm,
  487.                              int WindowNameBg,
  488.                              int WindowNameFg,
  489.                              int WindowNamePos,
  490.                              char *WindowFoot,
  491.                              int WindowFootBg,
  492.                              int WindowFootFg,
  493.                              int WindowFootPos,
  494.                              int TextBgColor,
  495.                              int TextFgColor)
  496.       
  497.       
  498.       Defined for Turbo Pascal as:
  499.       
  500.             Procedure ChangeWindow(WindowName : S_Str80;
  501.                                   WindowNo,
  502.                                   BorderStyle,
  503.                                   BorderBg,
  504.                                   BorderFg:Integer;
  505.                                   WindowNm  :S_Str80;
  506.                                   WindowNameBg,
  507.                                   WindowNameFg,
  508.                                   WindowNamePos : Byte;
  509.                                   WindowFoot  :S_Str80;
  510.                                   WindowFootBg,
  511.                                   WindowFootFg,
  512.                                   WindowFootPos,
  513.                                   TextBgColor,
  514.                                   TextFgColor  :Byte);
  515.       
  516.       
  517.       Parameter description:
  518.       
  519.            WindowName...........The current name of the target window.
  520.       
  521.            WindowNo.............The unique number of the target  window 
  522.                                 returned by DefineWindow.
  523.       
  524.                      
  525.                            (continued on next page)
  526.       
  527.       
  528.       
  529.                                     Page W-8
  530.       
  531.       
  532.            BorderStyle..........Border style of window
  533.                                 0 = no border on window.
  534.                                 1 = Bold line character set for border.
  535.                                 2 = use single line character set.
  536.                                 3 = use double line character set.
  537.       
  538.            BorderBg.............Border character background color (0-7)
  539.       
  540.            BorderFg.............Border character foreground color (0-15)
  541.       
  542.            WindowNm.............Window  Name. The window name  has  two 
  543.                                 uses  in TSW. 
  544.                                 1 - The  name will  show as the  window 
  545.                                     label  in  the  top  line   of  the 
  546.                                     border. 
  547.                                 2 - All   window   functions   can   be 
  548.                                     performed  using  the  window  name 
  549.                                     instead of  the window number.  See 
  550.                                     each    window  function   for   an 
  551.                                     explanation.
  552.       
  553.            WindowNameBg.........Window Label background color. (0-7)
  554.       
  555.            WindowNameFg.........Window Label foreground color. (0-15)
  556.       
  557.            WindowNamePos........Window  Label Position in top  line  of 
  558.                                 window border:
  559.                                 0 = No label to show on window.
  560.                                 1 = Place label on left side.
  561.                                 2 = Place label on right side.
  562.                                 3 = Center label.
  563.       
  564.            WindowFoot...........Footer message up to 78 characters long 
  565.                                 that will be in the bottom line of  the 
  566.                                 window border.
  567.       
  568.            WindowFootBg.........Footer message background color.(0-7)
  569.       
  570.            WindowFootFg.........Footer Message foreground color.(0-15)
  571.       
  572.            WindowFootPos........Window  footer position in bottom  line 
  573.                                 of window border:
  574.                                 0 = No footer to show on window.
  575.                                 1 = Place footer on left side.
  576.                                 2 = Place footer on right side.
  577.                                 3 = Center footer.
  578.       
  579.            TextBgColor..........Default  text background color for  all 
  580.                                 characters    written    inside     the 
  581.                                 window.(0-7)
  582.       
  583.            TextFgColor..........Default  text foreground color for  all 
  584.                                 characters    written    inside     the 
  585.                                 window.(0-15)
  586.                  
  587.       
  588.       
  589.       
  590.       
  591.       
  592.       
  593.       
  594.       
  595.                                     Page W-9
  596.       
  597.       
  598.          Pascal                           C                               
  599.          -------------------------------  ------------------------------- 
  600.          .                                .                              
  601.          .                                .                              
  602.       => ChangeWindow(                    ChangeWindow(                   
  603.       =>     '',MenuWindow,                   "",MenuWindow,            
  604.       =>     3,     {Border Sytle}            3,     /* Border Style */ 
  605.       =>     Red,   {Border Bg   }            RED,   /* Border Bg    */ 
  606.       =>     Yellow,{Border Fg   }            YELLOW,/* Border Fg    */ 
  607.              Config.WindowName,               Config.WindowName,        
  608.              Config.WindowNameBg,             Config.WindowNameBg,      
  609.              Config.WindowNameFg,             Config.WindowNameFg,      
  610.              Config.WindowNamePos,            Config.WindowNamePos,     
  611.              Config.WindowFoot,               Config.WindowFoot,        
  612.              Config.WindowFootBg,             Config.WindowFootBg,      
  613.              Config.WindowFootFg,             Config.WindowFootFg,      
  614.              Config.WindowFootPos,            Config.WindowFootPos,     
  615.       =>     Red,    {Text Bg}                RED,    /* Text Bg */     
  616.       =>     Yellow);{Text Fg}                YELLOW);/* Text Fg */       
  617.          .                                .                              
  618.          .                                .                              
  619.          -------------------------------  ------------------------------- 
  620.          In this example we are going to temporarily change the  border 
  621.          style and color, and the window text colors. 
  622.       
  623.          In  this  example we are accessing the window  by  the  window 
  624.          number assigned to the integer field "MenuWindow" when it  was 
  625.          defined. See the description of "DefineWindow" for an  example 
  626.          of how the field "MenuWindow" received it's value.
  627.                                                                           
  628.          The  changes made to this window are temporary, at some  other 
  629.          point  in the program another call to ChangeWindow    will  be 
  630.          issued using the original parameters in the "Config"   record.
  631.       
  632.       
  633.       
  634.       
  635.       
  636.       ChgWindowBackGround
  637.       -----------------------------------------------------------------
  638.       Function : Changes screen background while windows are visible.
  639.       
  640.       Remarks  : Use this procedure to change the main screen background
  641.                  while windows are open and displayed on the screen. The
  642.                  old screen is completely replaced, including the screen
  643.                  segments that are saved and replaced when each window
  644.                  is opened and closed.
  645.       
  646.                  Keep in mind that you must make sure that the memory to
  647.                  be sent to video memory has been  formatted properly in
  648.                  character and video attribute pairs.
  649.       
  650.                  If  no windows are open and displayed this  call  will 
  651.                  have  no  effect.  The  screen  loaded  will  not   be 
  652.                  displayed,  and  will  be  overlaid  by  the  current 
  653.                  screens image when the next window is opened.
  654.       
  655.       
  656.       
  657.       
  658.       
  659.       
  660.       
  661.                                     Page W-10
  662.          
  663.       Defined for Turbo C as:
  664.       
  665.            void ChgWindowBackGround(char *Sc,
  666.                                     int Length)
  667.       
  668.       Defined for Turbo Pascal as:
  669.       
  670.            Procedure ChgWindowBackGround(NS_Seg,
  671.                                          NS_Ofs,
  672.                                          Length:LongInt);
  673.       
  674.       
  675.       Parameter description:
  676.       
  677.            *Sc (C)..............Pointer to memory containing screen image.
  678.       
  679.            NS_Seg (Pascal)......The memory segment of the new screen
  680.                                 area.
  681.       
  682.            NS_Ofs (Pascal)......The memory offset of the new screen area.
  683.       
  684.            Length...............The number of bytes to be transferred.
  685.       
  686.       
  687.          Pascal                           C
  688.          -------------------------------  -------------------------------
  689.          .                                .
  690.          .                                .
  691.          If  S_F1 Then                    if  (S_F1)
  692.              Begin                          {
  693.              Seek(HFile,Screen7);           fseek(HFile,(Size*7),SEEK_SET
  694.              Read(HFile,HelpRec);           fread(HelpRec,4000L,1,HFile);
  695.       ==>    ChgWindowBackGround(           ChgWindowBackGround(
  696.                 Seg(HelpRec.V[1]),               &HelpRec.V[0],
  697.                 Ofs(HelpRec.V[1]),               4000L);
  698.                 4000);                        }
  699.              End;
  700.          .                                .
  701.          .                                .
  702.          -------------------------------  -------------------------------
  703.          When  the user presses the F1 key In the above  code  segment, 
  704.          the  program will retrieve record 7 from the file assigned  to 
  705.          "FFile" and read the record into the buffer "HelpRec". 
  706.       
  707.          Next  the  call  to  the  procedure  "ChgWindowBackGround"  is 
  708.          passing  the  memory  address of the first  character  in  the 
  709.          record.  When this procedure is called it will cause  the  new 
  710.          screen to appear behind any windows that are open and  visible 
  711.          on the screen.
  712.       
  713.       
  714.       
  715.       
  716.       
  717.       
  718.       
  719.       
  720.       
  721.       
  722.       
  723.       
  724.       
  725.       
  726.       
  727.                                     Page W-11
  728.       
  729.       ClearWindow
  730.       -----------------------------------------------------------------
  731.       Function : Clears  all lines of the specified window and set  the 
  732.                  window text back ground color and foreground colors.
  733.       
  734.       Remarks  : This  function erase all data from all the text  lines 
  735.                  of  a windows and sets the foreground  and  background 
  736.                  color  attributes  of  the  window  to  the  specified 
  737.                  colors. This procedure will clear any window that  has 
  738.                  been defined, ever if the target window is hidden (not 
  739.                  visible  on  the screen), or partially  or  completely 
  740.                  overlapped by another window.
  741.       
  742.                  The   call  has no effect if the window  specified  by 
  743.                  WindowName or WindowNumber  has  not been defined.
  744.       
  745.       Defined for Turbo C as:
  746.            void ClearWindow(char *WindowName,
  747.                              int WindowNo,
  748.                              int OverRideBg,
  749.                              int OverRideFg)
  750.       
  751.       Defined for Turbo Pascal as:
  752.            Procedure ClearWindow(WindowName:S_Str80;
  753.                                  WindowNo,
  754.                                  OverRideBg,
  755.                                  OverRideFg  :Byte);
  756.       
  757.       Parameter description:
  758.       
  759.            WindowName...........The name of the target window that  was 
  760.                                 assigned when the window was defined.
  761.       
  762.            WindowNo.............The unique number of the target  window 
  763.                                 returned by DefineWindow.
  764.       
  765.            OverRideBg...........Overrides the normal text  background 
  766.                                 color  specified  when the  window  was 
  767.                                 defined. A value of zero will not over-
  768.                                 ride TextBg.
  769.       
  770.            OverRideFg...........Overrides the normal text  foreground 
  771.                                 color  specified  when the  window  was 
  772.                                 defined. A value of zero will not over-
  773.                                 ride TextFg.
  774.       
  775.          Pascal                           C                              
  776.          -------------------------------  -------------------------------
  777.          .                                .
  778.          .                                .
  779.       => ClearWindow('',ResultWindow);    ClearWindow("",ResultWindow);  
  780.          LoadResultWindow;                LoadResultWindow();
  781.          OpenWindow('',ResultWindow);     OpenWindow("",ResultWindow);
  782.          .                                .
  783.          .                                .
  784.          -------------------------------  -------------------------------
  785.          In the above example a window has been defined to present  the 
  786.          results of some process performed by the program.  The  Window 
  787.          is cleared by a call to ClearWindow before the text is  loaded 
  788.          into it and it is opened for viewing.
  789.       
  790.       
  791.       
  792.       
  793.                                     Page W-12
  794.       
  795.       DefineWindow
  796.       ----------------------------------------------------------------
  797.       Function: Builds  a  window  record in memory  and  allocates  the 
  798.                 memory  required  to  store the window  and  the  screen 
  799.                 memory  that  is  covered  by  the  window  when  it  is 
  800.                 displayed on the screen.
  801.       
  802.       Return Value:
  803.       
  804.            0 - If   DefineWindow  was  unable  to  create  the   window 
  805.                successfully. There are two possible reasons:
  806.                   - insufficient memory (heap)
  807.                   - there are already MAXWINDOWS windows defined.
  808.       
  809.           >0 - Is the window number that has been assigned. You can Use 
  810.                this  number to refer to the window when  calling  other 
  811.                Turbo Window operations on this window.
  812.       
  813.       
  814.       Remarks: Windows are created when they are defined. When a window 
  815.                is  defined it is given a status of "HIDDEN".  You  must 
  816.                use OpenWindow to display the new window on the screen.
  817.       
  818.       Defined for Turbo C as:
  819.             int DefineWindow(int WindowRow,
  820.                              int WindowCol,
  821.                              int WindowLength,
  822.                              int WindowLines,
  823.                              int BorderStyle,
  824.                              int BorderBg,
  825.                              int BorderFg,
  826.                              char *WindowName,
  827.                              int WindowNameBg,
  828.                              int WindowNameFg,
  829.                              int WindowNamePos,
  830.                              char *WindowFoot,
  831.                              int WindowFootBg,
  832.                              int WindowFootFg,
  833.                              int WindowFootPos,
  834.                              int TextBgColor,
  835.                              int TextFgColor)
  836.       
  837.       Defined for Turbo Pascal as:
  838.             Function DefineWindow(WindowRow,
  839.                                   WindowCol,
  840.                                   WindowLength,
  841.                                   WindowLines,
  842.                                   BorderStyle,
  843.                                   BorderBg,
  844.                                   BorderFg:Integer;
  845.                                   WindowName  :S_Str80;
  846.                                   WindowNameBg,
  847.                                   WindowNameFg,
  848.                                   WindowNamePos : Byte;
  849.                                   WindowFoot  :S_Str80;
  850.                                   WindowFootBg,
  851.                                   WindowFootFg,
  852.                                   WindowFootPos,
  853.                                   TextBgColor,
  854.                                   TextFgColor  :Byte):Integer;
  855.       
  856.       
  857.       
  858.       
  859.                                     Page W-13
  860.       
  861.       Parameter description:
  862.            WindowRow............The  screen  row (1-23) where  the  top 
  863.                                 left  corner  of  the  window  will  be 
  864.                                 placed.
  865.       
  866.            WindowCol............The screen column (1-77) where the  top 
  867.                                 left  corner  of  the  window  will  be 
  868.                                 placed.
  869.       
  870.            WindowLength.........The  length in characters (1-77)  of  a 
  871.                                 window line. 
  872.                                 If WindowLength + WindowCol exceeds  80 
  873.                                 characters then WindowLength is reduced 
  874.                                 to 78 - WindowCol;
  875.       
  876.            WindowLines..........The number of text lines (1-22)  inside 
  877.                                 the window.
  878.                                 If  WindowLines + WindowRow exceeds  24 
  879.                                 then  WindowLines  is reduced to  22  - 
  880.                                 WindowRow.
  881.       
  882.            BorderStyle..........Border style of window
  883.                                 0 = no border on window.
  884.                                 1 = bold line character set.
  885.                                 2 = use single line character set.
  886.                                 3 = use double line character set.
  887.       
  888.            BorderBg.............Border character background color (0-7)
  889.       
  890.            BorderFg.............Border character foreground color (0-15)
  891.       
  892.            WindowName...........Window  Name. The window name  has  two 
  893.                                 uses  in TSW. First the name will  show 
  894.                                 as the window label in the top line  of 
  895.                                 the border. All window functions can be 
  896.                                 performed using the window name instead 
  897.                                 of  the window number. See each  window 
  898.                                 function for an explanation.
  899.       
  900.            WindowNameBg.........Window Label background color. (0-7)
  901.       
  902.            WindowNameFg.........Window Label foreground color. (0-15)
  903.       
  904.            WindowNamePos........Window  Label Position in top  line  of 
  905.                                 window border:
  906.                                 0 = No label to show on window.
  907.                                 1 = Place label on left side.
  908.                                 2 = Place label on right side.
  909.                                 3 = Center label.
  910.       
  911.            WindowFoot...........Footer message up to 78 characters long 
  912.                                 that will be in the bottom line of  the 
  913.                                 window border.
  914.       
  915.            WindowFootBg.........Footer message background color.(0-7)
  916.       
  917.            WindowFootFg.........Footer Message foreground color.(0-15)
  918.       
  919.       
  920.       
  921.       
  922.       
  923.       
  924.       
  925.                                     Page W-14
  926.       
  927.            WindowFootPos........Window  footer position in bottom  line 
  928.                                 of window border:
  929.                                 0 = No footer to show on window.
  930.                                 1 = Place footer on left side.
  931.                                 2 = Place footer on right side.
  932.                                 3 = Center footer.
  933.       
  934.            TextBgColor..........Default  text background color for  all 
  935.                                 characters    written    inside     the 
  936.                                 window.(0-7)
  937.       
  938.            TextFgColor..........Default  text foreground color for  all 
  939.                                 characters    written    inside     the 
  940.                                 window.(0-15)
  941.       
  942.       Memory requirements:
  943.       
  944.            To  calculate bytes of heap memory usage use  the  following 
  945.            formula:
  946.                 ((((WindowLines + 2) * (WindowLength + 2)) * 2) * 2)
  947.       
  948.            To  calculate data segment memory usage:
  949.                 MemoryNeeded = MAXWINDOWS * 120;
  950.       
  951.       
  952.          Pascal                           C
  953.          -------------------------------  -------------------------------
  954.          .                                .
  955.          Var                              .
  956.       =>   MenuWindow : Integer;          int MenuWindow;
  957.          .                                .
  958.          .                                .
  959.       => MenuWindow :=                    MenuWindow =
  960.       =>    DefineWindow(                    DefineWindow(
  961.                Config.WindowRow,                Config.WindowRow,
  962.                Config.WindowCol,                Config.WindowCol,
  963.                Config.WindowLength,             Config.WindowLength,
  964.                Config.WindowLines,              Config.WindowLines,
  965.                Config.BorderStyle,              Config.BorderStyle,
  966.                Config.BorderBg,                 Config.BorderBg,
  967.                Config.BorderFg,                 Config.BorderFg,
  968.                Config.WindowName,               Config.WindowName,
  969.                Config.WindowNameBg,             Config.WindowNameBg,
  970.                Config.WindowNameFg,             Config.WindowNameFg,
  971.                Config.WindowNamePos,            Config.WindowNamePos,
  972.                Config.WindowFoot,               Config.WindowFoot,
  973.                Config.WindowFootBg,             Config.WindowFootBg,
  974.                Config.WindowFootFg,             Config.WindowFootFg,
  975.                Config.WindowFootPos,            Config.WindowFootPos,
  976.                Config.TextBg,                   Config.TextBg,
  977.                Config.TextFg);                  Config.TextFg);
  978.          .                                .
  979.          .                                .
  980.          -------------------------------  -------------------------------
  981.          In the above example we see an integer variable MenuWindow  is 
  982.          defined. 
  983.       
  984.          Next  we  set  a  call to  DefineWindow.  The  parameters  for 
  985.          defining  the window have been stored in a configuration  file 
  986.          and are fields in a record name "Config". 
  987.       
  988.       
  989.       
  990.       
  991.                                     Page W-15
  992.       
  993.          As a result of the call to DefineWindow, the field  MenuWindow 
  994.          is  being  assigned  a value. The integer  value  assigned  to 
  995.          MenuWindow  will  be  use  to access the  new  window  in  all 
  996.          subsequent calls to other TSW window routines.
  997.       
  998.       
  999.       
  1000.       
  1001.       EraseWindow
  1002.       -----------------------------------------------------------------
  1003.       Function: De-allocates  a window and returns the memory  allocated 
  1004.                 by DefineWindow back to the heap. All references to the 
  1005.                 window are erased from memory.
  1006.       
  1007.       Defined for Turbo C as:
  1008.             void EraseWindow(char *WindowName,int WindowNo)
  1009.       
  1010.       Defined for Turbo Pascal as:
  1011.             Procedure EraseWindow(WindowName:S_Str80;WindowNo:Integer);
  1012.       
  1013.       Parameter description:
  1014.            WindowName...........The name of the target window.
  1015.       
  1016.            WindowNo.............The unique number of the target  window 
  1017.                                 returned by DefineWindow.
  1018.       
  1019.          Pascal                           C
  1020.          -------------------------------  -------------------------------
  1021.          .                                .
  1022.          .                                .
  1023.          CloseDataFiles;                  CloseDataFiles();
  1024.          For X := 1 to 7                  for (x=1;x<8;x++)
  1025.       =>     EraseWindow('',X);               EraseWindow("",x);
  1026.          .                                .
  1027.          .                                .
  1028.          -------------------------------  -------------------------------
  1029.          In the above example three program is absolute to end and  perhaps 
  1030.          return  to the system menu. The program is closing  it's  data 
  1031.          files,  and  releasing the heap memory allocated  for  windows 
  1032.          back to the "heap manager".
  1033.       
  1034.       
  1035.       
  1036.       
  1037.       MoveWindow
  1038.       ----------------------------------------------------------------
  1039.       Function : Moves the specified window to a new screen location.
  1040.       
  1041.       Defined for Turbo C as:
  1042.           void MoveWindow(char *WindowName,
  1043.                           int  WindowNo,
  1044.                           int  RowMovement,
  1045.                           int  ColMovement,
  1046.                           char Tipe)
  1047.       
  1048.       Defined for Turbo Pascal as:
  1049.           Procedure MoveWindow(WindowName:S_Str80;
  1050.                                WindowNo,
  1051.                                RowMovement,
  1052.                                ColMovement : Integer;
  1053.                                Tipe        : Char);
  1054.       
  1055.       
  1056.       
  1057.                                     Page W-16
  1058.       
  1059.       Parameter description:
  1060.            WindowName...........The name of the target window.
  1061.       
  1062.            WindowNo.............The unique number of the target  window 
  1063.                                 returned by DefineWindow.
  1064.       
  1065.            RowMovement..........Depending   on   the  value   of   Tipe 
  1066.                                 RowMovement is either a new screen  row 
  1067.                                 for the window or the number of rows to 
  1068.                                 move the window.
  1069.       
  1070.            ColMovement..........Depending   on   the  value   of   Tipe 
  1071.                                 ColMovement is either a new screen  row 
  1072.                                 column or the number of columns to move 
  1073.                                 the window.
  1074.       
  1075.            Tipe.................Specifies how the window is to be moved
  1076.                                 where:
  1077.       
  1078.                                 A = RowMovement and ColMovement are the 
  1079.                                     absolute screen coordinates for the 
  1080.                                     new  location  of  the  top   right 
  1081.                                     corner of the widow.
  1082.                                
  1083.                                 R = RowMovement  and  ColMovement   are
  1084.                                     relative coordinates to be added to 
  1085.                                     the current row and column and  the 
  1086.                                     window  is to be move  relative  to
  1087.                                     the new calculated row and  column. 
  1088.                                     (Use this option to DRAG windows on 
  1089.                                     the screen).    
  1090.       
  1091.          Pascal                           C
  1092.          -------------------------------  -------------------------------
  1093.          .                                .
  1094.          .                                .
  1095.       => MoveWindow('',4,1,50,'a');    MoveWindow("",4,1,50,'a');
  1096.          OpenWindow('',4);                OpenWindow('',4);
  1097.          Row := 1;                        Row = 1;
  1098.          Col := -3;                       Col = -3;
  1099.          For X := 1 to 17 Do              for (X=1;X<18;X++)
  1100.       =>   MoveWindow("",4,                 MoveWindow("",4,
  1101.                       Row,Col,'r');                    Row,Col,'r'); 
  1102.          .                                .
  1103.          .                                .
  1104.          -------------------------------  -------------------------------
  1105.          This  example  demonstrates how to "drag" a  window  from  one 
  1106.          location  on  the  screen to another. 
  1107.       
  1108.          First  MoveWindow statement performed will move the window  to 
  1109.          the  absolute screen coordinates of row 1 and column  50.  The 
  1110.          window  is  then opened, or made visible, in the  upper  right 
  1111.          hand corner of the screen.
  1112.       
  1113.          Next  a  loop is performed 17 times. Each time  MoveWindow  is 
  1114.          performed  with a row value of 1, a column value of -3, and  a 
  1115.          "R"  or relative option . Each time MoveWindow is  called  the 
  1116.          window move down one row and left three columns on the screen. 
  1117.          The effect to the user of the program would be that the window 
  1118.          smoothly slides across the screen. 
  1119.       
  1120.       
  1121.       
  1122.       
  1123.                                     Page W-17
  1124.       
  1125.       OpenWindow
  1126.       -----------------------------------------------------------------
  1127.       Function: Makes a window visible on the screen.
  1128.       
  1129.       Remarks:  This call is ignored if the specified window   has  not 
  1130.                 been defined, or if the window is already open.
  1131.       
  1132.       Defined for Turbo C as:
  1133.       
  1134.             void OpenWindow(char *WindowName,int WindowNo)
  1135.       
  1136.       Defined for Turbo Pascal as:
  1137.       
  1138.             Procedure OpenWindow(WindowName:S_Str80;WindowNo:Integer);
  1139.       
  1140.       Parameter description:
  1141.       
  1142.            WindowName...........The name of the target window.
  1143.       
  1144.            WindowNo.............The unique number of the target  window 
  1145.                                 returned by DefineWindow.
  1146.       
  1147.          Pascal                           C
  1148.          -------------------------------  -------------------------------
  1149.          Var MenuWindow : Integer;        int MenuWindow;
  1150.          :                                :
  1151.          MenuWindow := DefineWindow(      MenuWindow = DefineWindow(
  1152.          :                                :
  1153.       => OpenWindow('',MenuWindow)        OpenWindow("",MenuWindow);     
  1154.          :                                :
  1155.          -------------------------------  -------------------------------
  1156.          In  the above example an integer variable name  MenuWindow  is 
  1157.          defined  at the beginning of a program. Later in  the  program 
  1158.          MenuWindow is assigned a value when the window is defined.
  1159.       
  1160.          Finally  the  window is opened for use and  displayed  on  the 
  1161.          screen.
  1162.       
  1163.       
  1164.       PopWindow
  1165.       -----------------------------------------------------------------
  1166.       Function: Pops  the specified window from its current position in 
  1167.                 the   window  layer stack to the top or surface   layer  
  1168.                 of  the screen stack.
  1169.       
  1170.       Remarks:  If  the  specified  window is open  (displayed  on  the 
  1171.                 screen),  it  is established as  the  "current  active" 
  1172.                 window.  All  windows  displayed  on  the  screen  that 
  1173.                 occupied  a  window layer above the popped  window  are 
  1174.                 pushed down in the window stack.
  1175.       
  1176.                 If  the specified window is hidden (not visible on  the 
  1177.                 screen),  it  is  popped to  the  surface  but  remains 
  1178.                 invisible. The current active screen before the  window 
  1179.                 is  popped remains the active window until  the  popped 
  1180.                 window is opened using OpenWindow.
  1181.       
  1182.                 If  the specified window has not been defined by  using 
  1183.                 DefineWindow the call is ignored.
  1184.       
  1185.       
  1186.       
  1187.       
  1188.       
  1189.                                     Page W-18
  1190.       
  1191.       Defined for Turbo C as:
  1192.       
  1193.             void PopWindow(char *WindowName,int WindowNo)
  1194.       
  1195.       Defined for Turbo Pascal as:
  1196.       
  1197.             Procedure PopWindow(WindowName:S_Str80;WindowNo:Integer);
  1198.       
  1199.       Parameter description:
  1200.            WindowName...........The name of the target window.
  1201.       
  1202.            WindowNo.............The unique number of the target  window 
  1203.                                 returned by DefineWindow.
  1204.       
  1205.          Pascal                           C
  1206.          -------------------------------  -------------------------------
  1207.          .                                .
  1208.          .                                .
  1209.          OpenWindow('',4);                OpenWindow("",4);
  1210.       => PopWindow('',4);                 PopWindow("",4);
  1211.          .                                .
  1212.          .                                .
  1213.          -------------------------------  -------------------------------
  1214.          Window number 4 is opened or made visible on the screen. It is 
  1215.          then "popped" to the surface layer of the screen.
  1216.       
  1217.       
  1218.       
  1219.       
  1220.       PushWindow
  1221.       -----------------------------------------------------------------
  1222.       Function: Moves  the target window from one layer of  the  window 
  1223.                 layer stack to another.
  1224.       
  1225.       Remarks:  Both  the  FromWindow  and  the  window  occupying  the 
  1226.                 ToLayer must be defined before this call is  performed. 
  1227.                 Either of the windows specified may be hidden.
  1228.       
  1229.                 If  the  FromWindow  is deeper in the  stack  than  the 
  1230.                 ToLayer,  all  windows above the FromWindow up  to  and 
  1231.                 including the ToLayer are pushed down in the stack  and 
  1232.                 the FromWindow is placed in the ToLayer.
  1233.       
  1234.                 If  the FromWindow is above the ToLayer in  the  stack, 
  1235.                 all  windows  from the ToLayer to  the  FromWindow  are 
  1236.                 pushed up in the window layer stack and the  FromWindow 
  1237.                 is inserted in the vacant ToLayer.
  1238.       
  1239.                 After  the push occurs the open window closest  to  the 
  1240.                 surface  layer  of  the stack will  become  the  active 
  1241.                 window.
  1242.       
  1243.       
  1244.       Defined for Turbo C as:
  1245.       
  1246.             void PushWindow(char *WindowName,
  1247.                             int FromWindow,
  1248.                             int ToLayer);
  1249.       
  1250.       
  1251.       
  1252.       
  1253.       
  1254.       
  1255.                                     Page W-19
  1256.       
  1257.       Defined for Turbo Pascal as:
  1258.       
  1259.             Procedure PushWindow(WindowName:S_Str80;
  1260.                                  FromWindow:Integer,
  1261.                                  ToLayer:Integer);
  1262.       
  1263.       
  1264.       Parameter description:
  1265.            WindowName...........The  name  of the target window  to  be 
  1266.                                 moved.
  1267.       
  1268.            FromWindow...........The  unique number of the window to  be 
  1269.                                 moved.
  1270.       
  1271.            ToLayer..............The Physical window layer that you wish 
  1272.                                 to place the FromWindow in.
  1273.       
  1274.          Pascal                           C
  1275.          -------------------------------  -------------------------------
  1276.          .                                .
  1277.          .                                .
  1278.          OpenWindow('',1);                OpenWindow("",1);
  1279.          OpenWindow('',2);                OpenWindow("",2);
  1280.          OpenWindow('',3);                OpenWindow("",3);
  1281.       => PushWindow('',3,1);              PushWindow("",3,1);
  1282.          .                                .
  1283.          .                                .
  1284.          -------------------------------  -------------------------------
  1285.          In this example windows 1, 2, and 3 are opened on the  screen. 
  1286.          Window 3 is then pushed to layer 1 of the window stack. On the 
  1287.          screen  window  three would move from being fully  visible  to 
  1288.          begin overlaid by windows 1 and two.
  1289.       
  1290.       
  1291.       
  1292.       PauseWindowUpdates
  1293.       -----------------------------------------------------------------
  1294.       Function : Pauses or Resumes video memory updates. 
  1295.       
  1296.       Remarks  : Proper use of this procedure will greatly enhance  the 
  1297.                  efficiency of programs using TSW.
  1298.       
  1299.                  I/O  to the video screen can be the slowest  operation 
  1300.                  performed  by  TSW.  Normally  the  results  of   each 
  1301.                  operation that you perform on a window becomes visible 
  1302.                  immediately   on  the  screen.  For  example,  in   an 
  1303.                  application where you were going to close two  windows 
  1304.                  and  open one, you would be able to detect  the  first 
  1305.                  window as it disappeared, then the second window, then 
  1306.                  the  new window would appear. Even though the  changes 
  1307.                  happen very quickly, you would see all three steps.
  1308.       
  1309.                  Calling  PauseWindowUpdates with an argument  of  TRUE 
  1310.                  before  you began updating the screen would allow  TSW 
  1311.                  to  perform  the three steps quickly  in  memory.  The 
  1312.                  results of closing two windows and opening one  would 
  1313.                  not  appear  on  the video  memory  until  you  called 
  1314.                  PauseWindowUpdates  again with an argument  of  FALSE. 
  1315.                  Then the updated screen would appear. TSW only updated 
  1316.                  video  memory once, and from the  user's  perspective, 
  1317.                  the video screen changed instantly.
  1318.       
  1319.       
  1320.       
  1321.                                     Page W-20
  1322.       
  1323.       Defined for Turbo C as:
  1324.       
  1325.            void PauseWindowUpdates(unsigned char Switch);
  1326.       
  1327.       Defined for Turbo Pascal as:
  1328.       
  1329.            Procedure PauseWindowUpdates(Switch:Boolean);
  1330.       
  1331.       Parameter description:
  1332.       
  1333.            Switch.......In pascal the switch is a boolean variable with 
  1334.                         the values:
  1335.                                    TRUE  = Pause video memory updates
  1336.                                    FALSE = Resume video memory updates.
  1337.                         In  C  is the switch is an  unsigned  character 
  1338.                         variable with the values:
  1339.                                    1     = Pause video memory updates
  1340.                                    0     = Resume video memory updates.
  1341.       
  1342.       
  1343.       
  1344.          Pascal                           C
  1345.          -------------------------------  -------------------------------
  1346.          .                                .
  1347.          .                                .
  1348.       => PauseWindowUpdates(True);        PauseWindowUpdates(1);
  1349.       
  1350.          For X := 1 to 14 do               for (X=1;X<15;X++)
  1351.            WriteWindowLine("",5,            WriteWindowLine("",5,
  1352.                            X,W_Off,0,                       X,W_Off,0,
  1353.                            0,0,                             0,0,
  1354.                            Msg_5[X+8]);                     Msg_5[X+8]);
  1355.       
  1356.       => PauseWindowUpdates(False);       PauseWindowUpdates(0);
  1357.          .                                .
  1358.          .                                .
  1359.          -------------------------------  -------------------------------
  1360.          In  this example 15 lines of text are to be written to  Window 
  1361.          number  5.  Normally each time a line of text is  written  TSW 
  1362.          wants to update the screen memory and the user would see  each 
  1363.          line appear one after the other.
  1364.       
  1365.          The  first  call to PauseWindowUpdates with  a  TRUE  argument 
  1366.          instructs TSW to postpone screen updates until further notice.
  1367.       
  1368.          The  15  lines of text  are then written much  faster  to  the 
  1369.          memory image of the window.
  1370.       -
  1371.          The  second call to PauseWindowUpdates with a  FALSE  argument 
  1372.          instructs TSW to update the screen with the current screen and 
  1373.          window status and resume immediate screen updates.
  1374.       
  1375.          Using PauseWindowUpdates will make the entire process seem  to 
  1376.          have happened instantly.
  1377.        
  1378.       
  1379.       
  1380.       
  1381.       
  1382.       
  1383.       
  1384.       
  1385.       
  1386.       
  1387.                                     Page W-21
  1388.       
  1389.       ReadWindowField
  1390.       ----------------------------------------------------------------
  1391.       Function: Accepts a string of characters into a user defined data 
  1392.                 entry field in the current or active window.
  1393.       
  1394.       Remarks:  If  the  specified  window is not  the  current  active 
  1395.                 window,  it is popped before data the data entry  field 
  1396.                 is displayed on the screen. See "POPWINDOW".
  1397.       
  1398.                 Field editing has all the characteristics of any  field 
  1399.                 of a Turbo ScrEdit data entry screens.
  1400.        
  1401.       Defined for Turbo C as:
  1402.       
  1403.            char *ReadWindowField(char *WindowName,
  1404.                                  int WindowNo,
  1405.                                  int WindowRow,
  1406.                                  int WindowCol,
  1407.                                  int DataType,
  1408.                                  int DataLength,
  1409.                                  int PromptBgColor,
  1410.                                  int PromptFgColor,
  1411.                                  char *CharString)
  1412.       
  1413.       Defined for Turbo Pascal as:
  1414.       
  1415.           Procedure ReadWindowField(WindowName:S_Str80;
  1416.                                      WindowNo,
  1417.                                      WindowRow,
  1418.                                      WindowCol,
  1419.                                      DataType,
  1420.                                      DataLength,
  1421.                                      PromptBgColor,
  1422.                                      PromptFgColor:Integer;
  1423.                                      Var CharString   :S_Str80);
  1424.       
  1425.       Parameter description:
  1426.       
  1427.            WindowName...........The name of the target window.
  1428.       
  1429.            WindowNo.............The unique number of the target  window 
  1430.                                 returned by DefineWindow.
  1431.       
  1432.            WindowRow............The window line to be written to.
  1433.       
  1434.            WindowCol............The  column (-1) on the row  where  the 
  1435.                                 data entry field is to begin.  Remember 
  1436.                                 Turbo ScrEdit adds one character to the 
  1437.                                 beginning and ending of fields.
  1438.       
  1439.            DataType.............Specifies  the type of keystrokes  that 
  1440.                                 will  be accepted into the  data  entry 
  1441.                                 field.
  1442.       
  1443.                                 0     = Integer value.
  1444.                                 2 - 7 = decimal  values  with  absolute 
  1445.                                         decimal position in string being 
  1446.                                         at DataType.
  1447.                                 8     = alphabetical key and space only.
  1448.                                 9     = any keyboard character.
  1449.       
  1450.       
  1451.       
  1452.       
  1453.                                     Page W-22
  1454.       
  1455.       
  1456.            DataLength...........The length of the field.
  1457.       
  1458.                                 ** NOTE ** if the length of the  field 
  1459.                                 will exceed the length of  the  window 
  1460.                                 line, the field length is adjusted to:
  1461.       
  1462.                                 (Length of Window Line) - (WindowCol) - 1;
  1463.       
  1464.            PromptBgColor........The background color attribute for  the 
  1465.                                 data entry field.
  1466.       
  1467.            PromptFgColor........The foreground color attribute for  the 
  1468.                                 data entry field.
  1469.       
  1470.            CharString...........Is  a  pointer  to  a  string  variable 
  1471.                                 containing  the  current value  of  the 
  1472.                                 data entry field.
  1473.       
  1474.                                 On exiting this procedure the  variable 
  1475.                                 pointed  to by CharString will  contain 
  1476.                                 the new or edited string value.
  1477.       
  1478.          Pascal
  1479.          -------------------------------------------------------------
  1480.          :
  1481.          Var
  1482.       => Response : S_Str80;
  1483.          : 
  1484.          Repeat
  1485.            Case Y Of
  1486.              1 :Begin
  1487.       =>        Response     := Employe.Name;
  1488.       =>        ReadWindowField ('',NameWindow,5,21,8,30,7,0,Response);
  1489.                 Employe.Name := Response;
  1490.                 End;
  1491.              2 :Begin
  1492.                 Response        := Employe.Address;
  1493.       =>        ReadWindowField ('',NameWindow,6,21,0,30,7,0,Response);
  1494.                 Employe.Address := Response;
  1495.                 End;
  1496.              3 :Begin
  1497.                 Response               := Employe.City_State_Zip;
  1498.       =>        ReadWindowField ('',NameWindow,7,21,0,30,7,0,Response);
  1499.                 Employe.City_State_Zip := Response;
  1500.                 End;
  1501.              End;
  1502.            If  S_Tab Then If  S_Shift Then Dec(Y) else Inc(Y);
  1503.            If  Y>3 Then Y := 1;
  1504.            If  Y<1 Then Y := 3;
  1505.          Until S_Enter;
  1506.          :
  1507.          -----------------------------------------------------------  
  1508.          In  Pascal the field "Response" is defined as  type  "S_Str80" 
  1509.          and  is used as a work field for passing a field value to  and 
  1510.          from ReadWindowField for editing. (S_Str80 is defined in Turbo 
  1511.          ScrEdit.).
  1512.          
  1513.          See  the  description  following the  C  example  for  further 
  1514.          discussion of this procedure.
  1515.       
  1516.       
  1517.       
  1518.       
  1519.                                     Page W-23
  1520.          C
  1521.          -----------------------------------------------------------       
  1522.       => char Response[81];
  1523.          :
  1524.          do{
  1525.            switch (Y)
  1526.              {
  1527.              case 1 :{
  1528.       =>        strcpy(Response,Employe.Name);
  1529.       =>        ReadWindowField ("",NameWindow,5,21,8,8,7,0,Response);
  1530.                 strcpy(Employe.Name,Response[0]);
  1531.                 break;
  1532.                 };
  1533.              case 2 :{
  1534.                 strcpy(Response,Employe.Address);
  1535.       =>        ReadWindowField ("",NameWindow,6,21,0,8,7,0,Response);
  1536.                 strcpy(Employe.Address,Response);
  1537.                 break;
  1538.                 };
  1539.              case 3 :{
  1540.                 strcpy(Response,Employe.City_State_Zip);
  1541.       =>        ReadWindowField ("",NameWindow,7,21,0,8,7,0,Response);
  1542.                 strcpy(Employe.City_State_Zip,Response);
  1543.                 break;
  1544.                 };
  1545.              }
  1546.            if (S_Tab) if (S_Shift) Y--; else Y++;
  1547.            if (Y>3) Y = 1;
  1548.            if (Y<1) Y = 3;
  1549.          }while (!S_Enter);
  1550.          ----------------------------------------------------------------
  1551.          In  C   the field "Response" is defined as an  eighty  element 
  1552.          array of type char. This field is to be used as the work field 
  1553.          for value passed a field value to and from ReadWindowField for 
  1554.          editing. 
  1555.       
  1556.          In  this  code segment we see a do/while and  a  Repeat/Until 
  1557.          loop is began that will continue until S_Enter is pressed.
  1558.       
  1559.          Next  the value of Y is tested to determine which of  the  two 
  1560.          fields are to be edited. 
  1561.       
  1562.          When Y has a value of one:
  1563.             1 - Response is assigned the value of Employe.Name.
  1564.             2 - ReadWindowField  is call to edit employee name  in  the 
  1565.                 window  addressed  by "NameWindow".
  1566.                 - It is to edit a field on line 6.
  1567.                 - Beginning at column 21 of the line.
  1568.                 - The  field  is  of type 9 which  allow  any  keyboard 
  1569.                   character to be keyed into it.
  1570.                 - The field has a length of 30 characters
  1571.                 - TSW  is to display the field with a background  color 
  1572.                   of  7 and a foreground color of 0 while it is  editing 
  1573.                   the field.
  1574.                 - The  memory  address of "Response" is passed  to  the 
  1575.                   procedure.    
  1576.             3 - The new value of the field is returned in  Response and 
  1577.                 assigned to the record field Employe.Name.
  1578.           
  1579.          Each  of the three fields is processed similarly as  the  user 
  1580.          presses TAB to move from field to field and S_Enter to end the 
  1581.          loop.
  1582.       
  1583.       
  1584.       
  1585.                                     Page W-24
  1586.       
  1587.       ReadWindowLine
  1588.       -----------------------------------------------------------------
  1589.       Function: Returns  a  string  containing  the  contents  of   the 
  1590.                 specified line of the specified window.
  1591.       
  1592.       Remarks:  Use  this option to read the contents of any line  from 
  1593.                 any window. The target window may be OPEN, HIDDEN, or 
  1594.                 OVERLAPPED by another window.
  1595.       
  1596.                 A  NULL string is returned if the specified  window  is 
  1597.                 not defined or if the specified line is less than 1  or 
  1598.                 greater than the number of lines in the window.
  1599.       
  1600.       Defined for Turbo C as:
  1601.             Function ReadWindowLine(WindowName:S_Str80;
  1602.                                     WindowNo,
  1603.                                     WindowRow:Byte):S_Str80;
  1604.       
  1605.       Defined for Turbo Pascal as:
  1606.             Function ReadWindowLine(WindowName:S_Str80;
  1607.                                     WindowNo,
  1608.                                     WindowRow:Byte):S_Str80;
  1609.       Parameter description:
  1610.       
  1611.            WindowName...........The name of the target window.
  1612.       
  1613.            WindowNo.............The unique number of the target  window 
  1614.                                 returned by DefineWindow.
  1615.       
  1616.            WindowRow............The  line of the window that you to  be 
  1617.                                 read.
  1618.       
  1619.          Pascal
  1620.          -------------------------------------------------------
  1621.       => Var Response : S_Str80;
  1622.          :
  1623.          Y := 1;
  1624.          Repeat 
  1625.            PauseWindowUpdates(True);
  1626.            If  (S_Up)Or(S_Down) then 
  1627.                Begin
  1628.       =>       Response := ReadWindowLine('',MenuWindow,Y);
  1629.                WriteWindowLine('',MenuWindow,Y,W_Off,0,0,2,Response);
  1630.                If  S_Up   Then If Y > 1 Then Dec(Y) Else Y := 6;
  1631.                If  S_Down Then If Y < 6 Then Inc(Y) Else Y := 1;
  1632.       =>       Response := ReadWindowLine('',MenuWindow,Y);
  1633.                WriteWindowLine('',MenuWindow,y,W_Off,0,7,0,Response);
  1634.                End;
  1635.            PauseWindowUpdates(False);
  1636.            S_NextKey;
  1637.          Until S_Esc Or S_Enter;
  1638.          :
  1639.          -------------------------------------------------------
  1640.          In  Pascal the field "Response" is defined as  type  "S_Str80" 
  1641.          and  is  used  to  receive  the  line  of  text  returned   by 
  1642.          ReadWindowLine.  (S_Str80 is defined in Turbo ScrEdit.).
  1643.          
  1644.          See  the  description  following the  C  example  for  further 
  1645.          discussion of this procedure.
  1646.       
  1647.       
  1648.       
  1649.       
  1650.       
  1651.                                     Page W-25
  1652.       
  1653.          C
  1654.          ----------------------------------------------------
  1655.       => char Response[81];
  1656.          :
  1657.          Y = 1;
  1658.          do{
  1659.            PauseWindowUpdates(1);
  1660.            if  ((S_Up)||(S_Down))
  1661.                {
  1662.       =>       strcpy(Response,ReadWindowLine("",MenuWindow,Y));
  1663.                WriteWindowLine("",MenuWindow,Y,W_Off,0,0,2,Response); 
  1664.                if (S_Up)   if (Y > 1) Y--; else Y = 6;
  1665.                if (S_Down) if (Y < 6) Y++; else Y = 1;
  1666.       =>       strcpy(Response,ReadWindowLine("",MenuWindow,Y));
  1667.                WriteWindowLine("",MenuWindow,Y,W_Off,0,7,0,Response); 
  1668.                }
  1669.            PauseWindowUpdates(0);
  1670.            S_NextKey();
  1671.          }while ((!S_Esc)&&(!S_Enter));
  1672.          :
  1673.          ----------------------------------------------------
  1674.          In  C   the field "Response" is defined as an  eighty  element 
  1675.          array  of type char. This field is to be used to  receive  the 
  1676.          line of text returned by calling ReadWindowLine. 
  1677.       
  1678.          In  this code segment we see that Y is assigned a value of  1 
  1679.          to   point  to  the  first  menu  option.  A  do/while  or   a 
  1680.          Repeat/Until  loop  is began that will continue  until  either 
  1681.          S_Esc or S_Enter is pressed.
  1682.       
  1683.          Next  the field Response is assigned the string of  characters 
  1684.          read from line Y of MenuWindow. 
  1685.       
  1686.          The  field is then written back to the same window  using  the 
  1687.          normal text attributes assigned to the window.
  1688.       
  1689.          Y is then incremented or decremented depending on which of the 
  1690.          up or down arrow key have been pressed.
  1691.       
  1692.          The  new  line  of  text pointed to by Y  is  then  read  into 
  1693.          Response  and re-written to the window with bright  background 
  1694.          and black foreground colors.
  1695.       
  1696.          This process is continued. The user of the program will see  a 
  1697.          highlighted  bar  that  moves up and  down  through  the  menu 
  1698.          options.
  1699.       
  1700.       
  1701.       
  1702.       SaveWindow
  1703.       -----------------------------------------------------------------
  1704.       Function: Stores the current "active" window's contents.
  1705.       
  1706.       Remarks:  This procedure stores the current window's contents. It 
  1707.                 is useful when you have used your language's screen I/O 
  1708.                 statements like clrscr, writeln, cprintf, etc.
  1709.       
  1710.                 This  statement  will also store the  current  row  and 
  1711.                 column  position  of the cursor,  allowing  the  cursor 
  1712.                 position  to  be restored when the window is  made  the 
  1713.                 active window again.
  1714.       
  1715.          
  1716.       
  1717.                                     Page W-26
  1718.       
  1719.       Defined for Turbo C as:
  1720.       
  1721.             void SaveWindow()
  1722.       
  1723.       
  1724.       Defined for Turbo Pascal as:
  1725.       
  1726.             Procedure SaveWindow;
  1727.       
  1728.          Pascal                           C
  1729.          -------------------------------  -------------------------------
  1730.                                           #include <conio.h>
  1731.                                           #include "ScrEdit.h"
  1732.          uses Crt,Windows,Scredit;        #include "Windows.h"
  1733.          .                                .
  1734.          .                                .
  1735.          Procedure Help1(Msg:Integer);    void Help1(int Msg);
  1736.          Begin                            {
  1737.            OpenWindow('',HelpWind);         OpenWindow("",HelpWind);
  1738.            ClrScr;                          clrscr();
  1739.            For x := 1 to 10 do              for (x=1;x<10;x++)        
  1740.               WriteLn(HelpMsg[Msg,x]);        cprintf
  1741.                                                  ("%s",HelpMsg[Msg][x]);
  1742.            S_NextKey;                       S_Nextkey();                  
  1743.       =>   SaveWindow('',HelpWind);         SaveWindow("",HelpWind);
  1744.            ShutWindow('',HelpWind);         ShutWindow("",HelpWind);
  1745.          End;                             }
  1746.          .                                .
  1747.          .                                .
  1748.         --------------------------------  -------------------------------
  1749.         In  the  above  code segment a help  window  is  opened.  This 
  1750.         routine uses the languages regular I/O statements to clear  the 
  1751.         screen and write a help message in the window.
  1752.       
  1753.         The  window is displayed until the user responds by pressing  a 
  1754.         key.    
  1755.       
  1756.         When any key is pressed the program then calls "SaveWindow"  to 
  1757.         store the current contents of the window.
  1758.       
  1759.         The  window  is  then  removed  from  the  screen  by   calling 
  1760.         "ShutWindow" and the program resumes.
  1761.       
  1762.       
  1763.       
  1764.       ShutWindow
  1765.       -----------------------------------------------------------------
  1766.       Function: Removes  a  window  from the screen  and  restores  the 
  1767.                 screen memory that was overlaid by the window.
  1768.       
  1769.       Remarks:  No  action  is  taken if the window  specified  is  not 
  1770.                 currently displayed on the screen.
  1771.       
  1772.       Defined for Turbo C as:
  1773.       
  1774.             void ShutWindow(char *WindowName,int WindowNo)
  1775.       
  1776.       Defined for Turbo Pascal as:
  1777.       
  1778.             Procedure ShutWindow(WindowName:S_Str80;WindowNo:Integer);
  1779.       
  1780.       
  1781.       
  1782.       
  1783.                                     Page W-27
  1784.       
  1785.       Parameter description:
  1786.            WindowName...........The name of the target window.
  1787.       
  1788.            WindowNo.............The unique number of the target  window 
  1789.                                 returned by DefineWindow.
  1790.       
  1791.       
  1792.          Pascal                           C
  1793.          -------------------------------  -------------------------------
  1794.                                           #include <conio.h>
  1795.                                           #include "ScrEdit.h"
  1796.          uses Crt,Windows,Scredit;        #include "Windows.h"
  1797.          .                                .
  1798.          .                                .
  1799.          Procedure Help1(Msg:Integer);    void Help1(int Msg);
  1800.          Begin                            {
  1801.            OpenWindow('',HelpWind);         OpenWindow("",HelpWind);
  1802.            ClrScr;                          clrscr();
  1803.            For x := 1 to 10 do              for (x=1;x<10;x++)
  1804.               WriteLn(HelpMsg[Msg,x]);        cprintf
  1805.                                                  ("%s",HelpMsg[Msg][x]);
  1806.            S_NextKey;                       S_Nextkey();
  1807.            SaveWindow('',HelpWind);         SaveWindow("",HelpWind);
  1808.       =>   ShutWindow('',HelpWind);         ShutWindow("",HelpWind);
  1809.          End;                             }
  1810.          .                                .
  1811.          .                                .
  1812.         --------------------------------  -------------------------------
  1813.         In  the  above  code segment a help  window  is  opened.  This 
  1814.         routine uses the languages regular I/O statements to clear  the 
  1815.         screen and write a help message in the window.
  1816.       
  1817.         The  window is displayed until the user responds by pressing  a 
  1818.         key.    When  any  key  is  pressed  the  program  then   calls 
  1819.         "SaveWindow" to store the current contents of the window.
  1820.       
  1821.         The  window  is  then  removed  from  the  screen  by   calling 
  1822.         "ShutWindow" and the program resumes.
  1823.       
  1824.       
  1825.       
  1826.       
  1827.       
  1828.       
  1829.       WindowsEnd;
  1830.       -----------------------------------------------------------------
  1831.       Function : De-allocates  all  window work areas  and  returns  all  
  1832.                  allocated memory back to the heap.
  1833.       
  1834.       Remarks  : Use this procedure when you are finished with a program 
  1835.                  segment and are ready to return to the main menu of a 
  1836.                  system. 
  1837.       
  1838.       Defined as:
  1839.       
  1840.             Turbo C:
  1841.                 void WindowsEnd();
  1842.       
  1843.             Turbo Pascal:
  1844.                 Procedure WindowEnd;
  1845.       
  1846.       
  1847.       
  1848.       
  1849.                                     Page W-28
  1850.       
  1851.       WindowsInit
  1852.       ----------------------------------------------------------------- 
  1853.       Function : Initializes the window system.
  1854.       
  1855.       IMPORTANT: You must call this procedure before you use any  other 
  1856.                  window   procedure.  If  you  do  not  you  will   get
  1857.                  unpredictable results.
  1858.       
  1859.       Remarks  : This  procedure  allocates memory from  the  heap  for 
  1860.                  screen work areas.
  1861.       
  1862.       Defined as:
  1863.       
  1864.             Turbo C:
  1865.                 void WindowsInit();
  1866.       
  1867.             Turbo Pascal:
  1868.                 Procedure WindowInit;
  1869.       
  1870.       C Examples 1:
  1871.            ----------------------------------------------------------
  1872.            .
  1873.            .
  1874.            S_OpenScreenFile("FileName");
  1875.            if (!WindowsInit)
  1876.               {
  1877.               cprintf("%s","Not enough free memory for Window");
  1878.               S_CloseScreenFile();
  1879.               exit(0);
  1880.               }
  1881.            .
  1882.            .
  1883.            ----------------------------------------------------------
  1884.       
  1885.       
  1886.       C Examples 2:
  1887.            ----------------------------------------------------------
  1888.            .
  1889.            .
  1890.            S_Init();
  1891.            if (!WindowsInit)
  1892.               {
  1893.               cprintf("%s","Not enough free memory for Window");
  1894.               S_CloseScreenFile();
  1895.               exit(0);
  1896.               }
  1897.           .
  1898.           .
  1899.           -----------------------------------------------------------
  1900.           The  above  examples demonstrate  initializing  the  windows 
  1901.           environment. 
  1902.       
  1903.           Example 1 demonstrates  how to initialize in a  program  that 
  1904.                     will  be  using Turbo ScrEdit screens  to  interact 
  1905.                     with the user of a program.
  1906.       
  1907.           Example 2 demonstrates  how to initialize for a program  that 
  1908.                     is  only going to use window procedures and is  not 
  1909.                     expected  to  access a screen file or  use  any  of 
  1910.                     Turbo ScrEdit's data entry screens.
  1911.       
  1912.       
  1913.       
  1914.       
  1915.                                     Page W-29
  1916.       
  1917.       WriteWindowField
  1918.       -----------------------------------------------------------------
  1919.       Function: Displays a string of characters to a user defined field 
  1920.                 in the active window of the screen.
  1921.       
  1922.       Remarks:   Dispal
  1923.         
  1924.       Defined for Turbo C as:
  1925.       
  1926.            void WriteWindowField(char *WindowName,
  1927.                                  int WindowNo,
  1928.                                  int WindowRow,
  1929.                                  int WindowCol,
  1930.                                  int DataType,
  1931.                                  int DataLength,
  1932.                                  int DataBgColor,
  1933.                                  int DataFgColor,
  1934.                                  int EmptyBgColor,
  1935.                                  int EmptyFgColor,
  1936.                                  char *CharString)
  1937.       
  1938.       Defined for Turbo Pascal as:
  1939.       
  1940.            Procedure WriteWindowField(WindowName:S_Str80;
  1941.                                       WindowNo,
  1942.                                       WindowRow,
  1943.                                       WindowCol,
  1944.                                       DataType,
  1945.                                       DataLength,
  1946.                                       DataBgColor,
  1947.                                       DataFgColor,
  1948.                                       EmptyBgColor,
  1949.                                       EmptyFgColor:Integer;
  1950.                                       Var CharString :S_Str80);
  1951.       
  1952.       
  1953.       Parameter description:
  1954.       
  1955.            WindowName...........The name of the target window.
  1956.       
  1957.            WindowNo.............The unique number of the target  window 
  1958.                                 returned by DefineWindow.
  1959.       
  1960.            WindowRow............The window line to be written to.
  1961.       
  1962.            WindowCol............The  column (-1) on the row  where  the
  1963.                                 data entry field is to begin.  Remember 
  1964.                                 Turbo ScrEdit adds one character to the 
  1965.                                 beginning and ending of fields.
  1966.       
  1967.            DataType.............Specifies   how  the  data  is  to   be 
  1968.                                 displayed  in the screen  field.  Works 
  1969.                                 the  same  as fields on  Turbo  ScrEdit 
  1970.                                 screens.
  1971.       
  1972.                                 0     = Integer value.
  1973.                                 2 - 7 = decimal  values  with  absolute 
  1974.                                         decimal portion in string being 
  1975.                                         at DataType.
  1976.                                 8     = alphabetical key and space only.
  1977.                                 9     = any keyboard character.
  1978.       
  1979.       
  1980.       
  1981.                                     Page W-30
  1982.       
  1983.            DataLength...........The length of the field.
  1984.       
  1985.                                 ** NOTE ** if the length of the  field
  1986.                                 will  exceed the length of  the  window
  1987.                                 line, the field length is adjusted to:
  1988.       
  1989.                                 (Length of Window Line) - (WindowCol) - 1;
  1990.       
  1991.            DataBgColor..........The  background  color  attribute   for
  1992.                                 displaying  a  field that has  a  value
  1993.                                 assigned to CharString.
  1994.       
  1995.            DataFgColor..........The  foreground  color  attribute   for
  1996.                                 displaying  a  field that has  a  value
  1997.                                 assigned to CharString.
  1998.       
  1999.            EmptyBgColor.........The  background  color  attribute   for
  2000.                                 displaying a empty or NULL field.
  2001.       
  2002.            EmptyFgColor.........The  foreground  color  attribute   for
  2003.                                 displaying a empty or Null field.
  2004.       
  2005.            CharString...........Is  a  pointer  to  a  string  variable
  2006.                                 containing  the  current  value  to  be
  2007.                                 displayed.
  2008.       
  2009.       
  2010.          Pascal
  2011.          ----------------------------------------------------------  
  2012.          Var Response : S_Str80;
  2013.          :
  2014.          X := EmployeeEditWindow;  
  2015.          Y := 1;
  2016.          Repeat
  2017.            Case Y Of
  2018.              1 :Begin
  2019.                 Response := Employe.Name;
  2020.                 WriteWindowField('',X,5,33,9,30,0,14,0,14,Response);
  2021.                 End;
  2022.              2 :Begin
  2023.                 Response := Employe.Address;
  2024.                 WriteWindowField('',X,6,33,9,30,0,14,0,14,Response);
  2025.                 End;
  2026.              3 :Begin
  2027.                 Response := Employe.City_State_Zip;
  2028.                 WriteWindowField('',X,7,33,9,30,0,14,0,14,Response);
  2029.                 End;
  2030.              End;
  2031.            Inc(Y);
  2032.          Until Y > 3;
  2033.          :
  2034.          ----------------------------------------------------------
  2035.          In  Pascal the field "Response" is defined as  type  "S_Str80" 
  2036.          and  is  used  to  pass  the field  value  to  be  written  by 
  2037.          WriteWindowField.  (S_Str80 is defined in Turbo ScrEdit.).
  2038.          
  2039.          See  the  description  following the  C  example  for  further 
  2040.          discussion of this procedure.
  2041.       
  2042.       
  2043.       
  2044.       
  2045.       
  2046.       
  2047.                                     Page W-31
  2048.       
  2049.          C
  2050.          ----------------------------------------------------------
  2051.          char Response[81];
  2052.          :
  2053.          X = EmployeeEditWindow;
  2054.          Y = 0;
  2055.          do{
  2056.            switch (Y++)
  2057.              {
  2058.              case 1 :{
  2059.                 Response[0]=Employe.Name;
  2060.                 WriteWindowField("",X,5,33,9,30,0,14,0,14,Response);
  2061.                 break;
  2062.                 };
  2063.              case 2 :{
  2064.                 Response[0]=Employe.Address;
  2065.                 WriteWindowField("",X,6,33,9,30,0,14,0,14,Response);
  2066.                 break;
  2067.                 };
  2068.              case 3 :{
  2069.                 Response[0]=Employe.City_State_Zip;
  2070.                 WriteWindowField("",X,7,33,9,30,0,14,0,14,Response);
  2071.                 break;
  2072.                 }
  2073.              }
  2074.           }while (!S_Enter);
  2075.          :
  2076.          ----------------------------------------------------------
  2077.          In  C   the field "Response" is defined as an  eighty  element 
  2078.          array of type char. This field is to be used to pass the field 
  2079.          value to be written to ReadWindowLine. 
  2080.       
  2081.          In  this code segment we see that Y is assigned a value of  1 
  2082.          to  point  to the first field of the window. A do/while  or  a 
  2083.          Repeat/Until  loop  is  began that will continue  until  Y  is 
  2084.          greater than three.
  2085.       
  2086.          Inside  the loop when the value of Y determines  which  record 
  2087.          field is to be written to which line of the window. When Y has 
  2088.          a value of 1:
  2089.            
  2090.            1 - Response  is  assigned  the value of  the  record  field 
  2091.                Employee.Name.
  2092.            2 - The  contents  of  Response is then  written  to  Window 
  2093.                number referenced by X. 
  2094.                - Then  value is written to Row 5 and column 33  of  the 
  2095.                  window.
  2096.                - The  field to be written is data type 9 or  any  ascii 
  2097.                  character.
  2098.                - The field is 30 characters long.
  2099.                - If  the field has a value greater than null string  it 
  2100.                  is to be displayed in  0 background and 14  foreground 
  2101.                  colors. 
  2102.                - If the field has a value of NULL string, a blank field 
  2103.                  is to be displayed with 0 background and 14 foreground 
  2104.                  colors.
  2105.                - The field Response contains the value to be written in 
  2106.                  the screen location.  
  2107.       
  2108.          Each field in the window is handled in a similar manner.
  2109.       
  2110.       
  2111.       
  2112.       
  2113.                                   Page W-32
  2114.       
  2115.       WriteWindowLine
  2116.       -----------------------------------------------------------------
  2117.       Function : Displays a string of text on the specified line of the 
  2118.                  specified window.
  2119.       
  2120.       Remarks  : Use  this  option  to write text to any  line  in  any 
  2121.                  window. The target window can be hidden (not displayed 
  2122.                  on the screen) or overlapped by another window.
  2123.       
  2124.       Defined for Turbo C as:
  2125.            enum WScrollType (W_Off=0,W_Up=1,W_Down=2);
  2126.            void WriteWindowLine(char *WindowName,
  2127.                                 int WindowNo,
  2128.                                 int WindowRow,
  2129.                                 int WindowScroll,
  2130.                                 int MaxLines
  2131.                                 int OverRideBg,
  2132.                                 int OverRideFg,
  2133.                                 char *CharString)
  2134.       
  2135.       Defined for Turbo Pascal as:
  2136.            Type WScrollType = (W_Off,W_Up,W_Down);
  2137.            Procedure WriteWindowLine(WindowName:S_Str80;
  2138.                                      WindowNo,
  2139.                                      WindowRow   :Byte;
  2140.                                      WindowScroll:WScrollType;
  2141.                                      MaxLines,
  2142.                                      OverRideBg,
  2143.                                      OverRideFg  :Byte;
  2144.                                      CharString  :S_Str80);
  2145.       Parameter description:
  2146.       
  2147.            WindowName...........The name of the target window.
  2148.       
  2149.            WindowNo.............The unique number of the target  window 
  2150.                                 returned by DefineWindow.
  2151.       
  2152.            WindowRow............The window line to be written to.
  2153.       
  2154.            WindowScroll.........This  field will accept three  possible
  2155.                                 values.  You  can used  the  enumerated
  2156.                                 types of:
  2157.                                 W_Off or 0   = No Scrolling. The window 
  2158.                                                line  is overlaid  with 
  2159.                                                the new value.
  2160.                                 W_Up  or 1   = Scroll   the   specified 
  2161.                                                lines up before  writing 
  2162.                                                the  new  value  to  the 
  2163.                                                line.
  2164.                                 W_Down or 3  = Scroll   the   specified 
  2165.                                                lines    down     before 
  2166.                                                writing the new value to
  2167.                                                the line.
  2168.       
  2169.            MaxLines.............Specifies  the maximum number of  lines 
  2170.                                 in  the window that are to be  scrolled 
  2171.                                 when  WindowScroll  is set to  W_Up  or 
  2172.                                 W_Down.
  2173.                                 
  2174.       
  2175.       
  2176.       
  2177.       
  2178.       
  2179.                                     Page W-33
  2180.       
  2181.                                 A  value  of 0 implies  all  the  lines 
  2182.                                 above  or below the line to be  written 
  2183.                                 are to be scrolled.
  2184.       
  2185.                                 If  MaxLines is assigned a value  that 
  2186.                                 would  exceed the number of lines  that 
  2187.                                 can  be  scrolled,  then  all  possible 
  2188.                                 lines are scrolled.
  2189.       
  2190.            OverRideBg...........Overrides  the normal  text  background
  2191.                                 color  specified  when the  window  was 
  2192.                                 defined. A value of zero will not over-
  2193.                                 ride TextBg.
  2194.       
  2195.            OverRideFg...........Overrides the normal text  foreground 
  2196.                                 color  specified  when the  window  was 
  2197.                                 defined. A value of zero will not over-
  2198.                                 ride TextFg.
  2199.       
  2200.            CharString...........Is  the  string  of  characters  to  be 
  2201.                                 written to the window line.
  2202.       
  2203.                                 If  the string length exceeds the  line 
  2204.                                 length, it is truncated.
  2205.       
  2206.                                 If  the string length is less than  the 
  2207.                                 line  length  the line is  padded  with 
  2208.                                 spaces.
  2209.       
  2210.          Pascal
  2211.          -------------------------------------------------------
  2212.       => Var Response : S_Str80;
  2213.          :
  2214.          Y := 1;
  2215.          Repeat 
  2216.            PauseWindowUpdates(True);
  2217.            If  (S_Up)Or(S_Down) then 
  2218.                Begin
  2219.                Response := ReadWindowLine('',MenuWindow,Y);
  2220.       =>         WriteWindowLine('',MenuWindow,Y,W_Off,0,0,2,Response);
  2221.                If  S_Up   Then If Y > 1 Then Dec(Y) Else Y := 6;
  2222.                If  S_Down Then If Y < 6 Then Inc(Y) Else Y := 1;
  2223.                Response := ReadWindowLine('',MenuWindow,Y);
  2224.       =>       WriteWindowLine('',MenuWindow,y,W_Off,0,7,0,Response);
  2225.                End;
  2226.            PauseWindowUpdates(False);
  2227.            S_NextKey;
  2228.          Until S_Esc Or S_Enter;
  2229.          :
  2230.          -------------------------------------------------------
  2231.          In  Pascal the field "Response" is defined as  type  "S_Str80" 
  2232.          and  is  used  to  receive  the  line  of  text  returned   by 
  2233.          ReadWindowLine   which  is  then  passed  to  WriteWindowLine. 
  2234.          (S_Str80 is defined in Turbo ScrEdit.).
  2235.          
  2236.          See  the  description  following the  C  example  for  further 
  2237.          discussion of this procedure.
  2238.       
  2239.       
  2240.       
  2241.       
  2242.       
  2243.       
  2244.       
  2245.                                     Page W-34
  2246.       
  2247.          C
  2248.          ----------------------------------------------------
  2249.       => char Response[81];
  2250.          :
  2251.          Y = 1;
  2252.          do{
  2253.            PauseWindowUpdates(1);
  2254.            if  ((S_Up)||(S_Down))
  2255.                {
  2256.                strcpy(Response,ReadWindowLine("",MenuWindow,Y));
  2257.       =>       WriteWindowLine("",MenuWindow,Y,W_Off,0,0,2,Response); 
  2258.                if (S_Up)   if (Y > 1) Y--; else Y = 6;
  2259.                if (S_Down) if (Y < 6) Y++; else Y = 1;
  2260.                strcpy(Response,ReadWindowLine("",MenuWindow,Y));
  2261.       =>       WriteWindowLine("",MenuWindow,Y,W_Off,0,7,0,Response); 
  2262.                }
  2263.            PauseWindowUpdates(0);
  2264.            S_NextKey();
  2265.          }while ((!S_Esc)&&(!S_Enter));
  2266.          :
  2267.          ----------------------------------------------------
  2268.          In  C   the field "Response" is defined as an  eighty  element 
  2269.          array  of type char. This field is to be used to  receive  the 
  2270.          line  of  text returned by calling ReadWindowLine that  is  in 
  2271.          turn passed to WriteWindowLine.
  2272.       
  2273.          In  this code segment we see that Y is assigned a value of  1 
  2274.          to   point  to  the  first  menu  option.  A  do/while  or   a 
  2275.          Repeat/Until  loop  is began that will continue  until  either 
  2276.          S_Esc or S_Enter is pressed.
  2277.       
  2278.          Next  the field Response is assigned the string of  characters 
  2279.          read from line Y of MenuWindow. 
  2280.       
  2281.          The  field is then written back to the same window  using  the 
  2282.          normal text attributes assigned to the window.
  2283.       
  2284.          Y is then incremented or decremented depending on which of the 
  2285.          up or down arrow key have been pressed.
  2286.       
  2287.          The  new  line  of  text pointed to by Y  is  then  read  into 
  2288.          Response  and re-written to the window with bright  background 
  2289.          and black foreground colors.
  2290.       
  2291.          This process is continued. The user of the program will see  a 
  2292.          highlighted  bar  that  moves up and  down  through  the  menu 
  2293.          options as the PgUp and PgDn.
  2294.       
  2295.       
  2296.       
  2297.       
  2298.       
  2299.       
  2300.       
  2301.