gui/algobox.h
changeset 1876 5ad84ad1b68f
parent 1871 3905d347112c
child 1878 409a31271efd
     1.1 --- a/gui/algobox.h	Wed Jan 04 13:31:59 2006 +0000
     1.2 +++ b/gui/algobox.h	Wed Jan 04 18:05:55 2006 +0000
     1.3 @@ -11,52 +11,31 @@
     1.4  
     1.5  class AlgoBox : public Gtk::VBox
     1.6  {
     1.7 +  sigc::signal<void, std::string> signal_maplist_need;  
     1.8    
     1.9 +  Gtk::ComboBoxText tabcbt;
    1.10 +
    1.11 +protected:
    1.12    Gtk::Label * label;
    1.13 -  Gtk::ComboBoxText cbt;
    1.14 +  std::vector<Gtk::ComboBoxText *> nodemapcbts;
    1.15 +  std::vector<Gtk::ComboBoxText *> edgemapcbts;
    1.16    
    1.17 - public:
    1.18 -  AlgoBox(std::vector<std::string> tabnames)
    1.19 -    {
    1.20 -      update_tablist(tabnames);
    1.21 +public:
    1.22 +  AlgoBox(){};
    1.23 +  AlgoBox(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>);
    1.24  
    1.25 -      label=new Gtk::Label("Haliho");
    1.26 -      
    1.27 -      pack_start(*label);
    1.28 -      pack_start(cbt);
    1.29 +  virtual void init(std::vector<std::string>, std::vector<std::string>, std::vector<std::string>);
    1.30  
    1.31 -      show_all_children();
    1.32 -    };
    1.33 +  sigc::signal<void, std::string> signal_maplist_needed();  
    1.34 +  void emit_tab_change();
    1.35  
    1.36 -  void update_tablist( std::vector< std::string > tl )
    1.37 -    {
    1.38 -      std::string actname=cbt.get_active_text();
    1.39 -      int prev_act=-1;
    1.40 +  void update_tablist( std::vector< std::string > tl );
    1.41 +  void update_maplist( std::vector< std::string >, std::vector< std::string >);
    1.42  
    1.43 -      cbt.clear();
    1.44 -      int actptr=0;
    1.45 -
    1.46 -      std::vector< std::string >::iterator emsi=tl.begin();
    1.47 -      for(;emsi!=tl.end();emsi++)
    1.48 -	{
    1.49 -	  if(actname==*emsi)
    1.50 -	    {
    1.51 -	      prev_act=actptr;
    1.52 -	    }
    1.53 -
    1.54 -	  cbt.append_text(*emsi);
    1.55 -	  actptr++;
    1.56 -	}
    1.57 -
    1.58 -      if(prev_act!=-1)
    1.59 -	{
    1.60 -	  cbt.set_active(prev_act);
    1.61 -	}
    1.62 -      else if(actptr>0) //so there is item in the list
    1.63 -	{
    1.64 -	  cbt.set_active(0);
    1.65 -	}
    1.66 -    }
    1.67 -
    1.68 +  void update_cbt( std::vector< std::string > tl, Gtk::ComboBoxText &);
    1.69 +  
    1.70 +  virtual void run();
    1.71 +  
    1.72 +  virtual void build_box();
    1.73  };
    1.74  #endif //ALGOBOX_H