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

GfxShowerListMenu.cxx

Go to the documentation of this file.
00001 #include "GfxShowerListMenu.h"
00002 #include "GfxShowerList.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 #include <iostream>
00013 using namespace std;
00014 
00015 extern GfxProxy<GfxShowerList> gsGfxShowerListProxy;
00016 
00020 GuiMenu* GfxShowerListMenu::MakeMenu(EVD* /*mp*/)
00021 {
00022     GuiMenu::GuiMenuList::iterator mit;
00023 
00024     GuiMenu* gfx_menu = new GuiMenu;
00025     mit = gfx_menu->Add("Hide all");
00026     (*mit)->Connect(bind(slot_class(*this,&GfxShowerListMenu::HideAll),gfx_menu,mit));
00027 
00028     return gfx_menu;
00029 }
00030 
00031 void GfxShowerListMenu::HideAll(GuiMenu* menu, GuiMenu::GuiMenuList::iterator mit)
00032 {
00033     NamedFactory& nf = NamedFactory::Instance("Gfx");
00034     NamedProxy* np = nf.GetProxy("ShowerList");
00035 
00036     GfxProxy<GfxShowerList>* gp = dynamic_cast<GfxProxy<GfxShowerList>*>(np);
00037     if (!gp) {
00038         cerr << "Can't get GfxShowerList proxy\n";
00039         return;
00040     }
00041 
00042     list<GfxShowerList*> dls = gp->GetInstances();
00043     list<GfxShowerList*>::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)->HideShowers(tf);
00050 }

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