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

EventDisplay/GfxStripListMenu.cxx

Go to the documentation of this file.
00001 #include "GfxStripListMenu.h"
00002 #include "GfxStripList.h"
00003 #include "GfxProxy.h"
00004 
00005 #include "EVD.h"
00006 
00007 #include <sigc++/sigc++.h>
00008 #include <sigc++/class_slot.h>
00009 using namespace SigC;
00010 
00011 #include <list>
00012 using namespace std;
00013 
00014 extern GfxProxy<GfxStripList> gsGfxStripListProxy;
00015 
00019 GuiMenu* GfxStripListMenu::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,&GfxStripListMenu::HideAll),gfx_menu,mit));
00026 
00027     // hide at program start
00028 
00029     HideAll(gfx_menu,mit);
00030 
00031     return gfx_menu;
00032 }
00033 void GfxStripListMenu::HideAll(GuiMenu* menu, GuiMenu::GuiMenuList::iterator mit)
00034 {
00035     NamedFactory& nf = NamedFactory::Instance("Gfx");
00036     NamedProxy* np = nf.GetProxy("StripList");
00037 
00038     GfxProxy<GfxStripList>* gp = dynamic_cast<GfxProxy<GfxStripList>*>(np);
00039     if (!gp) {
00040         cerr << "Can't get GfxStripList proxy\n";
00041         return;
00042     }
00043 
00044     list<GfxStripList*> dls = gp->GetInstances();
00045     list<GfxStripList*>::iterator lit, done = dls.end();
00046 
00047     bool tf = ! menu->IsEntryChecked(mit);
00048 
00049     menu->CheckEntry(mit,tf);
00050     for (lit = dls.begin(); lit != done; ++lit)
00051         (*lit)->HideStrips(tf);
00052 }

Generated on Mon Nov 23 05:26:55 2009 for loon by  doxygen 1.3.9.1