fix argc type
[reactos.git] / rosapps / dflat32 / menu.h
1 /* ------------ menu.h ------------- */
2
3 #ifndef MENU_H
4 #define MENU_H
5
6 #define DF_MAXPULLDOWNS 15
7 #define DF_MAXSELECTIONS 20
8 #define DF_MAXCASCADES 3 /* nesting level of cascaded menus */
9
10 /* ----------- popdown menu selection structure
11 one for each selection on a popdown menu --------- */
12 struct DfPopDown {
13 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 */
18 };
19
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];
29 } DF_MENU;
30
31 /* ----- one for each menu bar ----- */
32 typedef struct DfMenuBar {
33 int ActiveSelection;
34 DF_MENU PullDown[DF_MAXPULLDOWNS+1];
35 } DF_MBAR;
36
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} }};
47
48 /* -------- menu selection attributes -------- */
49 #define DF_INACTIVE 1
50 #define DF_CHECKED 2
51 #define DF_TOGGLE 4
52 #define DF_CASCADED 8
53
54 /* --------- the standard menus ---------- */
55 extern DF_MBAR DfMainMenu;
56 extern DF_MBAR DfSystemMenu;
57 extern DF_MBAR *DfActiveMenuBar;
58
59 int DfMenuHeight(struct DfPopDown *);
60 int DfMenuWidth(struct DfPopDown *);
61
62 #endif
63