gui/algobox.cc
changeset 2029 e00114f165f5
parent 1884 9c061834b33b
equal deleted inserted replaced
3:32397de62c4d 4:80c8c720e01e
   115 
   115 
   116   label=new Gtk::Label("Maps in chosen tab:");
   116   label=new Gtk::Label("Maps in chosen tab:");
   117       
   117       
   118   pack_start(*label);
   118   pack_start(*label);
   119 
   119 
   120   nodemapcbts.resize(NODE_INPUT_NUM);
   120   for(int i=0;i<NODE_INPUT_NUM;i++)
   121   for(int i=0;i<(int)nodemapcbts.size();i++)
       
   122     {
   121     {
   123       std::vector<std::string> empty_vector;
       
   124 
       
   125       std::ostringstream o;
   122       std::ostringstream o;
   126       o << "NodeInput " << i+1 << ":";
   123       o << "NodeInput " << i+1 << ":";
   127 
   124 
   128       nodemapcbts[i]=new MapSelector(empty_vector,"",o.str(),false, false);
   125       addMapSelector(o.str(), false);
   129       nodemapcbts[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoBox::emit_new_map_signal));
       
   130 
       
   131       pack_start(*(nodemapcbts[i]));
       
   132     }
   126     }
   133 
   127 
   134   pack_start(*(new Gtk::HSeparator()));
   128   pack_start(*(new Gtk::HSeparator()));
   135 
   129 
   136   edgemapcbts.resize(EDGE_INPUT_NUM);
   130   for(int i=0;i<EDGE_INPUT_NUM;i++)
   137   for(int i=0;i<(int)edgemapcbts.size();i++)
       
   138     {
   131     {
   139       std::vector<std::string> empty_vector;
       
   140 
   132 
   141       std::ostringstream o;
   133       std::ostringstream o;
   142       o << "EdgeInput " << i+1 << ":";
   134       o << "EdgeInput " << i+1 << ":";
   143 
   135 
   144       edgemapcbts[i]=new MapSelector(empty_vector,"",o.str(),true, false);
   136       addMapSelector(o.str(), true);
   145       edgemapcbts[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoBox::emit_new_map_signal));
       
   146 
       
   147       pack_start(*(edgemapcbts[i]));
       
   148     }
   137     }
   149 
   138 
   150   pack_start(*(new Gtk::HSeparator()));
   139   pack_start(*(new Gtk::HSeparator()));
       
   140 }
       
   141 
       
   142 void AlgoBox::addMapSelector(std::string inputname, bool itisedge)
       
   143 {
       
   144   std::vector<std::string> empty_vector;
       
   145 
       
   146   MapSelector * msp=new MapSelector(empty_vector,"",inputname,itisedge, false);
       
   147 
       
   148   if(itisedge)
       
   149     {
       
   150       edgemapcbts.resize(edgemapcbts.size()+1);
       
   151       edgemapcbts[edgemapcbts.size()-1]=msp;
       
   152     }
       
   153   else
       
   154     {
       
   155       nodemapcbts.resize(nodemapcbts.size()+1);
       
   156       nodemapcbts[nodemapcbts.size()-1]=msp;
       
   157     }
       
   158 
       
   159   msp->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoBox::emit_new_map_signal));
       
   160 
       
   161   pack_start(*msp);
   151 }
   162 }
   152 
   163 
   153 sigc::signal<void, std::string> AlgoBox::signal_maplist_needed()
   164 sigc::signal<void, std::string> AlgoBox::signal_maplist_needed()
   154 {
   165 {
   155   return signal_maplist_need;
   166   return signal_maplist_need;