Structure of GUI is now more clear-cut than before.
3 MapWin::MapSelector::MapSelector(std::vector<std::string> ml, int identifier, bool edge):id(identifier),itisedge(edge),default_state(true),set_new_map(false)
9 //binding signal to the actual entry
10 cbt.signal_changed().connect
12 sigc::mem_fun((*this), &MapWin::MapSelector::comboChanged),
18 label=new Gtk::Label(edge_property_strings[id]);
22 label=new Gtk::Label(node_property_strings[id]);
25 label->set_width_chars(longest_property_string_length);
27 defbut=new Gtk::Button();
28 defbut->set_label("Reset");
30 defbut->signal_pressed().connect
32 sigc::mem_fun(*this, &MapWin::MapSelector::reset)
35 newbut=new Gtk::Button(Gtk::Stock::NEW);
37 newbut->signal_pressed().connect
39 sigc::mem_fun(*this, &MapWin::MapSelector::new_but_pressed)
50 void MapWin::MapSelector::new_but_pressed()
53 signal_newmapwin.emit(itisedge);
56 void MapWin::MapSelector::update_list( std::vector< std::string > ml )
59 std::vector< std::string >::iterator emsi=ml.begin();
60 for(;emsi!=ml.end();emsi++)
62 cbt.append_text(*emsi);
64 cbt.prepend_text("Default values");
67 void MapWin::MapSelector::comboChanged()
69 if(cbt.get_active_row_number()!=0)
72 Glib::ustring mapname = cbt.get_active_text();
73 if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
75 signal_cbt.emit(mapname);
78 else if((!default_state)&&(cbt.get_active_row_number()==0))
85 void MapWin::MapSelector::reset()
94 Glib::ustring MapWin::MapSelector::get_active_text()
96 return cbt.get_active_text();
99 void MapWin::MapSelector::set_active_text(Glib::ustring text)
101 cbt.set_active_text(text);
104 void MapWin::MapSelector::append_text(Glib::ustring text)
106 cbt.append_text(text);
109 set_active_text(text);
114 sigc::signal<void, std::string> MapWin::MapSelector::signal_cbt_ch()
119 sigc::signal<void, bool> MapWin::MapSelector::signal_newmapwin_needed()
121 return signal_newmapwin;