umenuImpl.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  umenuImpl.hpp
00004  *  Ubit Project
00005  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00006  *  (C) 1999-2006 / Eric Lecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
00007  *
00008  * ***********************************************************************
00009  * COPYRIGHT NOTICE : 
00010  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00011  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00012  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00013  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00014  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00015  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00016  * ***********************************************************************
00017  * ==================================================== [(c)Elc] ======= *
00018  * ==================================================== ======== ======= */
00019 
00020 #ifndef _umenuImpl_hpp_
00021 #define _umenuImpl_hpp_
00022 #include <vector>
00023 //pragma ident  "@(#)umenuImpl.hpp      ubit:05.05.00"
00024 namespace ubit {
00025 
00028 class UMenuManager {
00029 public:
00030   UMenuManager(UEventFlow*);
00031   ~UMenuManager();
00032 
00033   UMenu* getDeepestMenu() const {return active_menu;}
00035 
00036   bool contains(UMenu* menu) const;
00038 
00039   bool contains(UView*) const;
00041 
00042   bool empty() const;
00044 
00045   void closeSubMenus(UMenu* menu, bool including_this_menu);
00047 
00048   void closeAllMenus(bool stop_auto_open_mode);
00050    
00051   void openMenu(UView* opener, UMenu*, UGroup* menuGroup, UDisp*);
00052   
00053   void openMenuAfterDelay();
00054   
00055   void closeMenuAfterDelay();
00056 
00057   void enterMenuOpener(UEvent&, UMenu*);
00058   void enterMenubarChild(UEvent&, bool inside_menubar);
00059   void leaveMenubarChild(UEvent&, bool inside_menubar);
00060   void enterMenuChild(UEvent&, UMenu*);
00061   void leaveMenuChild(UEvent&);
00062   void relaxMenuChild(UEvent&);
00063    
00064 private:
00065   friend class UMenu;
00066   friend class UMenubar;
00067   UDisp* disp;
00068   UEventFlow& eflow;
00069   // stack of menus that are currently being grabbed
00070   std::vector<UMenu*>menu_stack; 
00071   unsigned int menu_count;
00072   UView *active_opener, *possible_opener, *possible_closer;
00073   UMenu *active_menu, *possible_opener_menu, *possible_closer_menu;
00074   uptr<UTimer> open_timer, close_timer;  // uptr: dont destroy Timers
00075   UMenubar* active_menubar;
00076 };
00077 
00078 }
00079 #endif
00080 /* ==================================================== [TheEnd] ======= */
00081 /* ==================================================== [(c)Elc] ======= */
00082 

Generated on Mon Jan 29 00:20:39 2007 for Ubit by  doxygen 1.4.7