1998-02-27 04:54:42 +00:00
|
|
|
#ifndef __MENU_H
|
|
|
|
#define __MENU_H
|
|
|
|
|
|
|
|
#include "dlg.h"
|
|
|
|
#include "widget.h"
|
|
|
|
|
|
|
|
typedef void (*callfn) ();
|
|
|
|
/* FIXME: We have to leave this type ambiguous, because `callfn' is
|
|
|
|
used both for functions that take an argument and ones that don't.
|
|
|
|
That ought to be cleared up. */
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char first_letter;
|
|
|
|
char *text;
|
|
|
|
int hot_key;
|
|
|
|
callfn call_back;
|
|
|
|
} menu_entry;
|
|
|
|
|
2002-11-12 21:01:50 +00:00
|
|
|
typedef struct Menu {
|
1998-02-27 04:54:42 +00:00
|
|
|
char *name;
|
|
|
|
int count;
|
|
|
|
int max_entry_len;
|
|
|
|
int selected;
|
1998-06-08 00:33:31 +00:00
|
|
|
int hotkey;
|
1998-02-27 04:54:42 +00:00
|
|
|
menu_entry *entries;
|
1998-03-30 20:59:37 +00:00
|
|
|
int start_x; /* position relative to menubar start */
|
2002-08-20 21:30:06 +00:00
|
|
|
char *help_node;
|
2002-11-12 21:01:50 +00:00
|
|
|
} Menu;
|
1998-02-27 04:54:42 +00:00
|
|
|
|
|
|
|
extern int menubar_visible;
|
|
|
|
|
|
|
|
/* The button bar menu */
|
2002-11-11 07:35:08 +00:00
|
|
|
typedef struct WMenu {
|
1998-02-27 04:54:42 +00:00
|
|
|
Widget widget;
|
|
|
|
|
|
|
|
int active; /* If the menubar is in use */
|
|
|
|
int dropped; /* If the menubar has dropped */
|
2002-11-12 21:01:50 +00:00
|
|
|
Menu **menu; /* The actual menus */
|
1998-02-27 04:54:42 +00:00
|
|
|
int items;
|
|
|
|
int selected; /* Selected menu on the top bar */
|
|
|
|
int subsel; /* Selected entry on the submenu */
|
|
|
|
int max_entry_len; /* Cache value for the columns in a box */
|
|
|
|
int previous_selection; /* Selected widget before activating menu */
|
|
|
|
} WMenu;
|
|
|
|
|
2002-11-12 21:01:50 +00:00
|
|
|
Menu *create_menu (char *name, menu_entry *entries, int count,
|
2002-08-20 21:30:06 +00:00
|
|
|
char *help_node);
|
2002-11-12 21:01:50 +00:00
|
|
|
void destroy_menu (Menu *menu);
|
|
|
|
WMenu *menubar_new (int y, int x, int cols, Menu *menu[], int items);
|
|
|
|
void menubar_arrange (WMenu *menubar);
|
1998-02-27 04:54:42 +00:00
|
|
|
|
|
|
|
#endif /* __MENU_H */
|
|
|
|
|