home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / OMEGA2 / T_MENU.CPP < prev    next >
C/C++ Source or Header  |  1992-04-25  |  2KB  |  65 lines

  1. //
  2. // *************************************************************************
  3. // *                                                                       *
  4. // *    T_Menu Demonstration                                               *
  5. // *                                                                       *
  6. // *    OMEGA C++ Windowing Class Library                                  *
  7. // *    =================================                                  *
  8. // *                                                                       *
  9. // *    Copyright 1991,92 Tom Clancy                                       *
  10. // *    Submitted to the public domain, April 1992                         *
  11. // *                                                                       *
  12. // *************************************************************************
  13. //
  14.  
  15. #include "omscreen.hpp"
  16. #include "ommenu.hpp"
  17.  
  18. main () {
  19.   initmouse();
  20.   OMEGA_SETUP();
  21.   oScreen S;
  22.   S.cursoroff();
  23.   S.setfgcolor(WHITE);
  24.   S.setbkcolor(LIGHTGRAY);
  25.   S.setfillchar(#176);
  26.   S.clrscr();
  27.   S.showmouse();
  28.  
  29.   oMenu p;
  30.  
  31.   p.setmenu(1,1,WHITE,BLUE,YELLOW,BLACK,CYAN,WHITE,SINGLEBAR);
  32.   p.setboundaries(1,1,p.getscreenwid(),p.getscreenlen());
  33.   p.setsolidheader(OFF);
  34.   if(p.getsolidheader())
  35.     p.settitle(" Main Menu ",tCenter,BLACK,LIGHTGRAY);
  36.   else
  37.     p.settitle(" Main Menu ",tCenter,WHITE,BLUE);
  38.   p.setgap(2);
  39.   p.addoption("~Add Records");
  40.   p.addoption("Record ~Maintenance");
  41.   p.addoption("Database ~Queries");
  42.   p.addoption("~Report Generation");
  43.   p.addoption("A~Pplication Generator");
  44.   p.addoption("-");
  45.   p.addoption("E~Xit Menu");
  46.   p.setjustify(mCenterBoth);
  47.   p.dragging(ON);
  48.   p.resizing(ON);
  49.   p.expanding(ON);
  50.   p.closing(ON);
  51.   p.setshadow(ON,shBottomright);
  52.   while(p.getlastcmd()!=7 && p.getlastcmd()!=cmdClose) {
  53.     p.gomenu();
  54.   }
  55.   S.hidemouse();
  56.   S.restoreoldvmode();
  57.   S.setfillchar(32);
  58.   S.setbkcolor(BLACK);
  59.   S.clrscr();
  60.   S.cursoron();
  61.   return 0;
  62. }
  63.  
  64.  
  65.