Newly created map is realized by the property givening by common sense.
authorhegyi
Mon, 24 Oct 2005 10:15:40 +0000
changeset 1737dc821d2668c1
parent 1736 35f667e7dd7e
child 1738 470aa67893f5
Newly created map is realized by the property givening by common sense.
gui/map_win.cc
gui/mapselector.cc
gui/mapselector.h
gui/new_map_win.cc
gui/new_map_win.h
     1.1 --- a/gui/map_win.cc	Mon Oct 24 08:12:26 2005 +0000
     1.2 +++ b/gui/map_win.cc	Mon Oct 24 10:15:40 2005 +0000
     1.3 @@ -92,8 +92,6 @@
     1.4      //filling in combo box with choices
     1.5      e_combo_array[i]->append_text((Glib::ustring)newmapname);
     1.6    }
     1.7 -  //setting text property for the new map
     1.8 -  e_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
     1.9  }
    1.10  
    1.11  void MapWin::registerNewNodeMap(std::string newmapname)
    1.12 @@ -103,6 +101,4 @@
    1.13      //filling in combo box with choices
    1.14      n_combo_array[i]->append_text((Glib::ustring)newmapname);
    1.15    }
    1.16 -  //setting text property for the new map
    1.17 -  n_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
    1.18  }
     2.1 --- a/gui/mapselector.cc	Mon Oct 24 08:12:26 2005 +0000
     2.2 +++ b/gui/mapselector.cc	Mon Oct 24 10:15:40 2005 +0000
     2.3 @@ -1,6 +1,6 @@
     2.4  #include "mapselector.h"
     2.5  
     2.6 -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)
     2.7 +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)
     2.8  {
     2.9    update_list();
    2.10  
    2.11 @@ -36,7 +36,7 @@
    2.12  
    2.13    newbut->signal_pressed().connect
    2.14      (
    2.15 -     sigc::mem_fun(nmw, &NewMapWin::show)
    2.16 +     sigc::mem_fun(*this, &MapSelector::new_but_pressed)
    2.17       );
    2.18  
    2.19    add(*label);
    2.20 @@ -47,6 +47,12 @@
    2.21    add(*newbut);
    2.22  }
    2.23  
    2.24 +void MapSelector::new_but_pressed()
    2.25 +{
    2.26 +  set_new_map=true;
    2.27 +  nmw.showByPreChoose(itisedge);
    2.28 +}
    2.29 +
    2.30  void MapSelector::update_list()
    2.31  {
    2.32    cbt.clear();
    2.33 @@ -211,4 +217,9 @@
    2.34  void MapSelector::append_text(Glib::ustring text)
    2.35  {
    2.36    cbt.append_text(text);
    2.37 +  if(set_new_map)
    2.38 +    {
    2.39 +      set_active_text(text);
    2.40 +      set_new_map=false;
    2.41 +    }
    2.42  }
     3.1 --- a/gui/mapselector.h	Mon Oct 24 08:12:26 2005 +0000
     3.2 +++ b/gui/mapselector.h	Mon Oct 24 10:15:40 2005 +0000
     3.3 @@ -26,6 +26,8 @@
     3.4  
     3.5    bool default_state;
     3.6  
     3.7 +  bool set_new_map;
     3.8 +
     3.9    Gtk::ComboBoxText cbt;
    3.10  
    3.11    Gtk::Button * newbut, * defbut;
    3.12 @@ -50,6 +52,8 @@
    3.13    ///to change the visible values of that attribute.
    3.14    virtual void comboChanged();
    3.15  
    3.16 +  virtual void new_but_pressed();
    3.17 +
    3.18    virtual void reset();
    3.19  
    3.20    virtual void update(Node node);
     4.1 --- a/gui/new_map_win.cc	Mon Oct 24 08:12:26 2005 +0000
     4.2 +++ b/gui/new_map_win.cc	Mon Oct 24 10:15:40 2005 +0000
     4.3 @@ -60,6 +60,21 @@
     4.4  
     4.5  }
     4.6  
     4.7 +void NewMapWin::showByPreChoose(bool itisedge)
     4.8 +{
     4.9 +  if(itisedge)
    4.10 +    {
    4.11 +      edge.set_active();
    4.12 +    }
    4.13 +  else
    4.14 +    {
    4.15 +      node.set_active();
    4.16 +    }
    4.17 +  node.hide();
    4.18 +  edge.hide();
    4.19 +  show();
    4.20 +}
    4.21 +
    4.22  void NewMapWin::buttonPressed()
    4.23  {
    4.24    bool valid_double=true;
    4.25 @@ -102,6 +117,8 @@
    4.26  	{
    4.27  	  name.set_text("");
    4.28  	  default_value.set_text("0");
    4.29 +	  edge.show();
    4.30 +	  node.show();
    4.31  	  hide();
    4.32  	}
    4.33      }
     5.1 --- a/gui/new_map_win.h	Mon Oct 24 08:12:26 2005 +0000
     5.2 +++ b/gui/new_map_win.h	Mon Oct 24 10:15:40 2005 +0000
     5.3 @@ -32,6 +32,8 @@
     5.4    //tells it the attributes.(name, default value)
     5.5    virtual void buttonPressed();
     5.6  
     5.7 +  virtual void showByPreChoose(bool);
     5.8 +
     5.9    virtual bool closeIfEscapeIsPressed(GdkEventKey*);
    5.10  
    5.11    Gtk::Entry name, default_value;