2 #ifndef _F_MENU_ITEM_H_
3 #define _F_MENU_ITEM_H_
7 // fltk - ËÁË ÍÎÏÇÏ × ÜÔÏÍ ÓÌÏ×Å ...
9 enum { // values for flags:
14 F_MENU_INVISIBLE = 0x10,
15 F_SUBMENU_POINTER = 0x20,
17 F_MENU_DIVIDER = 0x80,
18 F_MENU_HORIZONTAL = 0x100
24 F_Callback *callback_;
30 F_Menu_Item() { user_data_ = 0; flags = 0; callback_ = 0; }
31 F_Menu_Item(const char *l, F_Callback *cb, void *d) {
37 const char *text() const { return label_.c_str(); }
38 void text(const char *a) { if (a) label_ = a; }
39 void *user_data() const { return user_data_; }
40 void user_data(void *v) { user_data_ = v; }
41 int submenu() const { return flags & (F_SUBMENU | F_SUBMENU_POINTER); }
42 int checkbox() const { return flags & F_MENU_TOGGLE; }
43 int radio() const { return flags & F_MENU_RADIO; }
44 int value() const { return flags & F_MENU_VALUE; }
45 void set() { flags |= F_MENU_VALUE; }
46 void clear() { flags &= ~F_MENU_VALUE; }
47 void callback(F_Callback *cb, void *d = 0) {
52 void add(const char *l, F_Callback *cb = 0, void *data = 0) {