home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_GEN
/
FACETV.ZIP
/
FACE_TV.MEN
< prev
next >
Wrap
Text File
|
1994-01-05
|
9KB
|
330 lines
/************************************************************************
**
** @(#)face_tv.men 01/05/94 Chris Ahlstrom
**
** ----------------------------------
** 73340.26!compuserve.com
** ----------------------------------
**
** C++ version
**
** This file is basically an .H file that defines the menu
** structure for one and only one version of the FACE_TV program.
** However, for convenience, the dialog box portion is further
** broken out into module moddbox.h.
**
** Structures for containing lists of items and subitems
** for menu-bars.
**
** Note that this module is only good for the main module.
** No other module needs to know about the variables stored herein.
**
*************************************************************************/
#if !defined(FACE_TV_men) // { FACE_TV_men
#define FACE_TV_men
/************************************************************************
** DECLARATIONS FOR THE MAIN PROGRAM
*************************************************************************
**
** The following code (except for the #else section) requires
** that we're compiling a main program, and that the main program is
** the FACE_TV program.
**
*************************************************************************/
#if defined(MAIN_cpp) && defined(FACE_TV_cpp) // { main program
#include <tkeys.h> // Turbo Vision kbXXXX variables
#include <views.h> // Turbo Vision cmXXXX variables
#include "menubars.h" // define necessary structures
#define FACE_TV_BANNER \
"C++ FACE_TV example utility v." \
PROGRAM_VERSION "\n \n" \
"Programmer: Chris Ahlstrom " __DATE__ "\n"
#define FACE_TV_HELP "Please see FACE_TV.TXT for Help."
/************************************************************************
** FACE_TV-specific Turbo Vision commands.
**
** Recall that Turbo Vision reserves command-numbers 0 to 99 and
** 256 to 999.
**
*************************************************************************/
const int
cmNull = 0,
cmConfigWriteAs = 1100, // for File/WriteConfig command
cmConfigWrite = 1101, // for File/WriteConfig command
cmConfigRead = 1102, // for File/ReadConfig command
cmDOS_Cmd = 1103, // for File/DOS (shelling out)
cmInfo = 1104, // for File/Info banner
cmUnimplementedTest = 1105, // for testing error handling
cmDacDialog = 1200, // sample dialog box
cmMidDialog = 1201, // sample mapped dialog box
cmExpDialog = 1202, // another sample dialog box
cmDelayDialog = 1203, // a dialog box for an action test!
cmResponseTest = 1300, // test Response Devices
cmDelayTest = 1301, // test Response Device and delays
cmDummyTerminator = 65535U
;
/************************************************************************
** ConfigFile Menu (a submenu of the FileMenu below)
*************************************************************************/
const NestItems ConfigFileMenu[] =
{
{
"~R~ead",
cmConfigRead,
kbShiftF8,
hcNoContext,
"Sh-F8",
MENU_END_NEST
},
{
"~S~ave",
cmConfigWrite,
kbShiftF9,
hcNoContext,
"Sh-F9",
MENU_END_NEST
},
{
"Save ~A~s",
cmConfigWriteAs,
kbShiftF10,
hcNoContext,
"Sh-F10",
MENU_END_NEST
},
{
MENU_TERMINATE /* the end of the array */
}
};
const int ConfigFileMenuSize = ((sizeof(ConfigFileMenu)/sizeof(NestItems))-1);
/************************************************************************
** FileMenu
**
** All these actions are defined in FACE_TV.CPP.
**
*************************************************************************/
const NestItems FileMenu[] =
{
{
"~I~nformation", /* simple information banner */
cmInfo, /* the desired command */
kbF2, /* no direct-access keystroke */
hcNoContext, /* no help context available */
"F2", /* no need for keystroke string */
MENU_END_NEST /* no submenu for information */
},
{
"~C~onfig file", /* gains access to a submenu */
cmNull, /* this entry has no command... */
kbNoKey, /* ...because it points to a... */
hcNoContext, /* ...submenu! */
NULL, /* no keystroke either */
ConfigFileMenu /* configuration-file submenu */
},
{
"~U~nimplemented",
cmUnimplementedTest,
kbNoKey,
hcNoContext,
NULL,
MENU_END_NEST
},
{
MENU_NEWLINE, 0, 0, 0, NULL /* makes a separator line */
},
{
"~D~OS shell", /* access to DOS command line */
cmDOS_Cmd,
kbF5,
hcNoContext,
"F5",
MENU_END_NEST /* no submenu */
},
{
"E~x~it", /* permanent access to DOS <g> */
cmQuit,
kbAltX,
hcNoContext,
"Alt-X",
MENU_END_NEST /* no submenu */
},
{
MENU_TERMINATE /* the end of the array */
}
};
const int FileMenuSize = ((sizeof(FileMenu)/sizeof(NestItems))-1);
/************************************************************************
** TestMenu
**
** All these actions are defined in FACE_TV.CPP.
**
*************************************************************************/
const NestItems TestMenu[] =
{
{
"~R~esponse device",
cmResponseTest,
kbNoKey,
hcNoContext,
NULL,
MENU_END_NEST
},
{
"~D~elays",
cmDelayTest,
kbNoKey,
hcNoContext,
NULL,
MENU_END_NEST
},
{
MENU_TERMINATE /* the end of the array */
}
};
const int TestMenuSize = ((sizeof(TestMenu)/sizeof(NestItems))-1);
/************************************************************************
** DlgMenu
**
** All these actions are defined in FACE_TV.CPP.
**
*************************************************************************/
const NestItems DlgMenu[] =
{
{
"~D~/A converter", /* sample dialog box */
cmDacDialog, /* the desired command */
kbF6, /* direct-access keystroke */
hcNoContext, /* no help context available */
"F6", /* keystroke string */
MENU_END_NEST /* no submenu for information */
},
{
"Dela~y~", /* more samples of dialog */
cmDelayDialog,
kbF7,
hcNoContext,
"F7",
MENU_END_NEST
},
{
"~E~xperiment", /* more samples of dialog */
cmExpDialog,
kbF8,
hcNoContext,
"F8",
MENU_END_NEST
},
{
"~M~idi fakery", /* sample byte mappings */
cmMidDialog,
kbF9,
hcNoContext,
"F9",
MENU_END_NEST
},
{
MENU_TERMINATE /* the end of the array */
}
};
const int DlgMenuSize = ((sizeof(DlgMenu)/sizeof(NestItems))-1);
/************************************************************************
** Top Menu Line
*************************************************************************/
const Nests FACEMenuBarItems[] =
{
{ "~F~ile", kbAltF, FileMenuSize, FileMenu },
{ "~V~ariables", kbAltV, DlgMenuSize, DlgMenu },
{ "~T~ests", kbAltT, TestMenuSize, TestMenu }
};
#define FACEMenuBarSize (sizeof(FACEMenuBarItems)/sizeof(Nests))
/************************************************************************
** Status Line
*************************************************************************/
const StatusItems StatusBarItems[] =
{
{ "~Alt-X~ Exit", cmQuit, kbAltX },
{ "~Sh-F8~ Read", cmConfigRead, kbShiftF8 },
{ "~Sh-F9~ Write", cmConfigWrite, kbShiftF9 },
{ "~F10~ Menu", cmMenu, kbF10 }
};
#define StatusBarSize (sizeof(StatusBarItems)/sizeof(StatusItems))
/************************************************************************
*************************************************************************
** Main Menu and Status Bars (includes all the above menus)
**
** Access to the main menu bar is made in a very mindless way,
** through the global variables defined below. All these entries are
** more fully defined above.
**
*************************************************************************
*************************************************************************/
const NestBar FACEMenuBar =
{
FACEMenuBarSize,
FACEMenuBarItems
};
const StatusBar FACEStatusBar =
{
StatusBarSize,
StatusBarItems
};
#endif // } main program
/************************************************************************
** Arrays of field structures (label and data sections).
**
** The simplest thing to do is edit these structures to fit your own menu.
** The dialog *.men files can be included here or in the main menu.
** It doesn't matter much. See face_box.men as listed here or in
** face_tv.cpp.
**
*************************************************************************/
//#include "face_box.men" // sample declaration
#endif // } FACE_TV_men