add binfolder path relative filters, fix gbrp color model, vwdw timebar tweaks, title...
[goodguy/history.git] / cinelerra-5.1 / guicast / bcmenuitem.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef BCMENUITEM_H
23 #define BCMENUITEM_H
24
25
26 #include "bcmenubar.inc"
27 #include "bcmenupopup.inc"
28 #include "bcpixmap.inc"
29 #include "bcpopupmenu.inc"
30 #include "bcwindowbase.inc"
31
32
33
34 class BC_MenuItem
35 {
36 public:
37         BC_MenuItem(const char *text, const char *hotkey_text = "", int hotkey = 0);
38         virtual ~BC_MenuItem();
39
40         friend class BC_MenuPopup;
41
42         void reset();
43         int add_submenu(BC_SubMenu *submenu);
44         int set_checked(int value);
45         int get_checked();
46         void set_text(const char *text);
47         char* get_text();
48         void set_icon(BC_Pixmap *icon);
49         BC_Pixmap* get_icon();
50         void set_hotkey_text(const char *text);
51         int set_shift(int value = 1);
52         int set_alt(int value = 1);
53         void set_ctrl(int value = 1);
54
55         int deactivate_submenus(BC_MenuPopup *exclude);
56         int activate_submenu();
57         virtual int handle_event() { return 0; };
58         int dispatch_button_press();
59         int dispatch_button_release(int &redraw);
60         int dispatch_motion_event(int &redraw);
61         int dispatch_translation_event();
62         int dispatch_cursor_leave();
63         int dispatch_key_press();
64         int add_item(BC_MenuItem *item);
65         int initialize(BC_WindowBase *top_level, BC_MenuBar *menu_bar, BC_MenuPopup *menu_popup);
66         int draw();
67         BC_WindowBase* get_top_level();
68         BC_PopupMenu* get_popup_menu();
69         BC_SubMenu *get_submenu();
70
71 private:
72         BC_WindowBase *top_level;
73         BC_MenuBar *menu_bar;
74         BC_MenuPopup *menu_popup;
75 // Submenu if this item owns one.
76         BC_SubMenu *submenu;
77 // whether the cursor is over or not
78         int highlighted;
79 // whether the cursor is over and the button is down
80         int down;
81 // check box
82         int checked;
83 // title
84         char *text;
85 // text of hotkey
86         char *hotkey_text;
87 // Hotkey requires shift
88         int shift_hotkey;
89 // Hotkey requires alt
90         int alt_hotkey;
91         int ctrl_hotkey;
92 // Character code of hotkey
93         int hotkey;
94 // icon or 0 if there is no icon
95         BC_Pixmap *icon;
96 // y position of this item set during menu activation
97         int y;
98 // height of item is set during menu activation
99         int h;
100 };
101
102
103
104 #endif