r878: This is Cinelerra 2.1.
[cinelerra_cv/ct.git] / guicast / bcmenupopup.h
blob79a2daf1c76cd6cf7a162f327757f1916777ac21
1 #ifndef BCMENUPOPUP_H
2 #define BCMENUPOPUP_H
6 #include "arraylist.h"
7 #include "bcmenu.inc"
8 #include "bcmenubar.inc"
9 #include "bcmenuitem.inc"
10 #include "bcpopup.inc"
11 #include "bcpopupmenu.inc"
12 #include "bcwindowbase.inc"
15 // A window that contains a menu.
18 class BC_MenuPopup
20 public:
21 BC_MenuPopup();
22 virtual ~BC_MenuPopup();
24 friend class BC_MenuItem;
25 friend class BC_PopupMenu;
27 int initialize(BC_WindowBase *top_level,
28 BC_MenuBar *menu_bar,
29 BC_Menu *menu,
30 BC_MenuItem *menu_item,
31 BC_PopupMenu *popup_menu);
32 int add_item(BC_MenuItem *item);
33 int remove_item(BC_MenuItem* item = 0);
34 int total_menuitems();
36 // Deactivates all submenus in a downward progression except for the exclude
37 int deactivate_submenus(BC_MenuPopup *exclude = 0);
38 int dispatch_button_press();
39 int dispatch_button_release();
40 int dispatch_key_press();
41 int dispatch_motion_event();
42 int dispatch_cursor_leave();
43 int dispatch_translation_event();
44 int deactivate_menu();
45 int activate_menu(int x, int y, int w, int h, int top_window_coords, int vertical_justify);
46 int get_key_x();
47 int get_w();
48 int draw_items();
49 BC_Popup* get_popup();
51 private:
52 int get_dimensions();
54 ArrayList<BC_MenuItem *> menu_items;
55 BC_WindowBase *top_level;
56 BC_MenuItem *menu_item;
57 BC_MenuBar *menu_bar;
58 BC_PopupMenu *popup_menu;
59 BC_Menu *menu;
60 // Dimensions relative to root window
61 int x, y, w, h;
62 // Horizontal position of hotkey text
63 int key_x;
64 // Popup window that only exists when menu is down.
65 BC_Popup *popup;
66 int active;
67 int type;
68 // Images for backgrounds
69 BC_Pixmap *window_bg;
70 BC_Pixmap *item_bg[3];
73 class BC_SubMenu : public BC_MenuPopup
75 public:
76 BC_SubMenu();
77 virtual ~BC_SubMenu();
79 int add_submenuitem(BC_MenuItem *item);
85 #endif