home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / winccdem.zip / DEMO3.C < prev    next >
Text File  |  1987-08-15  |  3KB  |  96 lines

  1. /*
  2. ************************************************************************
  3. *   FILE NAME...... DEMO3.C                                            *
  4. *   DESCRIPTION.... WINCC demo                                         *
  5. *                                                                      *
  6. *   Copyright (c) 1987 by Doug J. Lieu                                 *
  7. *   All rights reserved.                                               *
  8. ************************************************************************
  9.     This program demonstrates the speed and the imaginative movement
  10.     of window.
  11. */
  12.  
  13. #include "stdio.h"
  14. #include "win_hd.h"
  15.  
  16. int wtab[][5] = {                               /* table of position to zoom and move window */
  17.          1,  5,  2, 50, 1,
  18.          0,  5, 62, 79, 1,
  19.          1, 20, 74, 78, 1,
  20.         18, 24, 62, 79, 1,
  21.         19, 22, 22, 77, 1,
  22.         15, 24,  0, 20, 1,
  23.          5, 22,  0,  5, 1,
  24.          1,  5,  2, 50, 0,
  25.          0,  5, 62, 79, 0,
  26.          1, 20, 74, 78, 0,
  27.         18, 24, 64, 79, 0,
  28.         19, 22, 22, 77, 0,
  29.         19, 24,  0, 20, 0,
  30.          5, 22,  0,  5, 0,
  31.         10, 14, 15, 65, 0,
  32.          3, 21, 38, 42, 0,
  33.         10, 14, 15, 65, 0,
  34.          3, 21, 38, 42, 0,
  35.         10, 14, 15, 65, 0,
  36.          3, 21, 38, 42, 0,
  37.         10, 14, 15, 65, 0,
  38.          3, 21, 38, 42, 0,
  39.         10, 14, 15, 65, 0,
  40.          3, 21, 38, 42, 0,
  41.         10, 14, 15, 65, 0,
  42.          3, 21, 38, 42, 0,
  43.          -1                                             /* end of table */
  44. };
  45.  
  46.  
  47. void
  48. main()
  49. {
  50.         int     i, j, max, w;
  51.         char    title[30];
  52.  
  53.         winitial();                                     /* initialize the window environment */
  54.  
  55.         strcpy(title, " TEST OF ZOOM-MOVE ");
  56.         w = wopen(9, 14, 20, 60, RED_LGRN, BDR_SLN, RED_BLK, title, "demo3.c");
  57.         wmode(CTRL_ON);
  58.         i = message(NULL, " Press Ctrl-Break to stop ", STAY);
  59.         delay(2);
  60.         wclose(i);
  61.  
  62.         for (max = 0; wtab[max][0] != -1; max++)        /* get the size of table */
  63.                 ;
  64.  
  65.         while (1) {
  66.                 for (i = 0; i < max; i++) {                     /* an imaginative movement */
  67.                         wz_move(wtab[i][0], wtab[i][1], wtab[i][2], wtab[i][3]);
  68.                         wrefresh(ESC);
  69.                         delay(wtab[i][4]);
  70.                 }
  71.  
  72.                 wz_move(0, 4, 0, 8);
  73.                 for (j = 0; j < 2; j++) {                       /* demonstrate the speed of moving windwo */
  74.                         while (wshift(RIGHT) != ERROR)
  75.                                 ;
  76.                         while (wshift(DOWN) != ERROR)
  77.                                 ;
  78.                         while (wshift(LEFT) != ERROR)
  79.                                 ;
  80.                         while (wshift(UP) != ERROR)
  81.                                 ;
  82.                 }
  83.  
  84.                 for (j = 0; j < 2; j++) {
  85.                         while (wshift(DOWN) != ERROR)
  86.                                 ;
  87.                         while (wshift(RIGHT) != ERROR)
  88.                                 ;
  89.                         while (wshift(UP) != ERROR)
  90.                                 ;
  91.                         while (wshift(LEFT) != ERROR)
  92.                                 ;
  93.                 }
  94.         }
  95. }
  96.