Changeset 1876:5ad84ad1b68f in lemon-0.x for gui/algobox.h
- Timestamp:
- 01/04/06 19:05:55 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2451
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/algobox.h
r1871 r1876 12 12 class AlgoBox : public Gtk::VBox 13 13 { 14 sigc::signal<void, std::string> signal_maplist_need; 14 15 16 Gtk::ComboBoxText tabcbt; 17 18 protected: 15 19 Gtk::Label * label; 16 Gtk::ComboBoxText cbt; 20 std::vector<Gtk::ComboBoxText *> nodemapcbts; 21 std::vector<Gtk::ComboBoxText *> edgemapcbts; 17 22 18 public: 19 AlgoBox(std::vector<std::string> tabnames) 20 { 21 update_tablist(tabnames); 23 public: 24 AlgoBox(){}; 25 AlgoBox(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>); 22 26 23 label=new Gtk::Label("Haliho"); 24 25 pack_start(*label); 26 pack_start(cbt); 27 virtual void init(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>); 27 28 28 show_all_children();29 };29 sigc::signal<void, std::string> signal_maplist_needed(); 30 void emit_tab_change(); 30 31 31 void update_tablist( std::vector< std::string > tl ) 32 { 33 std::string actname=cbt.get_active_text(); 34 int prev_act=-1; 32 void update_tablist( std::vector< std::string > tl ); 33 void update_maplist( std::vector< std::string >, std::vector< std::string >); 35 34 36 cbt.clear(); 37 int actptr=0; 38 39 std::vector< std::string >::iterator emsi=tl.begin(); 40 for(;emsi!=tl.end();emsi++) 41 { 42 if(actname==*emsi) 43 { 44 prev_act=actptr; 45 } 46 47 cbt.append_text(*emsi); 48 actptr++; 49 } 50 51 if(prev_act!=-1) 52 { 53 cbt.set_active(prev_act); 54 } 55 else if(actptr>0) //so there is item in the list 56 { 57 cbt.set_active(0); 58 } 59 } 60 35 void update_cbt( std::vector< std::string > tl, Gtk::ComboBoxText &); 36 37 virtual void run(); 38 39 virtual void build_box(); 61 40 }; 62 41 #endif //ALGOBOX_H
Note: See TracChangeset
for help on using the changeset viewer.