home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcw_c.zip / DEMOS.C < prev    next >
C/C++ Source or Header  |  1991-12-28  |  2KB  |  73 lines

  1. /***************************************************************/
  2. /* File Id.                     DEMOS.C.                       */
  3. /* Author.                      Stan Milam.                    */
  4. /* Date Written.                21 Dec. 91.                    */
  5. /*                                                             */
  6. /* This file contains the menuing code that acts as an umbrella*/
  7. /* for all the demo routines.                                  */
  8. /*                                                             */
  9. /***************************************************************/
  10.  
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include "pcwproto.h"
  15. #include "menu.h"
  16. #include "keys.h"
  17.  
  18. int demo_a( void );
  19. int demo_b( void );
  20. int demo_c( void );
  21. int demo_d( void );
  22. int demo_e( void );
  23.  
  24. int demos_menu( void ) {
  25.  
  26.     int choice = 0;
  27.     WNDPTR *menuwnd;
  28.  
  29.     static PMNUFLDS DemoOptions[] = {
  30.         { 'A', "A. Ratting Around  " },
  31.         { 'B', "B. C Advertisment  " },
  32.         { 'C', "C. PCW On The Move " },
  33.         { 'D', "D. Life is Random  " },
  34.         { 'E', "E. Scrolling Around" },
  35.         { 'Q', "Q. Quit.           " },
  36.         {   0, NULL                  }
  37.     };
  38.  
  39.     static PMNUTYPE DemoMenu = {
  40.         NULL,
  41.         3,15,10,36,
  42.         YELLOW, BLUE,
  43.         SINGLEALL, LIGHTGRAY, BLUE,
  44.         "",
  45.         TOP, MIDDLE, LIGHTGRAY, BLUE,
  46.         YELLOW, MAGENTA, 0,
  47.         DemoOptions
  48.     };
  49.  
  50.     if (mpresent) hide_mouse();
  51.     menuwnd = makepmenu(&DemoMenu);
  52.     if (mpresent) show_mouse();
  53.     while ( choice != 'Q' && choice != ESC ) {
  54.         choice = pmenuinput( &DemoMenu );
  55.         switch ( choice ) {
  56.             case 'A' : demo_a(); break;
  57.             case 'B' : demo_b(); break;
  58.             case 'C' : demo_c(); break;
  59.             case 'D' : demo_d(); break;
  60.             case 'E' : demo_e(); break;
  61.             case 'Q' :
  62.             case ESC : continue;
  63.         }
  64.     }
  65.     if ( mpresent ) hide_mouse();
  66.     menuwnd = wpop( menuwnd );
  67.     DemoMenu.pwnd.wnd = NULL;
  68.     if ( mpresent ) show_mouse();
  69.     return 0;
  70. }
  71.  
  72.  
  73.