algobox.cc
branchgui
changeset 114 0ace7edbb06f
parent 109 9f8dc346ac6e
child 116 2bd795bb9984
equal deleted inserted replaced
2:9727f248ff73 3:32397de62c4d
    71       nml=mapstorage->getNodeMapList();
    71       nml=mapstorage->getNodeMapList();
    72       eml=mapstorage->getEdgeMapList();
    72       eml=mapstorage->getEdgeMapList();
    73     }
    73     }
    74   for(int i=0;i<(int)nodemapcbts.size();i++)
    74   for(int i=0;i<(int)nodemapcbts.size();i++)
    75     {
    75     {
    76       update_cbt(nml, *(nodemapcbts[i]));
    76       (nodemapcbts[i])->update_list(nml);
       
    77       //update_cbt(nml, *(nodemapcbts[i]));
    77     }
    78     }
    78   for(int i=0;i<(int)edgemapcbts.size();i++)
    79   for(int i=0;i<(int)edgemapcbts.size();i++)
    79     {
    80     {
    80       update_cbt(eml, *(edgemapcbts[i]));
    81       (edgemapcbts[i])->update_list(eml);
       
    82       //update_cbt(eml, *(edgemapcbts[i]));
    81     }
    83     }
    82 }
    84 }
    83 
    85 
    84 void AlgoBox::nodemaplist_changed(std::string newmap)
    86 void AlgoBox::nodemaplist_changed(std::string newmap)
    85 {
    87 {
   104 
   106 
   105 void AlgoBox::build_box()
   107 void AlgoBox::build_box()
   106 {
   108 {
   107   pack_start(*(new Gtk::HSeparator()));
   109   pack_start(*(new Gtk::HSeparator()));
   108 
   110 
   109   label=new Gtk::Label("Specific part for each algorithm.");
   111   Gtk::Label * label=new Gtk::Label("Specific part for each algorithm.");
   110       
   112       
   111   pack_start(*label);
   113   pack_start(*label);
   112   pack_start(*(new Gtk::HSeparator()));
   114   pack_start(*(new Gtk::HSeparator()));
   113 
   115 
   114   label=new Gtk::Label("Maps in chosen tab:");
   116   label=new Gtk::Label("Maps in chosen tab:");
   116   pack_start(*label);
   118   pack_start(*label);
   117 
   119 
   118   nodemapcbts.resize(NODE_INPUT_NUM);
   120   nodemapcbts.resize(NODE_INPUT_NUM);
   119   for(int i=0;i<(int)nodemapcbts.size();i++)
   121   for(int i=0;i<(int)nodemapcbts.size();i++)
   120     {
   122     {
   121       Gtk::HBox * hbox=new Gtk::HBox();
   123       std::vector<std::string> empty_vector;
   122 
   124 
   123       std::ostringstream o;
   125       std::ostringstream o;
   124       o << "NodeInput " << i+1 << ":";
   126       o << "NodeInput " << i+1 << ":";
   125       label=new Gtk::Label(o.str());
       
   126 
   127 
   127       nodemapcbts[i]=new Gtk::ComboBoxText();
   128       nodemapcbts[i]=new MapSelector(empty_vector,"",o.str(),false, false);
       
   129       nodemapcbts[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoBox::emit_new_map_signal));
   128 
   130 
   129       hbox->pack_start(*label);
   131       pack_start(*(nodemapcbts[i]));
   130       hbox->pack_start(*(nodemapcbts[i]));
       
   131       pack_start(*hbox);
       
   132     }
   132     }
   133 
   133 
   134   pack_start(*(new Gtk::HSeparator()));
   134   pack_start(*(new Gtk::HSeparator()));
   135 
   135 
   136   edgemapcbts.resize(EDGE_INPUT_NUM);
   136   edgemapcbts.resize(EDGE_INPUT_NUM);
   137   for(int i=0;i<(int)edgemapcbts.size();i++)
   137   for(int i=0;i<(int)edgemapcbts.size();i++)
   138     {
   138     {
   139       Gtk::HBox * hbox=new Gtk::HBox();
   139       std::vector<std::string> empty_vector;
   140 
   140 
   141       std::ostringstream o;
   141       std::ostringstream o;
   142       o << "EdgeInput " << i+1 << ":";
   142       o << "EdgeInput " << i+1 << ":";
   143       label=new Gtk::Label(o.str());
       
   144 
   143 
   145       edgemapcbts[i]=new Gtk::ComboBoxText();
   144       edgemapcbts[i]=new MapSelector(empty_vector,"",o.str(),true, false);
       
   145       edgemapcbts[i]->signal_newmapwin_needed().connect(sigc::mem_fun(*this, &AlgoBox::emit_new_map_signal));
   146 
   146 
   147       hbox->pack_start(*label);
   147       pack_start(*(edgemapcbts[i]));
   148       hbox->pack_start(*(edgemapcbts[i]));
       
   149       pack_start(*hbox);
       
   150     }
   148     }
   151 
   149 
   152   pack_start(*(new Gtk::HSeparator()));
   150   pack_start(*(new Gtk::HSeparator()));
   153 }
   151 }
   154 
   152 
   168     {
   166     {
   169       std::vector<std::string> empty_vector;
   167       std::vector<std::string> empty_vector;
   170       update_maplist(NULL);
   168       update_maplist(NULL);
   171     }
   169     }
   172 }
   170 }
       
   171 
       
   172 void AlgoBox::emit_new_map_signal(bool itisedge)
       
   173 {
       
   174   signal_newmapwin_need.emit(tabcbt.get_active_text(), itisedge);
       
   175 }