GuiMenu Class Reference

#include <GuiMenu.h>

Inheritance diagram for GuiMenu:
GuiBase

List of all members.

Public Types

typedef std::list< SigC::Ptr
< GuiMenuEntry > > 
GuiMenuList
typedef std::list< SigC::Ptr
< GuiMenu > > 
GuiSubMenuList

Public Member Functions

 GuiMenu ()
virtual ~GuiMenu ()
virtual void Activated (Int_t id)
GuiMenuList::iterator Add (const char *label)
GuiMenuList::iterator Add (const char *label, SigC::Slot0< void > slot)
GuiMenuList::iterator Add (const char *label, GuiMenu &menu)
GuiMenuList::iterator Insert (GuiMenuList::iterator gmitr, const char *label)
GuiMenuList::iterator Insert (GuiMenuList::iterator gmitr, const char *label, SigC::Slot0< void > slot)
GuiMenuList::iterator Insert (GuiMenuList::iterator gmitr, const char *label, GuiMenu &menu)
void CheckEntry (GuiMenuList::iterator &mit, bool check_it=true)
bool IsEntryChecked (GuiMenuList::iterator &mit)
GuiMenuListGetMenuList ()
void ClearAll ()

Private Member Functions

void CheckEntry (int)
bool IsEntryChecked (int)

Private Attributes

GuiMenuList fEntries
GuiSubMenuList fSubMenus

Detailed Description

Definition at line 44 of file GuiMenu.h.


Member Typedef Documentation

typedef std::list<SigC::Ptr<GuiMenuEntry> > GuiMenu::GuiMenuList

Definition at line 49 of file GuiMenu.h.

typedef std::list<SigC::Ptr<GuiMenu> > GuiMenu::GuiSubMenuList

Definition at line 50 of file GuiMenu.h.


Constructor & Destructor Documentation

GuiMenu::GuiMenu (  ) 

Definition at line 7 of file GuiMenu.cxx.

References GuiBase::SetLayoutHints().

00007                  : TGPopupMenu(0) 
00008 {
00009     SetLayoutHints(kLHintsTop|kLHintsLeft); 
00010 }

virtual GuiMenu::~GuiMenu (  )  [inline, virtual]

Definition at line 55 of file GuiMenu.h.

References fEntries.

00055                        { 
00056         fEntries.erase(fEntries.begin(),fEntries.end()); 
00057     }


Member Function Documentation

void GuiMenu::Activated ( Int_t  id  )  [virtual]

Definition at line 12 of file GuiMenu.cxx.

References GuiMenuEntry::Trigger().

00013 {
00014     gVirtualX->Update(1);       // XSync
00015     // could change pointer here....
00016     this->TGPopupMenu::Activated(id);
00017     GuiMenuEntry* gme = (GuiMenuEntry*)id; // yes, I am evil.
00018     gme->Trigger();
00019 }

GuiMenu::GuiMenuList::iterator GuiMenu::Add ( const char *  label,
GuiMenu menu 
)

Definition at line 37 of file GuiMenu.cxx.

References fEntries, and Insert().

00038 {
00039     return this->Insert(fEntries.end(), label, menu);
00040 }

GuiMenu::GuiMenuList::iterator GuiMenu::Add ( const char *  label,
SigC::Slot0< void >  slot 
)

Definition at line 32 of file GuiMenu.cxx.

References fEntries, and Insert().

00033 {
00034     return this->Insert(fEntries.end(),label,slot);
00035 }

GuiMenu::GuiMenuList::iterator GuiMenu::Add ( const char *  label  ) 
void GuiMenu::CheckEntry ( int   )  [inline, private]

Definition at line 86 of file GuiMenu.h.

00086 {}     // don't use

void GuiMenu::CheckEntry ( GuiMenuList::iterator &  mit,
bool  check_it = true 
)

Definition at line 94 of file GuiMenu.cxx.

Referenced by GuiToggledMenuItem::AddToMenu(), MultiPage::BuildMenus(), EVD::BuildMenus(), GuiToggledSubMenu::CallBack(), GuiToggledMenuItem::CallBack(), GfxMCVecListMenu::HideAll(), GfxShowerListMenu::HideAll(), GfxStripListMenu::HideAll(), GfxDigitListMenu::HideAll(), GfxTrackListMenu::HideAll(), TridPage::Init(), toggle_mux(), EVD::ToggleRealCoords(), MultiPage::ToggleRealCoords(), EVD::ToggleTimeZoom(), and TridPage::ViewMenuHandler().

00095 {
00096     GuiMenuEntry* gme = *mit;
00097 
00098     if (check_it) {
00099 #ifndef MINOS_TRY64
00100         this->TGPopupMenu::CheckEntry((int)gme);
00101 #else
00102         this->TGPopupMenu::CheckEntry((Long64_t)gme);
00103 #endif
00104     } else {
00105 #ifndef MINOS_TRY64
00106         this->TGPopupMenu::UnCheckEntry((int)gme);
00107 #else
00108         this->TGPopupMenu::UnCheckEntry((Long64_t)gme);
00109 #endif
00110     }
00111 }

void GuiMenu::ClearAll (  ) 

Definition at line 122 of file GuiMenu.cxx.

References fEntries, and fSubMenus.

Referenced by clear_menu(), and remake_menu().

00123 {
00124     GuiSubMenuList::iterator smit, send = fSubMenus.end();
00125     for (smit = fSubMenus.begin(); smit != send; ++smit) 
00126         (*smit)->ClearAll();
00127 
00128     GuiMenuList::iterator mit, end = fEntries.end();
00129     for (mit = fEntries.begin(); mit != end; ++mit)
00130         this->DeleteEntry((*mit)->GetEntry());
00131       
00132     fSubMenus.clear();
00133     fEntries.clear();
00134 }

GuiMenuList& GuiMenu::GetMenuList (  )  [inline]

Definition at line 79 of file GuiMenu.h.

References fEntries.

Referenced by GuiToggledSubMenu::CallBack(), and TridPage::ViewMenuHandler().

00079 { return fEntries; }

GuiMenu::GuiMenuList::iterator GuiMenu::Insert ( GuiMenuList::iterator  gmitr,
const char *  label,
GuiMenu menu 
)

Definition at line 78 of file GuiMenu.cxx.

References fEntries, fSubMenus, and GuiMenuEntry::SetEntry().

00080 {
00081     menu.GuiBase::SetName(label);
00082 
00083     GuiMenuEntry* gme = manage(new GuiMenuEntry);
00084     fSubMenus.push_back(&menu);
00085 
00086     if (gmitr == fEntries.end()) 
00087         this->AddPopup(label,&menu);
00088     else
00089         this->AddPopup(label,&menu,(*gmitr)->GetEntry());
00090     gme->SetEntry(this->GetEntry(label));
00091     return fEntries.insert(gmitr,gme);    
00092 }

GuiMenu::GuiMenuList::iterator GuiMenu::Insert ( GuiMenuList::iterator  gmitr,
const char *  label,
SigC::Slot0< void >  slot 
)

Definition at line 61 of file GuiMenu.cxx.

References GuiMenuEntry::Connect(), fEntries, and GuiMenuEntry::SetEntry().

00063 {
00064     GuiMenuEntry* gme = manage(new GuiMenuEntry);
00065     gme->Connect(s);
00066 
00067     //int id = (int)gme;          // evil
00068     Long_t id = (Long_t)gme;          // evil
00069 
00070     if (gmitr == fEntries.end()) 
00071         this->AddEntry(label,id);
00072     else
00073         this->AddEntry(label,id,0,0,(*gmitr)->GetEntry());
00074     gme->SetEntry(this->GetEntry(id));
00075     return fEntries.insert(gmitr,gme);
00076 }

GuiMenu::GuiMenuList::iterator GuiMenu::Insert ( GuiMenuList::iterator  gmitr,
const char *  label 
)

Definition at line 43 of file GuiMenu.cxx.

References fEntries, and GuiMenuEntry::SetEntry().

Referenced by Add(), and insert_menu().

00044 {
00045     GuiMenuEntry* gme = manage(new GuiMenuEntry);
00046 
00047 #ifndef MINOS_TRY64
00048     int id = (int)gme;          // evil
00049 #else
00050     Long64_t id = (Long64_t)gme;  // evil
00051 #endif
00052 
00053     if (gmitr == fEntries.end()) 
00054         this->AddEntry(label,id);
00055     else
00056         this->AddEntry(label,id,0,0,(*gmitr)->GetEntry());
00057     gme->SetEntry(this->GetEntry(id));
00058     return fEntries.insert(gmitr,gme);
00059 }

bool GuiMenu::IsEntryChecked ( int   )  [inline, private]

Definition at line 87 of file GuiMenu.h.

00087 { return false; } // don't use

bool GuiMenu::IsEntryChecked ( GuiMenuList::iterator &  mit  ) 

Definition at line 112 of file GuiMenu.cxx.

Referenced by GfxMCVecListMenu::HideAll(), GfxStripListMenu::HideAll(), GfxShowerListMenu::HideAll(), GfxDigitListMenu::HideAll(), GfxTrackListMenu::HideAll(), EVD::ToggleRealCoords(), MultiPage::ToggleRealCoords(), and EVD::ToggleTimeZoom().

00113 {
00114     GuiMenuEntry* gme = *mit;
00115 #ifndef MINOS_TRY64
00116     return this->TGPopupMenu::IsEntryChecked((int)gme);
00117 #else
00118     return this->TGPopupMenu::IsEntryChecked((Long64_t)gme);
00119 #endif
00120 }


Member Data Documentation

Definition at line 89 of file GuiMenu.h.

Referenced by Add(), ClearAll(), GetMenuList(), Insert(), and ~GuiMenu().

Definition at line 90 of file GuiMenu.h.

Referenced by ClearAll(), and Insert().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1