a1b485a4907d0485dcfc7d7a0c19aae68f6a0e5e
1 /* ------------ menu.h ------------- */
6 #define DF_MAXPULLDOWNS 15
7 #define DF_MAXSELECTIONS 20
8 #define DF_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
; /* DF_INACTIVE | DF_CHECKED | DF_TOGGLE | DF_CASCADED*/
17 char *help
; /* Help mnemonic */
20 /* ----------- popdown menu structure
21 one for each popdown menu on the menu bar -------- */
22 typedef struct DfMenu
{
23 char *Title
; /* title on the menu bar */
24 void (*PrepMenu
)(void *, struct DfMenu
*); /* 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 DfPopDown Selections
[DF_MAXSELECTIONS
+1];
31 /* ----- one for each menu bar ----- */
32 typedef struct DfMenuBar
{
34 DF_MENU PullDown
[DF_MAXPULLDOWNS
+1];
37 /* --------- macros to define a menu bar with
38 popdowns and selections ------------- */
39 #define DF_SEPCHAR "\xc4"
40 #define DF_DEFMENU(m) DF_MBAR m = {-1,{
41 #define DF_POPDOWN(ttl,func,stat) {ttl,func,stat,-1,0,{
42 #define DF_CASCADED_POPDOWN(id,func) {NULL,func,NULL,id,0,{
43 #define DF_SELECTION(stxt,acc,id,attr) {stxt,acc,id,attr,#acc},
44 #define DF_SEPARATOR {DF_SEPCHAR},
45 #define DF_ENDPOPDOWN {NULL}}},
46 #define DF_ENDMENU {(void *)-1} }};
48 /* -------- menu selection attributes -------- */
54 /* --------- the standard menus ---------- */
55 extern DF_MBAR DfMainMenu
;
56 extern DF_MBAR DfSystemMenu
;
57 extern DF_MBAR
*DfActiveMenuBar
;
59 int DfMenuHeight(struct DfPopDown
*);
60 int DfMenuWidth(struct DfPopDown
*);