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

Detailed Description

Definition at line 93 of file GuiMenu.h.


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 139 of file GuiMenu.cxx.

References GuiBase::SetLayoutHints().

00140     : TGMenuBar(&parent,1,1,kHorizontalFrame)
00141 {
00142     SetLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX);
00143 }

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 145 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().

00146 {
00147     if(! this->AddChild(menu)) return;
00148 
00149     menu.GuiBase::SetName(label);
00150 
00151     TGLayoutHints* loh = 
00152         new TGLayoutHints(menu.GetLayoutHints());
00153     this->AddObject(loh);
00154     this->AddPopup(label,&menu,loh);
00155     fMenuMap[label] = &menu;
00156     this->MapSubwindows();
00157     this->Layout();
00158     this->MapWindow();
00159 }

GuiMenu * GuiMenuBar::GetMenu ( const char *  label  ) 

Definition at line 168 of file GuiMenu.cxx.

References fMenuMap.

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

00169 {
00170     GuiMenuMap::iterator mit = fMenuMap.find(label);
00171     if (mit == fMenuMap.end()) return 0;
00172     return mit->second;
00173 }

GuiMenu * GuiMenuBar::MakeAddMenu ( const char *  label  ) 

Definition at line 161 of file GuiMenu.cxx.

References AddMenu().

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

00162 {
00163     GuiMenu* menu = manage(new GuiMenu);
00164     this->AddMenu(*menu,label);
00165     return menu;
00166 }

void GuiMenuBar::RemoveMenu ( const char *  label  ) 

Definition at line 175 of file GuiMenu.cxx.

References GuiBase::fChildren, and fMenuMap.

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

00176 {
00177     GuiMenuMap::iterator mit = fMenuMap.find(label);
00178     if (mit == fMenuMap.end()) return;
00179     this->TGMenuBar::RemovePopup(label);
00180 
00181     GuiBase* gb = mit->second;  // quell harmless sigc++ compile warnings
00182     fChildren.remove(gb);
00183     fMenuMap.erase(mit);    
00184     this->MapSubwindows();
00185     this->Layout();
00186     this->MapWindow();
00187 }


Member Data Documentation

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 16 Apr 2018 for loon by  doxygen 1.6.1