FOX/ObjCryst++  1.10.X (development)
ObjCryst::WXCrystMenuBar Class Reference

Our own local menu bar, using buttons and Popup menus. More...

+ Inheritance diagram for ObjCryst::WXCrystMenuBar:
+ Collaboration diagram for ObjCryst::WXCrystMenuBar:

Public Member Functions

 WXCrystMenuBar (wxWindow *parent, WXCrystObj *owner)
 Ctor.
 
void AddMenu (const string &name, const int menuId, const string &help="")
 Add a menu.
 
wxMenu & GetMenu (const int menuId)
 Get access to a menu.
 
void AddMenuItem (const int menuId, int id, const string &item, const string &help="", const bool checkable=false)
 Add an entry to a menu.
 
void AddMenuItem (const int menuId, int id, const wxString &item, wxMenu *subMenu, const wxString &helpString=_T(""))
 Add a sub-menu to a menu.
 
virtual void CrystUpdate (const bool updateUI=false, const bool mutexlock=false)
 Get new values to be displayed from the underlying object, and raise flag if an UI update is necessary. More...
 
virtual void UpdateUI (const bool mutexlock=false)
 Update the User Interface, if necessary. More...
 
void OnPopupMenu (wxCommandEvent &event)
 Event handler to popu the menu when the button is clicked.
 
virtual void SetToolTip (const wxString &tip, long menu=0)
 Set tooltip for each menu.
 
- Public Member Functions inherited from ObjCryst::WXCrystObjBasic
 WXCrystObjBasic (wxWindow *parent)
 Constructor.
 
virtual ~WXCrystObjBasic ()
 Destructor.
 
 wxDEPRECATED (virtual void BottomLayout(WXCrystObjBasic *pChild))
 Redo the Layout for the object and ask parent to take it into account. More...
 
virtual void AddChild (WXCrystObjBasic *pChild, bool doBottomLayout=true)
 Notify that a new children has been added, also adding it to the correct sizer (which can be the top sizer or not). More...
 
void AddedToList (WXCrystObjBasicList *list)
 
void RemovedFromList (WXCrystObjBasicList *list)
 
virtual bool Layout ()
 
virtual void SetToolTip (const wxString &tip)
 Set tooltip for this window. More...
 

Protected Attributes

wxBoxSizer * mpSizer
 The sizer of the menu.
 
std::map< long, pair< wxMenu
*, wxButton * > > 
mvpMenu
 List of menus, first is the menu Id and second is a pair of <pointer to the menu, pointer to the button of the menu>
 
- Protected Attributes inherited from ObjCryst::WXCrystObjBasic
WXCrystObjBasicmWXCrystParent
 Parent, if a WXCrystObjBasic itself.
 
bool mIsShown
 Is the the window currently shown ?
 
bool mNeedUpdateUI
 Do we need to update the display ?
 
CrystMutex mMutex
 Mutex used to lock data when preparing to update the UI in non-main thread.
 
std::set< WXCrystObjBasicList * > mvpList
 WXCrystObjBasicList which are aware of this object, and which should be told on destruction. More...
 

Detailed Description

Our own local menu bar, using buttons and Popup menus.

Definition at line 503 of file wxCryst.h.

Member Function Documentation

void ObjCryst::WXCrystMenuBar::CrystUpdate ( const bool  updateUI = false,
const bool  mutexlock = false 
)
virtual

Get new values to be displayed from the underlying object, and raise flag if an UI update is necessary.

The actual GUI update is not made here. UpdateUI() should be called separately, from the main thread.

Parameters
updateUIif true, this will call UpdateUI, either directly (if in the main thread), or by sending a message.
mutexlockif true, a Mutex will be used to lock the data shared between main and background thread. The idea is to only use a few Mutexes to lock data from the top objects (wxRefinableObj,...), when calling CrystUpdate() and UpdateUI(). As sub-objects (WXField,...) are only updated from within a top object, the mutex lock in the top object will also lock the data in the sub-objects.

Implements ObjCryst::WXCrystObjBasic.

Definition at line 943 of file wxCryst.cpp.

void ObjCryst::WXCrystMenuBar::UpdateUI ( const bool  mutexlock = false)
virtual

Update the User Interface, if necessary.

Parameters
mutexlockif true, a Mutex will be used to lock the data shared between main and background thread.

The idea is to only use a few Mutexes to lock data from the top objects (wxRefinableObj,...), when calling CrystUpdate() and UpdateUI(). As sub-objects (WXField,...) are only updated from within a top object, the mutex lock in the top object will also lock the data in the sub-objects.

Implements ObjCryst::WXCrystObjBasic.

Definition at line 946 of file wxCryst.cpp.


The documentation for this class was generated from the following files: