fix: incorret draw files in 8-bit codeset after recode
[midnight-commander.git] / src / menu.h
blobea69c1b51069df2d40a6bcae83551c8077477104
1 #ifndef MC_MENU_H
2 #define MC_MENU_H
4 #include "widget.h"
6 typedef void (*callfn) (void);
8 typedef struct {
9 char first_letter;
10 const char *label;
11 struct hotkey_t text;
12 callfn call_back;
13 } menu_entry;
15 typedef struct Menu {
16 struct hotkey_t text;
17 int count;
18 int max_entry_len;
19 int selected;
20 menu_entry *entries;
21 int start_x; /* position relative to menubar start */
22 char *help_node;
23 } Menu;
25 extern int menubar_visible;
27 /* The button bar menu */
28 typedef struct WMenu {
29 Widget widget;
31 int active; /* If the menubar is in use */
32 int dropped; /* If the menubar has dropped */
33 Menu **menu; /* The actual menus */
34 int items;
35 int selected; /* Selected menu on the top bar */
36 int subsel; /* Selected entry on the submenu */
37 int max_entry_len; /* Cache value for the columns in a box */
38 int previous_widget; /* Selected widget ID before activating menu */
39 } WMenu;
41 Menu *create_menu (const char *name, menu_entry *entries, int count,
42 const char *help_node);
43 void destroy_menu (Menu *menu);
44 WMenu *menubar_new (int y, int x, int cols, Menu *menu[], int items);
45 void menubar_arrange (WMenu *menubar);
47 #endif