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

  1.      #include <stdio.h>
  2.      #include <pcwproto.h>
  3.      #include <menu.h>
  4.      
  5.      static LMNUFLDS menu1[] = {
  6.         { 'A', 2, "Add",    "Add an Entry to Database"},
  7.         { 'C', 17,"Change", "Change a Database Entry"},
  8.         { 'D', 33,"Delete", "Delete a Database Entry"},
  9.         { NULL, NULL, NULL, NULL}
  10.      }; 
  11.      
  12.      static LMNUFLDS menu2[] = {
  13.         { 'P', 2, "Purge", "Purge the Workfile"},
  14.         { 'S', 18,"Send",  "Send Electronic Mail"},
  15.         { 'E', 35,"Exit",  "Exit the Program"},
  16.         {  NULL,NULL,NULL,NULL }
  17.      };
  18.      
  19.      static LMNUFLDS *menulist[] = {menu1, menu2, NULL}; 
  20.      
  21.      static LMNUTYPE lmenu = {
  22.          NULL,
  23.          10, 20, 13, 60,
  24.          BLUE, LIGHTGRAY,
  25.          DOUBLEALL,RED,LIGHTGRAY,
  26.          " The Lotus ",
  27.          TOP,MIDDLE,BLACK,LIGHTGRAY,
  28.          WHITE,BLUE,
  29.          0,0,menulist
  30.      };
  31.  
  32.      static char *selections[] = {
  33.         "Add    ", "Change ",
  34.         "Delete ", "Purge  ",
  35.         "Send   "
  36.      };
  37.  
  38.      void main(void) {
  39.  
  40.         int    i = 0;
  41.         int    index = 0;
  42.         WNDPTR *menuwnd;
  43.  
  44.         init_mouse();
  45.         menuwnd = makelmenu(&lmenu);
  46.         while (i != 'E' && i != 27) {
  47.            i = lmenuinput(&lmenu);
  48.            switch(i) {
  49.                case 'A' : index = 0; break;
  50.                case 'C' : index = 1; break;
  51.                case 'D' : index = 2; break;
  52.                case 'P' : index = 3; break;
  53.                case 'S' : index = 4; break;
  54.                case 27  :
  55.                case 'E' : continue;
  56.            }
  57.            qputs(25,CENTER,WHITE,BLACK,selections[index]);
  58.         }
  59.         if (mpresent) hide_mouse();
  60.         menuwnd = wpop(menuwnd);
  61.      } 
  62.