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

Midad/MultiPage/GfxStripListMenu.cxx

Go to the documentation of this file.
00001 #include "GfxStripListMenu.h"
00002 #include "GfxStripList.h"
00003 #include "GfxProxy.h"
00004 
00005 #include "MultiPage.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(MultiPage* /*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     return gfx_menu;
00028 }
00029 void GfxStripListMenu::HideAll(GuiMenu* menu, GuiMenu::GuiMenuList::iterator mit)
00030 {
00031     NamedFactory& nf = NamedFactory::Instance("Gfx");
00032     NamedProxy* np = nf.GetProxy("StripList");
00033 
00034     GfxProxy<GfxStripList>* gp = dynamic_cast<GfxProxy<GfxStripList>*>(np);
00035     if (!gp) {
00036         cerr << "Can't get GfxStripList proxy\n";
00037         return;
00038     }
00039 
00040     list<GfxStripList*> dls = gp->GetInstances();
00041     list<GfxStripList*>::iterator lit, done = dls.end();
00042 
00043     bool tf = ! menu->IsEntryChecked(mit);
00044 
00045     menu->CheckEntry(mit,tf);
00046     for (lit = dls.begin(); lit != done; ++lit)
00047         (*lit)->HideStrips(tf);
00048 }

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