home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / windc86.zip / WNDEMO.C < prev    next >
Text File  |  1989-03-20  |  2KB  |  71 lines

  1. /***************************************************************
  2. **      Dec 84  Converted to compile using CI C86 compiler    **
  3. **      Use   link wndemo+vlib,,,c86s2s  to link.             **
  4. **      by Mike Elkins (619) 722-4363                         **
  5. ***************************************************************/   
  6.  
  7. #include <stdio.h>
  8. #include <window.h>
  9. #include <window.c>
  10.  
  11. main()    /* demonstration */
  12. {
  13.     WINDOWPTR wn, wn1;
  14.     int    i;
  15.  
  16.     /*
  17.     for (i = 1; i < 25; i++)
  18.         printf("The quick brown fox jumped over the lazy dog's back.\n");
  19. */
  20. /*  Draw bottom window and fill with text from show_mail() below */
  21.     if ((wn = draw_window(10, 3, 60, 10, 0x70)) == NULL) {
  22.         printf("\n--- Error opening first window\n");
  23.         exit(1);
  24.     }
  25.     show_mail(wn);
  26.  
  27. /* Draw second window on top of first with reversed fore/background */
  28.     if ((wn1 = draw_window(15, 5, 30, 3, 7 )) == NULL) {
  29.         printf("\n--- Error opening second window\n");
  30.         exit(1);
  31.     }
  32.     write_text(wn1, " Read your mail more often!");
  33.  
  34.     getchar();            /* Wait for any key to be pressed */
  35.     remove_window(wn1); /* Get rid of top window */
  36.  
  37.  
  38. /* This technique will cause the window to scroll from right to left */
  39.     for (i = 5; i > -10; i -= 2) {
  40.         clr_window(wn);
  41.         wn->cx = i;
  42.         show_mail(wn);
  43.         getchar();
  44.     }
  45.     insert_row(wn, 4);   /* Insert an empty row  */
  46.     getchar();
  47.     wn->cy = 10;         /* Place cursor on tenth row */
  48.     write_text(wn, "******************************");
  49.     show_mail(wn);       /* scroll everything up */
  50.     getchar();
  51.  
  52.     remove_window(wn);
  53.     exit(0);
  54. }
  55.  
  56.  
  57. show_mail(wn)        /* display the MAIL message */
  58. {
  59.     write_text(wn, "Mail System");
  60.     write_text(wn, "-----------");
  61.     write_text(wn, "Messages Received:  3");
  62.     write_text(wn, "From          Date      Time");
  63.     write_text(wn, "----         ------     ----");
  64.     write_text(wn, "John         1/24/83    0935");
  65.     write_text(wn, "Kim          1/23/83    1547");
  66.     write_text(wn, "Sam          1/23/83    1117");
  67.     write_text(wn, "This line of text should be truncated before here.");
  68. }
  69.  
  70.  
  71.