home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WNDWC21.ZIP / EX12.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-01  |  1.6 KB  |  45 lines

  1. /*     EXAMPLE 12:  Updating covered windows automatically
  2.      ----------------------------------------------------------------------*/
  3.      #include <conio.h>
  4.      #include <dos.h>
  5.      #include "wndwc21.h"
  6.  
  7.      void main()
  8.      {
  9.          qinit();
  10.          initwindow( LIGHTGRAY_BG, 1, 0 );
  11.          setwindowmodes( VIRTUALMODE );
  12.          setvirtualsize( 20, 100 );              /* 20 rows by 100 columns */
  13.          makewindow( 5, 20, 15, 40, LIGHTCYAN+BLUE_BG, WHITE+BLUE_BG,
  14.                      SINGLE_BORDER, WINDOW1 );
  15.          setwindowmodes( 0 );                    /* Back to default modes. */
  16.          makewindow( 7, 30, 16, 18, WHITE+GREEN_BG, GREEN_BG, DOUBLE_BORDER,
  17.                      WINDOW2 );
  18. #ifdef __TURBOC__
  19.          delay( 2000 );           /* Make sure we see where the cursor is. */
  20. #else
  21.          suspend( 2000 );
  22. #endif
  23.          writetovirtual( WINDOW1 );     /* Now write to the virtual screen */
  24.          qfill(1,1,crt_rows,crt_cols,SAMEATTR,'?');  /* Fill screen w/data */
  25.          titlewindow( TOP, LEFT, YELLOW+BLUE_BG, " Virtual Window " );
  26.          wwrite( 4, 8, " >" );                  /* Let's get our bearings. */
  27.          qwriteeos( tws.wndwattr+BLINK, "+" );
  28.          qwriteeos( SAMEATTR, "<- Row 4, Column 10 " );
  29.          vviewrc( 4, 10 );
  30.          vupdatewindow();        /* Update the complete window on the CRT. */
  31. #ifdef __TURBOC__
  32.          delay( 1000 );
  33. #else
  34.          suspend( 1000 );
  35. #endif
  36.          removewindow();
  37. #ifdef __TURBOC__
  38.          delay( 2000 );           /* Make sure we see where the cursor is. */
  39. #else
  40.          removewindow();
  41. #endif
  42.          getch();
  43.      }
  44.  
  45.