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

EventDisplay/GfxDigitListMenu.cxx

Go to the documentation of this file.
00001 #include "GfxDigitListMenu.h"
00002 #include "GfxDigitList.h"
00003 #include "GfxProxy.h"
00004 
00005 #include "EVD.h"
00006 #include <sigc++/sigc++.h>
00007 #include <sigc++/class_slot.h>
00008 using namespace SigC;
00009 
00010 #include <list>
00011 #include <iostream>
00012 using namespace std;
00013 
00014 extern GfxProxy<GfxDigitList> gsGfxDigitListProxy;
00015 
00019 GuiMenu* GfxDigitListMenu::MakeMenu(EVD* /* mp */)
00020 {
00021     GuiMenu::GuiMenuList::iterator mit;
00022 
00023     GuiMenu* gfx_menu = new GuiMenu;
00024     mit = gfx_menu->Add("Hide all");
00025     (*mit)->Connect(bind(slot_class(*this,&GfxDigitListMenu::HideAll),gfx_menu,mit));
00026     //    HideAll(gfx_menu,mit);
00027     return gfx_menu;
00028 }
00029 
00030 
00031 void GfxDigitListMenu::HideAll(GuiMenu* menu, GuiMenu::GuiMenuList::iterator mit)
00032 {
00033     NamedFactory& nf = NamedFactory::Instance("Gfx");
00034     NamedProxy* np = nf.GetProxy("DigitList");
00035 
00036     GfxProxy<GfxDigitList>* gp = dynamic_cast<GfxProxy<GfxDigitList>*>(np);
00037     if (!gp) {
00038         cerr << "Can't get GfxDigitList proxy\n";
00039         return;
00040     }
00041 
00042     list<GfxDigitList*> dls = gp->GetInstances();
00043     list<GfxDigitList*>::iterator lit, done = dls.end();
00044 
00045     bool tf = ! menu->IsEntryChecked(mit);
00046 
00047     menu->CheckEntry(mit,tf);
00048     for (lit = dls.begin(); lit != done; ++lit)
00049         (*lit)->HideDigits(tf);
00050 }
00051 

Generated on Mon Feb 15 11:06:46 2010 for loon by  doxygen 1.3.9.1