00001 #ifndef BCPOPUPMENU_H
00002 #define BCPOPUPMENU_H
00003
00004 #include "bcmenubar.inc"
00005 #include "bcmenuitem.inc"
00006 #include "bcsubwindow.h"
00007 #include "bcmenupopup.inc"
00008
00009
00010
00011
00012
00013 class BC_PopupMenu : public BC_SubWindow
00014 {
00015 public:
00016 BC_PopupMenu(int x,
00017 int y,
00018 int w,
00019 char *text,
00020 int use_title = 1,
00021
00022 VFrame **data = 0,
00023
00024 int margin = -1);
00025 BC_PopupMenu(int x,
00026 int y,
00027 char *text,
00028 int use_title = 1,
00029
00030 VFrame **data = 0);
00031 virtual ~BC_PopupMenu();
00032
00033 static int calculate_h(VFrame **data = 0);
00034 virtual int handle_event() { return 0; };
00035 char* get_text();
00036 int initialize();
00037 int add_item(BC_MenuItem *item);
00038 int remove_item(BC_MenuItem *item);
00039 int total_items();
00040 BC_MenuItem* get_item(int i);
00041
00042 void set_text(char *text);
00043
00044 void set_icon(BC_Pixmap *pixmap);
00045
00046 int draw_title();
00047 int reposition_window(int x, int y);
00048 int deactivate();
00049 int activate_menu();
00050 int deactivate_menu();
00051 int focus_out_event();
00052 int repeat_event(int64_t duration);
00053 int button_press_event();
00054 int button_release_event();
00055 int cursor_leave_event();
00056 int cursor_enter_event();
00057 int cursor_motion_event();
00058 int translation_event();
00059 int drag_start_event();
00060 int drag_stop_event();
00061 int drag_motion_event();
00062 int set_images(VFrame **data);
00063
00064 private:
00065 char text[BCTEXTLEN];
00066 int margin;
00067 VFrame **data;
00068 BC_Pixmap *images[9];
00069 BC_Pixmap *icon;
00070 int highlighted;
00071 int popup_down;
00072 int use_title;
00073 int button_releases;
00074 BC_MenuPopup *menu_popup;
00075
00076 int button_press_x, button_press_y;
00077 int w_argument;
00078 int status;
00079 };
00080
00081
00082
00083 #endif