Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

bcmenupopup.h

Go to the documentation of this file.
00001 #ifndef BCMENUPOPUP_H
00002 #define BCMENUPOPUP_H
00003 
00004 
00005 
00006 #include "arraylist.h"
00007 #include "bcmenu.inc"
00008 #include "bcmenubar.inc"
00009 #include "bcmenuitem.inc"
00010 #include "bcpopup.inc"
00011 #include "bcpopupmenu.inc"
00012 #include "bcwindowbase.inc"
00013 
00014 
00015 // A window that contains a menu.
00016 
00017 class BC_MenuPopup;
00018 
00019 class BC_MenuPopup
00020 {
00021 public:
00022         BC_MenuPopup();
00023         virtual ~BC_MenuPopup();
00024 
00025         friend class BC_MenuItem;
00026         friend class BC_PopupMenu;
00027 
00028         int initialize(BC_WindowBase *top_level, 
00029                 BC_MenuBar *menu_bar, 
00030                 BC_Menu *menu, 
00031                 BC_MenuItem *menu_item, 
00032                 BC_PopupMenu *popup_menu);
00033         int add_item(BC_MenuItem *item);
00034         int remove_item(BC_MenuItem* item = 0);
00035         int total_menuitems();
00036 
00037 // Deactivates all submenus in a downward progression except for the exclude
00038         int deactivate_submenus(BC_MenuPopup *exclude = 0);
00039         int dispatch_button_press();
00040         int dispatch_button_release();
00041         int dispatch_key_press();
00042         int dispatch_motion_event();
00043         int dispatch_cursor_leave();
00044         int dispatch_translation_event();
00045         int deactivate_menu();
00046         int activate_menu(int x, int y, int w, int h, int top_window_coords, int vertical_justify);
00047         int get_key_x();
00048         int get_w();
00049         int draw_items();
00050         BC_Popup* get_popup();
00051 
00052 private:
00053         int get_dimensions();
00054 
00055         ArrayList<BC_MenuItem *> menu_items;  
00056         BC_WindowBase *top_level;
00057         BC_MenuItem *menu_item;
00058         BC_MenuBar *menu_bar;
00059         BC_PopupMenu *popup_menu;
00060         BC_Menu *menu;
00061 // Dimensions relative to root window
00062         int x, y, w, h; 
00063 // Horizontal position of hotkey text
00064         int key_x;
00065 // Popup window that only exists when menu is down.
00066         BC_Popup *popup; 
00067         int active;
00068         int type;
00069 // Images for backgrounds
00070         BC_Pixmap *window_bg;
00071         BC_Pixmap *item_bg[3];
00072 };
00073 
00074 class BC_SubMenu : public BC_MenuPopup
00075 {
00076 public:
00077         BC_SubMenu();
00078         virtual ~BC_SubMenu();
00079 
00080         int add_submenuitem(BC_MenuItem *item);
00081 };
00082 
00083 
00084 
00085 
00086 #endif

Generated on Sun Jan 8 13:26:32 2006 for Guicast-svn by  doxygen 1.4.4