r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / guicast / bcmenuitem.h
blobad7bbb22fb8910f7031aba8115505d8f642fcbc4
1 #ifndef BCMENUITEM_H
2 #define BCMENUITEM_H
5 #include "bcmenubar.inc"
6 #include "bcmenupopup.inc"
7 #include "bcpixmap.inc"
8 #include "bcpopupmenu.inc"
9 #include "bcwindowbase.inc"
13 class BC_MenuItem
15 public:
16 BC_MenuItem(char *text, char *hotkey_text = "", int hotkey = 0);
17 virtual ~BC_MenuItem();
19 friend class BC_MenuPopup;
21 void reset();
22 int add_submenu(BC_SubMenu *submenu);
23 int set_checked(int value);
24 int get_checked();
25 void set_text(char *text);
26 char* get_text();
27 void set_icon(BC_Pixmap *icon);
28 BC_Pixmap* get_icon();
29 void set_hotkey_text(char *text);
30 int set_shift(int value = 1);
31 int set_alt(int value = 1);
33 int deactivate_submenus(BC_MenuPopup *exclude);
34 int activate_submenu();
35 virtual int handle_event() { return 0; };
36 int dispatch_button_press();
37 int dispatch_button_release(int &redraw);
38 int dispatch_motion_event(int &redraw);
39 int dispatch_translation_event();
40 int dispatch_cursor_leave();
41 int dispatch_key_press();
42 int add_item(BC_MenuItem *item);
43 int initialize(BC_WindowBase *top_level, BC_MenuBar *menu_bar, BC_MenuPopup *menu_popup);
44 int draw();
45 BC_WindowBase* get_top_level();
46 BC_PopupMenu* get_popup_menu();
48 private:
49 BC_WindowBase *top_level;
50 BC_MenuBar *menu_bar;
51 BC_MenuPopup *menu_popup;
52 // Submenu if this item owns one.
53 BC_SubMenu *submenu;
54 // whether the cursor is over or not
55 int highlighted;
56 // whether the cursor is over and the button is down
57 int down;
58 // check box
59 int checked;
60 // title
61 char *text;
62 // text of hotkey
63 char *hotkey_text;
64 // Hotkey requires shift
65 int shift_hotkey;
66 // Hotkey requires alt
67 int alt_hotkey;
68 // Character code of hotkey
69 int hotkey;
70 // icon or 0 if there is no icon
71 BC_Pixmap *icon;
72 // y position of this item set during menu activation
73 int y;
74 // height of item is set during menu activation
75 int h;
80 #endif