mask xy scale, mask boundary only overlay, fix 8 char mask nm bug, rework maskgui...
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bcpopupmenu.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 BCPOPUPMENU_H
23 #define BCPOPUPMENU_H
24
25 #include "bcmenubar.inc"
26 #include "bcmenuitem.inc"
27 #include "bcmenupopup.inc"
28 #include "bcsubwindow.h"
29
30
31 // A menu that pops up in the middle of a window or under a button.
32
33
34
35 class BC_PopupMenu : public BC_SubWindow
36 {
37 public:
38         BC_PopupMenu(int x, int y, int w, const char *text, int use_title = 1,
39 // Data for alternative title images
40                 VFrame **data = 0,
41 // Alternative text margin
42                 int margin = -1);
43         BC_PopupMenu(int x, int y, const char *text, int use_title = 1,
44 // Data for alternative title images
45                 VFrame **data = 0);
46         virtual ~BC_PopupMenu();
47
48 // Adds popupmenu_margin to width
49         static int calculate_w(int margin, int text_width, int use_title);
50         static int calculate_w(int text_width);
51         static int calculate_h(VFrame **data = 0);
52         virtual int handle_event() { return 0; };
53         virtual int draw_face(int dx, int color);
54         char* get_text();
55         int initialize();
56         int add_item(BC_MenuItem *item);
57         int del_item(BC_MenuItem *item);
58         int remove_item(BC_MenuItem *item);
59         int total_items();
60         BC_MenuItem* get_item(int i);
61         int get_margin();
62 // Set title of menu
63         void set_text(const char *text);
64 // Set icon of menu.  Disables text.
65         void set_icon(BC_Pixmap *pixmap);
66 // Draw title of menu
67         int draw_title(int flush);
68         int reposition_window(int x, int y);
69         int deactivate();
70         int activate_menu();
71         int menu_activate();
72         int deactivate_menu();
73         int focus_out_event();
74         int repeat_event(int64_t duration);
75         virtual int button_press_event();
76         virtual int button_release_event();
77         int cursor_leave_event();
78         int cursor_enter_event();
79         int cursor_motion_event();
80         int translation_event();
81         int drag_start_event();
82         int drag_stop_event();
83         int drag_motion_event();
84         int set_images(VFrame **data);
85
86 private:
87         char text[BCTEXTLEN];
88         int margin;
89         VFrame **data;
90         BC_Pixmap *images[9];
91         BC_Pixmap *icon;
92         int highlighted;
93         int popup_down;
94         int use_title;
95         BC_MenuPopup *menu_popup;
96 // Remember cursor position when no title
97         int button_press_x, button_press_y;
98         int w_argument;
99         int status;
100         int pending;
101 };
102
103
104
105 #endif