Updated italian translation
[midnight-commander.git] / src / menu.h
blobff37b3000afd540076b14305398ede4bbcabdef2
1 #ifndef __MENU_H
2 #define __MENU_H
4 #include "widget.h"
6 typedef void (*callfn) (void);
8 typedef struct {
9 char first_letter;
10 char *text;
11 int hot_key;
12 callfn call_back;
13 } menu_entry;
15 typedef struct Menu {
16 char *name;
17 int count;
18 int max_entry_len;
19 int selected;
20 int hotkey;
21 menu_entry *entries;
22 int start_x; /* position relative to menubar start */
23 char *help_node;
24 } Menu;
26 extern int menubar_visible;
28 /* The button bar menu */
29 typedef struct WMenu {
30 Widget widget;
32 int active; /* If the menubar is in use */
33 int dropped; /* If the menubar has dropped */
34 Menu **menu; /* The actual menus */
35 int items;
36 int selected; /* Selected menu on the top bar */
37 int subsel; /* Selected entry on the submenu */
38 int max_entry_len; /* Cache value for the columns in a box */
39 int previous_widget; /* Selected widget ID before activating menu */
40 } WMenu;
42 Menu *create_menu (char *name, menu_entry *entries, int count,
43 char *help_node);
44 void destroy_menu (Menu *menu);
45 WMenu *menubar_new (int y, int x, int cols, Menu *menu[], int items);
46 void menubar_arrange (WMenu *menubar);
48 #endif /* __MENU_H */