-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenus.h
More file actions
166 lines (146 loc) · 3.29 KB
/
Copy pathmenus.h
File metadata and controls
166 lines (146 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#ifndef MENUS_H
#define MENUS_H
#define NULL (void*)0
enum menubar_items {
FILE_MENU,
EDIT_MENU,
SEARCH_MENU,
VIEW_MENU,
OPTIONS_MENU,
HELP_MENU
};
struct command {
const char * text;
const char * hint;
const int hotkey_position;
int (*command)(void);
};
struct menu {
const short width;
const short command_count;
/*const struct command * commands;*/
const struct command commands[1];
};
struct bar_item {
const char * text;
const char * hint;
const struct { const short first; const unsigned long length; } col;
const struct menu menu;
};
struct bar {
const short row;
const short item_count;
const struct bar_item items[6];
};
void build_menu(const enum menubar_items m, char * cb);
const struct bar g_menubar = {
0, /* row */
6, /* item_count */
{ /* items */
{
"File",
"Commands for manipulating files",
{ /* col */
2, /* first */
6, /* length */
},
{ /* menu */
18, /* width */
1, /* command_count */
{ /* commands */
{
"New",
"Creates a new file",
0,
NULL
}
}
}
},
{
"Edit",
"Commands for editing files",
{ /* col */
8, /* first */
6, /* length */
},
{ /* menu */
0, /* width */
0,
{ { NULL, NULL, 0, NULL } }
},
},
{
"Search",
"Commands for searching and replacing text",
{ /* col */
14, /* first */
8, /* length */
},
{ /* menu */
0, /* width */
0,
{ { NULL, NULL, 0, NULL } }
},
},
{
"View",
"List of currently-loaded files",
{ /* col */
22, /* first */
6, /* length */
},
{ /* menu */
0, /* width */
0,
{ { NULL, NULL, 0, NULL } }
},
},
{
"Options",
"Commands for setting editor options",
{
28,
9,
},
{
0,
0,
{ { NULL, NULL, 0, NULL } }
},
},
{
"Help",
"Help on Edit",
{
37,
6,
},
{
0,
0,
{ { NULL, NULL, 0, NULL } }
},
}
}
};
const struct bar g_statusbar = {
24, /* row */
1, /* item_count */
{ /* items */
{
"F1=Help",
"",
{ /* col */
0, /* first */
9, /* length */
},
{
0,
0,
{ { NULL, NULL, 0, NULL } }
}
}
}
};
#endif /* MENUS_H */