Changeset 108:bf355fd6563e in glemon-0.x for algobox.cc
- Timestamp:
- 01/05/06 13:30:09 (18 years ago)
- Branch:
- gui
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2453
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
algobox.cc
r106 r108 4 4 enum {E_DEMO1, EDGE_INPUT_NUM}; // input IDs for edges; 5 5 6 AlgoBox::AlgoBox(std::vector<std::string> tabnames , std::vector<std::string> nodemapnames, std::vector<std::string> edgemapnames)6 AlgoBox::AlgoBox(std::vector<std::string> tabnames) 7 7 { 8 init(tabnames , nodemapnames, edgemapnames);8 init(tabnames); 9 9 } 10 10 11 void AlgoBox::init(std::vector<std::string> tabnames , std::vector<std::string> nodemapnames, std::vector<std::string> edgemapnames)11 void AlgoBox::init(std::vector<std::string> tabnames) 12 12 { 13 13 set_spacing(5); … … 19 19 20 20 pack_start(tabcbt); 21 22 21 build_box(); 23 24 update_maplist(nodemapnames, edgemapnames);25 22 26 23 show_all_children(); … … 53 50 else if(actptr>0) //so there is item in the list 54 51 { 55 cbt.set_active(0);52 //cbt.set_active(0); 56 53 } 57 54 } … … 63 60 } 64 61 65 void AlgoBox::update_maplist( std::vector< std::string > nml, std::vector< std::string > eml)62 void AlgoBox::update_maplist( void * ms) 66 63 { 64 mapstorage=(MapStorage *)ms; 65 std::vector<std::string> nml; 66 std::vector<std::string> eml; 67 if(mapstorage!=NULL) 68 { 69 mapstorage->signal_node_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::nodemaplist_changed)); 70 mapstorage->signal_edge_map_ch().connect(sigc::mem_fun(*this, &AlgoBox::edgemaplist_changed)); 71 nml=mapstorage->getNodeMapList(); 72 eml=mapstorage->getNodeMapList(); 73 } 67 74 for(int i=0;i<(int)nodemapcbts.size();i++) 68 75 { … … 72 79 { 73 80 update_cbt(eml, *(edgemapcbts[i])); 81 } 82 } 83 84 void AlgoBox::nodemaplist_changed(std::string newmap) 85 { 86 for(int i=0;i<(int)nodemapcbts.size();i++) 87 { 88 (nodemapcbts[i])->append_text(newmap); 89 } 90 } 91 92 void AlgoBox::edgemaplist_changed(std::string newmap) 93 { 94 for(int i=0;i<(int)edgemapcbts.size();i++) 95 { 96 (edgemapcbts[i])->append_text(newmap); 74 97 } 75 98 } … … 137 160 void AlgoBox::emit_tab_change() 138 161 { 139 signal_maplist_need.emit(tabcbt.get_active_text()); 162 std::string active_tab=tabcbt.get_active_text(); 163 if(active_tab!="") 164 { 165 signal_maplist_need.emit(active_tab); 166 } 167 else 168 { 169 std::vector<std::string> empty_vector; 170 update_maplist(NULL); 171 } 140 172 }
Note: See TracChangeset
for help on using the changeset viewer.