23 #ifndef __EDELIB_MENUBASE_H__
24 #define __EDELIB_MENUBASE_H__
26 #include "edelib-global.h"
28 #include <FL/Fl_Widget.H>
55 MenuBase(
int,
int,
int,
int,
const char * =0);
58 int item_pathname(
char *name,
int namelen,
const MenuItem *finditem=0)
const;
60 const MenuItem* find_item(
const char *name);
62 const MenuItem* test_shortcut() {
return picked(menu()->test_shortcut());}
65 const MenuItem *menu()
const {
return menu_;}
67 void copy(
const MenuItem *m,
void* user_data = 0);
68 int add(
const char*,
int shortcut, Fl_Callback*,
void* = 0,
int = 0);
69 int add(
const char* a,
const char* b, Fl_Callback* c,
70 void* d = 0,
int e = 0) {
return add(a,fl_old_shortcut(b),c,d,e);}
72 void size(
int W,
int H) { Fl_Widget::size(W, H); }
74 int add(
const char *);
75 void replace(
int,
const char *);
77 void shortcut(
int i,
int s) {menu_[i].shortcut(s);}
78 void mode(
int i,
int fl) {menu_[i].flags = fl;}
79 int mode(
int i)
const {
return menu_[i].flags;}
81 const MenuItem *mvalue()
const {
return value_;}
82 int value()
const {
return value_ ? (int)(value_-menu_) : -1;}
84 int value(
int i) {
return value(menu_+i);}
85 const char *text()
const {
return value_ ? value_->text : 0;}
86 const char *text(
int i)
const {
return menu_[i].text;}
88 Fl_Font textfont()
const {
return (Fl_Font)textfont_;}
89 void textfont(uchar c) {textfont_=c;}
90 uchar textsize()
const {
return textsize_;}
91 void textsize(uchar c) {textsize_=c;}
92 Fl_Color textcolor()
const {
return (Fl_Color)textcolor_;}
93 void textcolor(
unsigned c) {textcolor_=c;}
95 Fl_Boxtype down_box()
const {
return (Fl_Boxtype)down_box_;}
96 void down_box(Fl_Boxtype b) {down_box_ = b;}
99 Fl_Color down_color()
const {
return selection_color();}
100 void down_color(
unsigned c) {selection_color(c);}