home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / FACETV.ZIP / FACE_TV.MEN < prev    next >
Text File  |  1994-01-05  |  9KB  |  330 lines

  1. /************************************************************************
  2. **
  3. ** @(#)face_tv.men        01/05/94    Chris Ahlstrom
  4. **
  5. **  ----------------------------------
  6. **  73340.26!compuserve.com
  7. **  ----------------------------------
  8. **
  9. **    C++ version
  10. **
  11. **    This file is basically an .H file that defines the menu
  12. ** structure for one and only one version of the FACE_TV program.
  13. ** However, for convenience, the dialog box portion is further
  14. ** broken out into module moddbox.h.
  15. **
  16. **    Structures for containing lists of items and subitems
  17. ** for menu-bars.
  18. **
  19. **    Note that this module is only good for the main module.
  20. ** No other module needs to know about the variables stored herein.
  21. **
  22. *************************************************************************/
  23.  
  24. #if !defined(FACE_TV_men)                // { FACE_TV_men
  25. #define FACE_TV_men
  26.  
  27.  
  28. /************************************************************************
  29. **        DECLARATIONS FOR THE MAIN PROGRAM 
  30. *************************************************************************
  31. **
  32. **    The following code (except for the #else section) requires
  33. ** that we're compiling a main program, and that the main program is
  34. ** the FACE_TV program.
  35. **
  36. *************************************************************************/
  37.  
  38. #if defined(MAIN_cpp) && defined(FACE_TV_cpp)        // { main program
  39.  
  40. #include <tkeys.h>            // Turbo Vision kbXXXX variables
  41. #include <views.h>            // Turbo Vision cmXXXX variables
  42.  
  43. #include "menubars.h"            // define necessary structures
  44.  
  45.  
  46.  
  47. #define FACE_TV_BANNER                        \
  48.     "C++ FACE_TV example utility v."                \
  49.     PROGRAM_VERSION "\n \n"                    \
  50.     "Programmer: Chris Ahlstrom " __DATE__ "\n"
  51.  
  52. #define FACE_TV_HELP    "Please see FACE_TV.TXT for Help."
  53.  
  54.  
  55. /************************************************************************
  56. ** FACE_TV-specific Turbo Vision commands.
  57. **
  58. **    Recall that Turbo Vision reserves command-numbers 0 to 99 and
  59. ** 256 to 999.
  60. **
  61. *************************************************************************/
  62.  
  63. const int
  64.  
  65.     cmNull        = 0,
  66.     cmConfigWriteAs    = 1100,        // for File/WriteConfig command
  67.     cmConfigWrite    = 1101,        // for File/WriteConfig command
  68.     cmConfigRead    = 1102,        // for File/ReadConfig command
  69.     cmDOS_Cmd        = 1103,        // for File/DOS (shelling out)
  70.     cmInfo        = 1104,        // for File/Info banner
  71.     cmUnimplementedTest = 1105,        // for testing error handling
  72.  
  73.     cmDacDialog        = 1200,        // sample dialog box
  74.     cmMidDialog        = 1201,        // sample mapped dialog box
  75.     cmExpDialog        = 1202,        // another sample dialog box
  76.     cmDelayDialog    = 1203,        // a dialog box for an action test!
  77.  
  78.     cmResponseTest    = 1300,        // test Response Devices
  79.     cmDelayTest        = 1301,        // test Response Device and delays
  80.  
  81.     cmDummyTerminator    = 65535U
  82.     ;
  83.  
  84.  
  85. /************************************************************************
  86. ** ConfigFile Menu (a submenu of the FileMenu below)
  87. *************************************************************************/
  88.  
  89. const NestItems ConfigFileMenu[] =
  90. {
  91.     {
  92.     "~R~ead",
  93.     cmConfigRead,
  94.     kbShiftF8,
  95.     hcNoContext,
  96.     "Sh-F8",
  97.     MENU_END_NEST
  98.     },
  99.     {
  100.     "~S~ave",
  101.     cmConfigWrite,
  102.     kbShiftF9,
  103.     hcNoContext,
  104.     "Sh-F9",
  105.     MENU_END_NEST
  106.     },
  107.     {
  108.     "Save ~A~s",
  109.     cmConfigWriteAs,
  110.     kbShiftF10,
  111.     hcNoContext,
  112.     "Sh-F10",
  113.     MENU_END_NEST
  114.     },
  115.     {
  116.     MENU_TERMINATE            /* the end of the array        */
  117.     }
  118. };
  119. const int ConfigFileMenuSize = ((sizeof(ConfigFileMenu)/sizeof(NestItems))-1);
  120.  
  121.  
  122. /************************************************************************
  123. ** FileMenu
  124. **
  125. **    All these actions are defined in FACE_TV.CPP.
  126. **
  127. *************************************************************************/
  128.  
  129. const NestItems FileMenu[] =
  130. {
  131.     {
  132.     "~I~nformation",        /* simple information banner    */
  133.     cmInfo,                /* the desired command        */
  134.     kbF2,                /* no direct-access keystroke    */
  135.     hcNoContext,            /* no help context available    */
  136.     "F2",                /* no need for keystroke string    */
  137.     MENU_END_NEST            /* no submenu for information    */
  138.     },
  139.     {
  140.     "~C~onfig file",        /* gains access to a submenu    */
  141.     cmNull,                /* this entry has no command...    */
  142.     kbNoKey,            /* ...because it points to a...    */
  143.     hcNoContext,            /* ...submenu!            */
  144.     NULL,                /* no keystroke either        */
  145.     ConfigFileMenu            /* configuration-file submenu    */
  146.     },
  147.     {
  148.     "~U~nimplemented",
  149.     cmUnimplementedTest,
  150.     kbNoKey,
  151.     hcNoContext,
  152.     NULL,
  153.     MENU_END_NEST
  154.     },
  155.     {
  156.     MENU_NEWLINE, 0, 0, 0, NULL    /* makes a separator line    */
  157.     },
  158.     {
  159.     "~D~OS shell",            /* access to DOS command line    */
  160.     cmDOS_Cmd,
  161.     kbF5,      
  162.     hcNoContext,
  163.     "F5",
  164.     MENU_END_NEST            /* no submenu            */
  165.     },
  166.     {
  167.     "E~x~it",            /* permanent access to DOS <g>    */
  168.     cmQuit,
  169.     kbAltX,
  170.     hcNoContext,
  171.     "Alt-X",
  172.     MENU_END_NEST            /* no submenu            */
  173.     },
  174.     {
  175.     MENU_TERMINATE            /* the end of the array        */
  176.     }
  177. };
  178. const int FileMenuSize =    ((sizeof(FileMenu)/sizeof(NestItems))-1);
  179.  
  180.  
  181. /************************************************************************
  182. ** TestMenu
  183. **
  184. **    All these actions are defined in FACE_TV.CPP.
  185. **
  186. *************************************************************************/
  187.  
  188. const NestItems TestMenu[] =
  189. {
  190.     {
  191.     "~R~esponse device",
  192.     cmResponseTest,
  193.     kbNoKey,
  194.     hcNoContext,
  195.     NULL,
  196.     MENU_END_NEST
  197.     },
  198.     {
  199.     "~D~elays",
  200.     cmDelayTest,
  201.     kbNoKey,
  202.     hcNoContext,
  203.     NULL,
  204.     MENU_END_NEST
  205.     },
  206.     {
  207.     MENU_TERMINATE            /* the end of the array        */
  208.     }
  209. };
  210. const int TestMenuSize =    ((sizeof(TestMenu)/sizeof(NestItems))-1);
  211.  
  212.  
  213. /************************************************************************
  214. ** DlgMenu
  215. **
  216. **    All these actions are defined in FACE_TV.CPP.
  217. **
  218. *************************************************************************/
  219.  
  220. const NestItems DlgMenu[] =
  221. {
  222.     {
  223.     "~D~/A converter",        /* sample dialog box        */
  224.     cmDacDialog,            /* the desired command        */
  225.     kbF6,                /* direct-access keystroke    */
  226.     hcNoContext,            /* no help context available    */
  227.     "F6",                /* keystroke string        */
  228.     MENU_END_NEST            /* no submenu for information    */
  229.     },
  230.     {
  231.     "Dela~y~",            /* more samples of dialog    */
  232.     cmDelayDialog,
  233.     kbF7,
  234.     hcNoContext,
  235.     "F7",
  236.     MENU_END_NEST
  237.     },
  238.     {
  239.     "~E~xperiment",            /* more samples of dialog    */
  240.     cmExpDialog,
  241.     kbF8,
  242.     hcNoContext,
  243.     "F8",
  244.     MENU_END_NEST
  245.     },
  246.     {
  247.     "~M~idi fakery",        /* sample byte mappings        */
  248.     cmMidDialog,
  249.     kbF9,
  250.     hcNoContext,
  251.     "F9",
  252.     MENU_END_NEST
  253.     },
  254.     {
  255.     MENU_TERMINATE            /* the end of the array        */
  256.     }
  257. };
  258. const int DlgMenuSize =        ((sizeof(DlgMenu)/sizeof(NestItems))-1);
  259.  
  260.  
  261. /************************************************************************
  262. ** Top Menu Line
  263. *************************************************************************/
  264.  
  265. const Nests FACEMenuBarItems[] =
  266. {
  267.     { "~F~ile",        kbAltF,    FileMenuSize,    FileMenu    },
  268.     { "~V~ariables",    kbAltV,    DlgMenuSize,    DlgMenu        },
  269.     { "~T~ests",    kbAltT,    TestMenuSize,    TestMenu    }
  270. };
  271. #define FACEMenuBarSize        (sizeof(FACEMenuBarItems)/sizeof(Nests))
  272.  
  273.  
  274. /************************************************************************
  275. ** Status Line
  276. *************************************************************************/
  277.  
  278. const StatusItems StatusBarItems[] =
  279. {
  280.     { "~Alt-X~ Exit",        cmQuit,        kbAltX        },
  281.     { "~Sh-F8~ Read",        cmConfigRead,    kbShiftF8    },
  282.     { "~Sh-F9~ Write",        cmConfigWrite,    kbShiftF9    },
  283.     { "~F10~ Menu",        cmMenu,        kbF10        }
  284. };
  285. #define StatusBarSize        (sizeof(StatusBarItems)/sizeof(StatusItems))
  286.  
  287.  
  288. /************************************************************************
  289. *************************************************************************
  290. ** Main Menu and Status Bars (includes all the above menus)
  291. **
  292. **    Access to the main menu bar is made in a very mindless way,
  293. ** through the global variables defined below.  All these entries are
  294. ** more fully defined above.
  295. **
  296. *************************************************************************
  297. *************************************************************************/
  298.  
  299. const NestBar FACEMenuBar =
  300. {
  301.     FACEMenuBarSize,
  302.     FACEMenuBarItems
  303. };
  304.  
  305. const StatusBar FACEStatusBar =
  306. {
  307.     StatusBarSize,
  308.     StatusBarItems
  309. };
  310.  
  311.  
  312. #endif                            // } main program
  313.  
  314.  
  315. /************************************************************************
  316. ** Arrays of field structures (label and data sections).
  317. **
  318. ** The simplest thing to do is edit these structures to fit your own menu.
  319. ** The dialog *.men files can be included here or in the main menu.
  320. ** It doesn't matter much.  See face_box.men as listed here or in
  321. ** face_tv.cpp.
  322. **
  323. *************************************************************************/
  324.  
  325. //#include "face_box.men"            // sample declaration
  326.  
  327.  
  328. #endif                            // } FACE_TV_men
  329.  
  330.