home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / uidemo / popmenu / main.cxx < prev    next >
C/C++ Source or Header  |  1995-04-08  |  1KB  |  65 lines

  1.  
  2.  
  3. #include "ui/menu.h"
  4. #include "ui/composit.h"
  5. #include "ui/applic.h"
  6.  
  7. #include "menudrv.h"
  8. #include "appwin.h"
  9. #include "ids.h"
  10.  
  11. #ifdef __BORLANDC__
  12. extern unsigned _stklen = 35000;
  13. #endif
  14.  
  15. UI_MenuItemDescriptor App1Submenu [] = {
  16.   {"A one",     ID_SUBMENU1, NULL}
  17. , {"A two",     ID_SUBMENU2, NULL}
  18. , {NULL,        0, NULL}
  19. };
  20.  
  21. UI_MenuItemDescriptor App1Menu [] = {
  22.   {"&Jan",      ID_JAN,    NULL}
  23. , {"&Feb",      ID_FEB,    NULL}
  24. , {"&Mar",      ID_MAR,    App1Submenu}
  25. , {"---",       NULL,      NULL} // Separator
  26. , {"&Apr",      ID_APR,    NULL}
  27. , {"Ma&y",      ID_MAY,    NULL}
  28. , {NULL,        0,         NULL}
  29. };
  30.  
  31. UI_MenuItemDescriptor App2Menu [] = {
  32.     {"Monday",      ID_MON,  NULL}
  33.   , {"Tuesday",     ID_TUE,  NULL}
  34.   , {"Wednesday",   ID_WED,  NULL}
  35.   , {0,             0,   NULL}
  36. };
  37.  
  38.  
  39. UI_MenuItemDescriptor MainMenuDesc [] = {
  40.     {"&One",   ID_APP1, App1Menu}
  41.   , {"&Two",   ID_APP2, App2Menu}
  42.   , {NULL,     0, NULL}
  43. };
  44.  
  45.  
  46.  
  47. typedef CL_Binding<MenuDriver> MenuBinding;
  48.  
  49.  
  50. // ======================== Main program ===========================
  51.  
  52.  
  53. int UI_Application::Main (int, char* [])
  54. {
  55.     AppWindow* root = new AppWindow;
  56.     MakeTopWindow (root);
  57.     UI_MenuBar*     mainMenu =  new UI_MenuBar (root, MainMenuDesc);
  58.     MenuDriver driver;
  59.     driver.Setup (mainMenu);
  60.  
  61.     Run();
  62.     return 0;
  63. }
  64.  
  65.