home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / c / pcw_c.zip / PTEST.C < prev    next >
Text File  |  1990-01-30  |  2KB  |  57 lines

  1.      #include <stdio.h>
  2.      #include <pcwproto.h>
  3.      #include <menu.h>
  4.  
  5.      /* Declare the menu options */
  6.  
  7.      static PMNUFLDS poptions[] = {
  8.         { '1', "1. Delete "},
  9.         { '2', "2. Add    "},
  10.         { '3', "3. Change "},
  11.         { 'E', "E. Exit   "},
  12.         {  0,  (char *) 0}
  13.      };
  14.  
  15.      /* Declare and initialize window info */
  16.  
  17.      PMNUTYPE pmenu = {
  18.         NULL,                           /* Initial Window Pointer */
  19.         9, 25, 14, 55,                  /* Window boundries */
  20.         BLACK, LIGHTGRAY,               /* Window Color */
  21.         DOUBLEALL,RED,LIGHTGRAY,        /* Border type and border color */
  22.         " Main Pop-up Menu ",           /* Menu title */
  23.         TOP,MIDDLE,BLUE,LIGHTGRAY,      /* Title location & color */
  24.         WHITE,BLUE,                     /* Select Bar color */
  25.         0,                              /* Initial bar position */
  26.         poptions                        /* Pointer to array of options */
  27.      };
  28.      
  29.      void main(void) {
  30.  
  31.         int i = 0, mxr, mxc;
  32.         WNDPTR *menuwnd;
  33.         static char *selections[] = {
  34.            "Delete    ",
  35.            "Add       ",
  36.            "Change    "
  37.         };
  38.  
  39.         init_mouse();
  40.         chk_video_state(&mxr,&mxc);
  41.         menuwnd = makepmenu(&pmenu);
  42.         while (i != 'E' && i != 27) {
  43.            i = pmenuinput(&pmenu);
  44.            switch(i) {
  45.               case '1' :
  46.               case '2' :
  47.               case '3' :
  48.                  i -= 49;
  49.                  qputs(mxr,CENTER,WHITE,BLACK,selections[i]);
  50.                  break;
  51.               default  : break;
  52.            }
  53.         }
  54.         if (mpresent) hide_mouse();
  55.         menuwnd = wpop(menuwnd);
  56.      }
  57.