# HG changeset patch # User hegyi # Date 1130148940 0 # Node ID dc821d2668c191c5bd59e4f99ad97404f925cd3e # Parent 35f667e7dd7e7fdd4d430fa8096c27cdc3a7e05c Newly created map is realized by the property givening by common sense. diff -r 35f667e7dd7e -r dc821d2668c1 gui/map_win.cc --- a/gui/map_win.cc Mon Oct 24 08:12:26 2005 +0000 +++ b/gui/map_win.cc Mon Oct 24 10:15:40 2005 +0000 @@ -92,8 +92,6 @@ //filling in combo box with choices e_combo_array[i]->append_text((Glib::ustring)newmapname); } - //setting text property for the new map - e_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname); } void MapWin::registerNewNodeMap(std::string newmapname) @@ -103,6 +101,4 @@ //filling in combo box with choices n_combo_array[i]->append_text((Glib::ustring)newmapname); } - //setting text property for the new map - n_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname); } diff -r 35f667e7dd7e -r dc821d2668c1 gui/mapselector.cc --- a/gui/mapselector.cc Mon Oct 24 08:12:26 2005 +0000 +++ b/gui/mapselector.cc Mon Oct 24 10:15:40 2005 +0000 @@ -1,6 +1,6 @@ #include "mapselector.h" -MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID) +MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, NewMapWin & newmapw, int identifier, bool edge):gdc(grdispc),ms(mapst),nmw(newmapw),id(identifier),itisedge(edge),default_state(true),set_new_map(false),node_to_update(INVALID),edge_to_update(INVALID) { update_list(); @@ -36,7 +36,7 @@ newbut->signal_pressed().connect ( - sigc::mem_fun(nmw, &NewMapWin::show) + sigc::mem_fun(*this, &MapSelector::new_but_pressed) ); add(*label); @@ -47,6 +47,12 @@ add(*newbut); } +void MapSelector::new_but_pressed() +{ + set_new_map=true; + nmw.showByPreChoose(itisedge); +} + void MapSelector::update_list() { cbt.clear(); @@ -211,4 +217,9 @@ void MapSelector::append_text(Glib::ustring text) { cbt.append_text(text); + if(set_new_map) + { + set_active_text(text); + set_new_map=false; + } } diff -r 35f667e7dd7e -r dc821d2668c1 gui/mapselector.h --- a/gui/mapselector.h Mon Oct 24 08:12:26 2005 +0000 +++ b/gui/mapselector.h Mon Oct 24 10:15:40 2005 +0000 @@ -26,6 +26,8 @@ bool default_state; + bool set_new_map; + Gtk::ComboBoxText cbt; Gtk::Button * newbut, * defbut; @@ -50,6 +52,8 @@ ///to change the visible values of that attribute. virtual void comboChanged(); + virtual void new_but_pressed(); + virtual void reset(); virtual void update(Node node); diff -r 35f667e7dd7e -r dc821d2668c1 gui/new_map_win.cc --- a/gui/new_map_win.cc Mon Oct 24 08:12:26 2005 +0000 +++ b/gui/new_map_win.cc Mon Oct 24 10:15:40 2005 +0000 @@ -60,6 +60,21 @@ } +void NewMapWin::showByPreChoose(bool itisedge) +{ + if(itisedge) + { + edge.set_active(); + } + else + { + node.set_active(); + } + node.hide(); + edge.hide(); + show(); +} + void NewMapWin::buttonPressed() { bool valid_double=true; @@ -102,6 +117,8 @@ { name.set_text(""); default_value.set_text("0"); + edge.show(); + node.show(); hide(); } } diff -r 35f667e7dd7e -r dc821d2668c1 gui/new_map_win.h --- a/gui/new_map_win.h Mon Oct 24 08:12:26 2005 +0000 +++ b/gui/new_map_win.h Mon Oct 24 10:15:40 2005 +0000 @@ -32,6 +32,8 @@ //tells it the attributes.(name, default value) virtual void buttonPressed(); + virtual void showByPreChoose(bool); + virtual bool closeIfEscapeIsPressed(GdkEventKey*); Gtk::Entry name, default_value;