gui/mapselector.cc
changeset 1884 9c061834b33b
parent 1882 2c3f6c7e01b4
child 1892 1d384b30157f
equal deleted inserted replaced
3:15778ae90518 4:2b28c503fb57
     1 #include "mapselector.h"
     1 #include "mapselector.h"
     2 
     2 
     3 MapSelector::MapSelector(std::vector<std::string> ml, std::string act, int identifier, bool edge):id(identifier),itisedge(edge),set_new_map(false)
     3 MapSelector::MapSelector(std::vector<std::string> ml, std::string act, std::string labeltext, bool edge, bool d):def(d),itisedge(edge),set_new_map(false)
     4 {
     4 {
     5   update_list(ml);
     5   update_list(ml);
     6 
     6 
     7   if(act=="")
     7   if(act=="")
     8     {
     8     {
    20     (
    20     (
    21      sigc::mem_fun((*this), &MapSelector::comboChanged),
    21      sigc::mem_fun((*this), &MapSelector::comboChanged),
    22      false
    22      false
    23      );
    23      );
    24   
    24   
    25   if(itisedge)
    25   label=new Gtk::Label(labeltext);
    26     {
       
    27       label=new Gtk::Label(edge_property_strings[id]);
       
    28     }
       
    29   else
       
    30     {
       
    31       label=new Gtk::Label(node_property_strings[id]);
       
    32     }
       
    33 
    26 
    34   label->set_width_chars(longest_property_string_length);
    27   label->set_width_chars(longest_property_string_length);
    35 
    28 
    36   defbut=new Gtk::Button();
    29   defbut=new Gtk::Button();
    37   defbut->set_label("Reset");
    30   defbut->set_label("Reset");
    69   std::vector< std::string >::iterator emsi=ml.begin();
    62   std::vector< std::string >::iterator emsi=ml.begin();
    70   for(;emsi!=ml.end();emsi++)
    63   for(;emsi!=ml.end();emsi++)
    71     {
    64     {
    72       cbt.append_text(*emsi);
    65       cbt.append_text(*emsi);
    73     }
    66     }
    74   cbt.prepend_text("Default values");
    67   if(def)
       
    68     {
       
    69       cbt.prepend_text("Default values");
       
    70     }
    75   if(prev_act!=-1)
    71   if(prev_act!=-1)
    76     {
    72     {
    77       cbt.set_active(prev_act);
    73       cbt.set_active(prev_act);
    78     }
    74     }
    79 }
    75 }