1 /* ------------ menu.h ------------- */
6 #define MAXPULLDOWNS 15
7 #define MAXSELECTIONS 20
8 #define MAXCASCADES 3 /* nesting level of cascaded menus */
10 /* ----------- popdown menu selection structure
11 one for each selection on a popdown menu --------- */
13 unsigned char *SelectionTitle
; /* title of the selection */
14 int ActionId
; /* the command executed */
15 int Accelerator
; /* the accelerator key */
16 int Attrib
; /* INACTIVE | CHECKED | TOGGLE | CASCADED*/
17 char *help
; /* Help mnemonic */
20 /* ----------- popdown menu structure
21 one for each popdown menu on the menu bar -------- */
23 char *Title
; /* title on the menu bar */
24 void (*PrepMenu
)(void *, struct Menu
*); /* function */
25 char *StatusText
; /* text for the status bar */
26 int CascadeId
; /* command id of cascading selection */
27 int Selection
; /* most recent selection */
28 struct PopDown Selections
[MAXSELECTIONS
+1];
31 /* ----- one for each menu bar ----- */
32 typedef struct MenuBar
{
34 MENU PullDown
[MAXPULLDOWNS
+1];
37 /* --------- macros to define a menu bar with
38 popdowns and selections ------------- */
39 #define SEPCHAR "\xc4"
40 #define DEFMENU(m) MBAR m = {-1,{
41 #define POPDOWN(ttl,func,stat) {ttl,func,stat,-1,0,{
42 #define CASCADED_POPDOWN(id,func) {NULL,func,NULL,id,0,{
43 #define SELECTION(stxt,acc,id,attr) {stxt,acc,id,attr,#acc},
44 #define SEPARATOR {SEPCHAR},
45 #define ENDPOPDOWN {NULL}}},
46 #define ENDMENU {(void *)-1} }};
48 /* -------- menu selection attributes -------- */
54 /* --------- the standard menus ---------- */
56 extern MBAR SystemMenu
;
57 extern MBAR
*ActiveMenuBar
;
59 int MenuHeight(struct PopDown
*);
60 int MenuWidth(struct PopDown
*);