home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / w / wgt3_ex.zip / MENUS.C < prev    next >
C/C++ Source or Header  |  1992-09-13  |  2KB  |  83 lines

  1. #include <dos.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #include <wgt.h>
  5. #include <wgtmenu.h>
  6.  
  7. wgtfont little;
  8. color pal[256];
  9. char *menubar[10]={" QUIT  "," MENU1  "," MENU2 "," MENU3  ",NULL,NULL,NULL,NULL,NULL,NULL};
  10. int menuchoice;
  11.  
  12. void main(void)
  13. {
  14. vga256();
  15. // change the directory if needed
  16. little=wloadfont("c:\\tc\\newwgt\\fonts\\little.wfn");
  17.  
  18. wreadpalette(0,255,&pal);
  19. wsetrgb(1,63,63,63,&pal);
  20. wsetrgb(253,50,50,50,&pal);
  21. wsetrgb(254,40,40,40,&pal);
  22. wsetrgb(255,30,30,30,&pal);
  23. wsetpalette(0,255,&pal);
  24.  
  25. menubarcolor=254;
  26. menubartextcolor=1;
  27. bordercolor=255;
  28. highlightcolor=144;
  29.  
  30. menufont=little;
  31.  
  32. dropdown[0].choice[0]=" QUIT ";
  33.  
  34. dropdown[1].choice[0]="This is a drop";
  35. dropdown[1].choice[1]="down menu. You can";
  36. dropdown[1].choice[2]="put any text in here";
  37. dropdown[1].choice[3]="and WGT Menus will";
  38. dropdown[1].choice[4]="handle the rest";
  39. dropdown[1].choice[5]="--------------------";
  40. dropdown[1].choice[6]="You can have up to";
  41. dropdown[1].choice[7]="ten choices per menu";
  42. dropdown[1].choice[8]="and up to ten menus.";
  43.  
  44. dropdown[2].choice[0]=" Choice #1 ";
  45. dropdown[2].choice[1]=" Choice #2 ";
  46. dropdown[2].choice[2]=" Choice #3 ";
  47. dropdown[2].choice[3]="You can even change";
  48. dropdown[2].choice[4]="the colors of each";
  49. dropdown[2].choice[5]="dropdown menu.";
  50. dropdown[2].color=12;
  51. dropdown[2].bordercolor=14;
  52. dropdown[2].textcolor=1;
  53.  
  54. dropdown[3].choice[0]="You can also use";
  55. dropdown[3].choice[1]="any font, as long";
  56. dropdown[3].choice[2]="as all the menus";
  57. dropdown[3].choice[3]="fit on the screen.";
  58. dropdown[3].choice[4]="******************";
  59. dropdown[3].choice[5]="Try changing";
  60. dropdown[3].choice[6]="menufont to NULL";
  61. dropdown[3].choice[7]="and the default";
  62. dropdown[3].choice[8]="font will be used.";
  63. dropdown[3].choice[9]="******************";
  64.  
  65. menufont=little;
  66. initdropdowns();
  67. showmenubar();
  68.  
  69. mon();
  70.  
  71. do { menuchoice=checkmenu();
  72.  
  73.  
  74.  } while (menuchoice !=0);
  75.  
  76.  
  77. removemenubar();
  78. free(little);
  79. textmode(C80);
  80. }
  81.  
  82.  
  83.