4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "bcmenubar.inc"
26 #include "bcmenuitem.inc"
27 #include "bcmenupopup.inc"
28 #include "bcsubwindow.h"
31 // A menu that pops up in the middle of a window or under a button.
35 class BC_PopupMenu : public BC_SubWindow
43 // Data for alternative title images
45 // Alternative text margin
51 // Data for alternative title images
53 virtual ~BC_PopupMenu();
55 // Adds popupmenu_margin to width
56 static int calculate_w(int w_argument);
57 static int calculate_h(VFrame **data = 0);
58 virtual int handle_event() { return 0; };
61 int add_item(BC_MenuItem *item);
62 int del_item(BC_MenuItem *item);
63 int remove_item(BC_MenuItem *item);
65 BC_MenuItem* get_item(int i);
67 void set_text(const char *text);
68 // Set icon of menu. Disables text.
69 void set_icon(BC_Pixmap *pixmap);
71 int draw_title(int flush);
72 int reposition_window(int x, int y);
76 int deactivate_menu();
77 int focus_out_event();
78 int repeat_event(int64_t duration);
79 int button_press_event();
80 int button_release_event();
81 int cursor_leave_event();
82 int cursor_enter_event();
83 int cursor_motion_event();
84 int translation_event();
85 int drag_start_event();
86 int drag_stop_event();
87 int drag_motion_event();
88 int set_images(VFrame **data);
99 BC_MenuPopup *menu_popup;
100 // Remember cursor position when no title
101 int button_press_x, button_press_y;