Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GuiMenuBar Class Reference

#include <GuiMenu.h>

Inheritance diagram for GuiMenuBar:

GuiBase List of all members.

Public Types

typedef std::map< std::string,
SigC::Ptr< GuiMenu > > 
GuiMenuMap

Public Member Functions

 GuiMenuBar (TGWindow &parent)
virtual ~GuiMenuBar ()
void AddMenu (GuiMenu &menu, const char *label)
GuiMenuMakeAddMenu (const char *label)
GuiMenuGetMenu (const char *label)
void RemoveMenu (const char *label)

Private Attributes

GuiMenuMap fMenuMap

Member Typedef Documentation

typedef std::map<std::string,SigC::Ptr<GuiMenu> > GuiMenuBar::GuiMenuMap
 

Definition at line 96 of file GuiMenu.h.


Constructor & Destructor Documentation

GuiMenuBar::GuiMenuBar TGWindow &  parent  ) 
 

Definition at line 121 of file GuiMenu.cxx.

References GuiBase::SetLayoutHints().

00122     : TGMenuBar(&parent,1,1,kHorizontalFrame)
00123 {
00124     SetLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX);
00125 }

virtual GuiMenuBar::~GuiMenuBar  )  [inline, virtual]
 

Definition at line 99 of file GuiMenu.h.

00099 { }


Member Function Documentation

void GuiMenuBar::AddMenu GuiMenu menu,
const char *  label
 

Definition at line 127 of file GuiMenu.cxx.

References GuiBase::AddChild(), GuiBase::AddObject(), fMenuMap, and GuiBase::GetLayoutHints().

Referenced by EVD::BuildGfxMenu(), EVD::BuildMenus(), fill_recurs_menu(), TridPage::Init(), MakeAddMenu(), TridPageDisplay::SetupMenus(), and PageDisplay::SetupMenus().

00128 {
00129     if(! this->AddChild(menu)) return;
00130 
00131     menu.GuiBase::SetName(label);
00132 
00133     TGLayoutHints* loh = 
00134         new TGLayoutHints(menu.GetLayoutHints());
00135     this->AddObject(loh);
00136     this->AddPopup(label,&menu,loh);
00137     fMenuMap[label] = &menu;
00138     this->MapSubwindows();
00139     this->Layout();
00140     this->MapWindow();
00141 }

GuiMenu * GuiMenuBar::GetMenu const char *  label  ) 
 

Definition at line 150 of file GuiMenu.cxx.

References fMenuMap.

Referenced by MultiPage::BuildMenus(), CheezyPage::BuildMenus(), fill_menu(), fill_mydisplay_menu(), and TridControl::TridControl().

00151 {
00152     GuiMenuMap::iterator mit = fMenuMap.find(label);
00153     if (mit == fMenuMap.end()) return 0;
00154     return mit->second;
00155 }

GuiMenu * GuiMenuBar::MakeAddMenu const char *  label  ) 
 

Definition at line 143 of file GuiMenu.cxx.

References AddMenu().

Referenced by fill_menu(), fill_mydisplay_menu(), fill_test_menu(), RegistryGui::SetPossiblesMenu(), and TridControl::TridControl().

00144 {
00145     GuiMenu* menu = manage(new GuiMenu);
00146     this->AddMenu(*menu,label);
00147     return menu;
00148 }

void GuiMenuBar::RemoveMenu const char *  label  ) 
 

Definition at line 157 of file GuiMenu.cxx.

References fMenuMap.

Referenced by EVD::BuildMenus(), clear_menu(), and remake_menu().

00158 {
00159     GuiMenuMap::iterator mit = fMenuMap.find(label);
00160     if (mit == fMenuMap.end()) return;
00161     this->TGMenuBar::RemovePopup(label);
00162 
00163     GuiBase* gb = mit->second;  // quell harmless sigc++ compile warnings
00164     fChildren.remove(gb);
00165     fMenuMap.erase(mit);    
00166     this->MapSubwindows();
00167     this->Layout();
00168     this->MapWindow();
00169 }


Member Data Documentation

GuiMenuMap GuiMenuBar::fMenuMap [private]
 

Definition at line 109 of file GuiMenu.h.

Referenced by AddMenu(), GetMenu(), and RemoveMenu().


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 11:58:28 2007 for loon by  doxygen 1.3.9.1