r1053: Add Russian translation.
[cinelerra_cv.git] / guicast / bcpopupmenu.h
bloba0d903863c7d09769dc5589e6afa7cf63aaf8d20
1 #ifndef BCPOPUPMENU_H
2 #define BCPOPUPMENU_H
4 #include "bcmenubar.inc"
5 #include "bcmenuitem.inc"
6 #include "bcmenupopup.inc"
7 #include "bcsubwindow.h"
10 // A menu that pops up in the middle of a window or under a button.
14 class BC_PopupMenu : public BC_SubWindow
16 public:
17 BC_PopupMenu(int x,
18 int y,
19 int w,
20 char *text,
21 int use_title = 1,
22 // Data for alternative title images
23 VFrame **data = 0,
24 // Alternative text margin
25 int margin = -1);
26 BC_PopupMenu(int x,
27 int y,
28 char *text,
29 int use_title = 1,
30 // Data for alternative title images
31 VFrame **data = 0);
32 virtual ~BC_PopupMenu();
34 static int calculate_h(VFrame **data = 0);
35 virtual int handle_event() { return 0; };
36 char* get_text();
37 int initialize();
38 int add_item(BC_MenuItem *item);
39 int remove_item(BC_MenuItem *item);
40 int total_items();
41 BC_MenuItem* get_item(int i);
42 // Set title of menu
43 void set_text(char *text);
44 // Set icon of menu. Disables text.
45 void set_icon(BC_Pixmap *pixmap);
46 // Draw title of menu
47 int draw_title();
48 int reposition_window(int x, int y);
49 int deactivate();
50 int activate_menu();
51 int deactivate_menu();
52 int focus_out_event();
53 int repeat_event(int64_t duration);
54 int button_press_event();
55 int button_release_event();
56 int cursor_leave_event();
57 int cursor_enter_event();
58 int cursor_motion_event();
59 int translation_event();
60 int drag_start_event();
61 int drag_stop_event();
62 int drag_motion_event();
63 int set_images(VFrame **data);
65 private:
66 char text[BCTEXTLEN];
67 int margin;
68 VFrame **data;
69 BC_Pixmap *images[9];
70 BC_Pixmap *icon;
71 int highlighted;
72 int popup_down;
73 int use_title;
74 int button_releases;
75 BC_MenuPopup *menu_popup;
76 // Remember cursor position when no title
77 int button_press_x, button_press_y;
78 int w_argument;
79 int status;
84 #endif