Index: gui/Makefile.am
===================================================================
--- gui/Makefile.am	(revision 1659)
+++ gui/Makefile.am	(revision 1731)
@@ -27,5 +27,8 @@
 	new_map_win.h \
 	xymap.h \
-	icons/guipixbufs.h
+	icons/guipixbufs.h\
+	mapselector.h\
+	mapselector.cc
+
 
 glemon_CXXFLAGS = $(GTK_CFLAGS)
Index: gui/all_include.h
===================================================================
--- gui/all_include.h	(revision 1651)
+++ gui/all_include.h	(revision 1731)
@@ -33,4 +33,5 @@
 extern std::vector <std::string> node_property_strings;
 extern std::vector <double> node_property_defaults;
+extern int longest_property_string_length;
 #endif //MAIN_PART
 
Index: gui/graph-displayer.cc
===================================================================
--- gui/graph-displayer.cc	(revision 1650)
+++ gui/graph-displayer.cc	(revision 1731)
@@ -11,5 +11,5 @@
 std::vector <std::string> node_property_strings;
 std::vector <double> node_property_defaults;
-
+int longest_property_string_length;
 
 int main(int argc, char *argv[])
@@ -38,4 +38,23 @@
   node_property_defaults[N_TEXT]=0;
 
+  longest_property_string_length=0;
+  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
+    {
+      int j=edge_property_strings[i].size();
+      if(j>longest_property_string_length)
+	{
+	  longest_property_string_length=j;
+	}
+    }
+  for(int i=0;i<NODE_PROPERTY_NUM;i++)
+    {
+      int j=node_property_strings[i].size();
+      if(j>longest_property_string_length)
+	{
+	  longest_property_string_length=j;
+	}
+    }
+
+
   //initializing GUI
 
Index: gui/graph_displayer_canvas-edge.cc
===================================================================
--- gui/graph_displayer_canvas-edge.cc	(revision 1645)
+++ gui/graph_displayer_canvas-edge.cc	(revision 1731)
@@ -4,22 +4,13 @@
 
 
-int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
+int GraphDisplayerCanvas::resetEdgeWidth (Edge edge)
 {
   Graph::EdgeMap<double> * actual_map;
   double min, max;
 
-  if(mapname=="Default")
-    {
-      min=edge_property_defaults[E_WIDTH];
-      max=edge_property_defaults[E_WIDTH];
-      actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_WIDTH]);
-    }
-  else
-    {
-      min=mapstorage.minOfEdgeMap(mapname);
-      max=mapstorage.maxOfEdgeMap(mapname);
-      actual_map=(mapstorage.edgemap_storage)[mapname];
-    }
-
+  min=edge_property_defaults[E_WIDTH];
+  max=edge_property_defaults[E_WIDTH];
+  actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_WIDTH]);
+  
   if(edge==INVALID)
     {
@@ -48,4 +39,42 @@
     }
   return 0;
+}
+
+
+int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
+{
+  Graph::EdgeMap<double> * actual_map;
+  double min, max;
+
+  min=mapstorage.minOfEdgeMap(mapname);
+  max=mapstorage.maxOfEdgeMap(mapname);
+  actual_map=(mapstorage.edgemap_storage)[mapname];
+
+  if(edge==INVALID)
+    {
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  double v=fabs((*actual_map)[i]);
+	  int w;
+	  if(min==max)
+	    {
+	      w=(int)(edge_property_defaults[E_WIDTH]);
+	    }
+	  else
+	    {
+	      w=(int)(MIN_EDGE_WIDTH+(v-min)/(max-min)*(MAX_EDGE_WIDTH-MIN_EDGE_WIDTH));
+	    }
+	  edgesmap[i]->property_width_units().set_value(w);
+	}
+    }
+  else
+    {
+      int w=(int)(*actual_map)[edge];
+      if(w>=0)
+	{
+	  edgesmap[edge]->property_width_units().set_value(w);
+	}
+    }
+  return 0;
 };
 
@@ -57,25 +86,62 @@
   //green in RGB
   Graph::EdgeMap<double> * actual_map;
-  if(mapname=="Default")
-    {
-      actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_COLOR]);
-    }
-  else
-    {
-      actual_map=(mapstorage.edgemap_storage)[mapname];
-    }
+  actual_map=(mapstorage.edgemap_storage)[mapname];
 
   double max, min;
 
-  if(mapname!="Default")
-    {
-      max=mapstorage.maxOfEdgeMap(mapname);
-      min=mapstorage.minOfEdgeMap(mapname);
-    }
-  else
-    {
-      max=edge_property_defaults[E_COLOR];
-      min=edge_property_defaults[E_COLOR];
-    }
+  max=mapstorage.maxOfEdgeMap(mapname);
+  min=mapstorage.minOfEdgeMap(mapname);
+
+  if(edge==INVALID)
+    {
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  double w=(*actual_map)[i];
+
+	  Gdk::Color color;
+	  if(max!=min)
+	    {
+	      color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
+	    }
+	  else
+	    {
+	      color.set_rgb_p (0, 100, 0);
+	    }
+	  edgesmap[i]->property_fill_color_gdk().set_value(color);
+	}
+    }
+  else
+    {
+      Gdk::Color color;
+
+      double w=(*actual_map)[edge];
+
+      if(max!=min)
+	{
+	  color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
+	}
+      else
+	{
+	  color.set_rgb_p (0, 100, 0);
+	}
+
+      edgesmap[edge]->property_fill_color_gdk().set_value(color);
+    }
+  return 0;
+};
+
+int GraphDisplayerCanvas::resetEdgeColor (Edge edge)
+{  
+
+  //function maps the range of the maximum and
+  //the minimum of the nodemap to the range of
+  //green in RGB
+  Graph::EdgeMap<double> * actual_map;
+  actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_COLOR]);
+
+  double max, min;
+
+  max=edge_property_defaults[E_COLOR];
+  min=edge_property_defaults[E_COLOR];
 
   if(edge==INVALID)
@@ -128,26 +194,16 @@
       for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
-	  if(mapname!="Default")
-	    {
-	      edgemap_to_edit=mapname;
-	      double number=(*(mapstorage.edgemap_storage)[mapname])[i];
-
-	      std::ostringstream ostr;
-	      ostr << number;
-	      
-      	      edgetextmap[i]->property_text().set_value(ostr.str());
-	    }
-	  else
-	    {
-	      edgemap_to_edit="";
-	      edgetextmap[i]->property_text().set_value("");
-	    }
-	}
-
-    }
-  else
-    {
-      if(mapname!="Default")
-	{
+	  edgemap_to_edit=mapname;
+	  double number=(*(mapstorage.edgemap_storage)[mapname])[i];
+	  
+	  std::ostringstream ostr;
+	  ostr << number;
+	  
+	  edgetextmap[i]->property_text().set_value(ostr.str());
+	}
+
+    }
+  else
+    {
 	  double number=(*(mapstorage.edgemap_storage)[mapname])[edge];
 
@@ -156,13 +212,32 @@
 	  
 	  edgetextmap[edge]->property_text().set_value(ostr.str());
-	}
-      else
-	{
-	  edgetextmap[edge]->property_text().set_value("");
-	}
-	  
-    }
-
-  return 0;
-
-};
+    }
+
+  return 0;
+
+};
+
+int GraphDisplayerCanvas::resetEdgeText (Edge edge)
+{
+  //the number in the map will be written on the edge
+  //EXCEPT when the name of the map is Default, because
+  //in that case empty string will be written, because
+  //that is the deleter map
+  
+  if(edge==INVALID)
+    {
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  edgemap_to_edit="";
+	  edgetextmap[i]->property_text().set_value("");
+	}
+
+    }
+  else
+    {
+      edgetextmap[edge]->property_text().set_value("");
+    }
+
+  return 0;
+
+};
Index: gui/graph_displayer_canvas-node.cc
===================================================================
--- gui/graph_displayer_canvas-node.cc	(revision 1643)
+++ gui/graph_displayer_canvas-node.cc	(revision 1731)
@@ -8,16 +8,7 @@
   Graph::NodeMap<double> * actual_map;
   double min, max;
-  if(mapname=="Default")
-    {
-      min=node_property_defaults[N_RADIUS];
-      max=node_property_defaults[N_RADIUS];
-      actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_RADIUS]);
-    }
-  else
-    {
-      min=mapstorage.minOfNodeMap(mapname);
-      max=mapstorage.maxOfNodeMap(mapname);
-      actual_map=(mapstorage.nodemap_storage)[mapname];
-    }
+  min=mapstorage.minOfNodeMap(mapname);
+  max=mapstorage.maxOfNodeMap(mapname);
+  actual_map=(mapstorage.nodemap_storage)[mapname];
 
   if(node==INVALID)
@@ -70,4 +61,61 @@
 };
 
+int GraphDisplayerCanvas::resetNodeRadius (Node node)
+{
+  Graph::NodeMap<double> * actual_map;
+  double min, max;
+  min=node_property_defaults[N_RADIUS];
+  max=node_property_defaults[N_RADIUS];
+  actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_RADIUS]);
+  
+  if(node==INVALID)
+    {
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  double v=fabs((*actual_map)[i]);
+	  int w;
+	  if(min==max)
+	    {
+	      w=(int)(node_property_defaults[N_RADIUS]);
+	    }
+	  else
+	    {
+	      w=(int)(MIN_NODE_RADIUS+(v-min)/(max-min)*(MAX_NODE_RADIUS-MIN_NODE_RADIUS));
+	    }
+	  if(w>=0)
+	    {
+	      double x1, y1, x2, y2;
+	      x1=nodesmap[i]->property_x1().get_value();
+	      x2=nodesmap[i]->property_x2().get_value();
+	      y1=nodesmap[i]->property_y1().get_value();
+	      y2=nodesmap[i]->property_y2().get_value();
+	      nodesmap[i]->property_x1().set_value((x1+x2)/2-w);
+	      nodesmap[i]->property_x2().set_value((x1+x2)/2+w);
+	      nodesmap[i]->property_y1().set_value((y1+y2)/2-w);
+	      nodesmap[i]->property_y2().set_value((y1+y2)/2+w);
+	    }
+	}
+    }
+  else
+    {
+      //I think only new nodes use this case
+//       int w=(int)(*actual_map)[node];
+      int w=(int)(node_property_defaults[N_RADIUS]);
+      if(w>=0)
+	{
+	  double x1, y1, x2, y2;
+	  x1=nodesmap[node]->property_x1().get_value();
+	  x2=nodesmap[node]->property_x2().get_value();
+	  y1=nodesmap[node]->property_y1().get_value();
+	  y2=nodesmap[node]->property_y2().get_value();
+	  nodesmap[node]->property_x1().set_value((x1+x2)/2-w);
+	  nodesmap[node]->property_x2().set_value((x1+x2)/2+w);
+	  nodesmap[node]->property_y1().set_value((y1+y2)/2-w);
+	  nodesmap[node]->property_y2().set_value((y1+y2)/2+w);
+	}
+    }
+  return 0;
+};
+
 int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Node node)
 {  
@@ -78,26 +126,66 @@
 
   Graph::NodeMap<double> * actual_map;
-  if(mapname=="Default")
-    {
-      actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_COLOR]);
-    }
-  else
-    {
-      actual_map=(mapstorage.nodemap_storage)[mapname];
-    }
+  actual_map=(mapstorage.nodemap_storage)[mapname];
 
   double max, min;
 
-  if(mapname!="Default")
-    {
-      max=mapstorage.maxOfNodeMap(mapname);
-      min=mapstorage.minOfNodeMap(mapname);
-    }
-  else
-    {
-      max=node_property_defaults[N_COLOR];
-      min=node_property_defaults[N_COLOR];
-    }
-
+  max=mapstorage.maxOfNodeMap(mapname);
+  min=mapstorage.minOfNodeMap(mapname);
+
+  if(node==INVALID)
+    {
+
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  Gdk::Color color;
+
+	  double w=(*actual_map)[i];
+
+	  if(max!=min)
+	    {
+	      color.set_rgb_p (0, 0, 100*(w-min)/(max-min));
+	    }
+	  else
+	    {
+	      color.set_rgb_p (0, 0, 100);
+	    }
+
+	  nodesmap[i]->property_fill_color_gdk().set_value(color);
+	}
+    }
+  else
+    {
+      Gdk::Color color;
+
+      double w=(*actual_map)[node];
+
+      if(max!=min)
+	{
+	  color.set_rgb_p (0, 0, 100*(w-min)/(max-min));
+	}
+      else
+	{
+	  color.set_rgb_p (0, 0, 100);
+	}
+
+      nodesmap[node]->property_fill_color_gdk().set_value(color);
+    }
+  return 0;
+};
+
+int GraphDisplayerCanvas::resetNodeColor (Node node)
+{  
+
+  //function maps the range of the maximum and
+  //the minimum of the nodemap to the range of
+  //green in RGB
+
+  Graph::NodeMap<double> * actual_map;
+  actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_COLOR]);
+
+  double max, min;
+
+  max=node_property_defaults[N_COLOR];
+  min=node_property_defaults[N_COLOR];
 
   if(node==INVALID)
@@ -151,46 +239,51 @@
 
   Graph::NodeMap<double> * actual_map=NULL;
-  if(mapname!="Default")
-    {
-      actual_map=(mapstorage.nodemap_storage)[mapname];
-    }
-
-  if(node==INVALID)
-    {
-      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
-	{
-	  if(mapname!="Default")
-	    {
-	      nodemap_to_edit=mapname;
-	      double number=(*actual_map)[i];
-
-	      std::ostringstream ostr;
-	      ostr << number;
-	      
-      	      nodetextmap[i]->property_text().set_value(ostr.str());
-	    }
-	  else
-	    {
-	      nodemap_to_edit="";
-	      nodetextmap[i]->property_text().set_value("");
-	    }
-	}
-    }
-  else
-    {
-      if(mapname!="Default")
-	{
-	  double number=(*actual_map)[node];
+  actual_map=(mapstorage.nodemap_storage)[mapname];
+
+  if(node==INVALID)
+    {
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  nodemap_to_edit=mapname;
+	  double number=(*actual_map)[i];
 
 	  std::ostringstream ostr;
 	  ostr << number;
 	      
-	  nodetextmap[node]->property_text().set_value(ostr.str());
-	}
-      else
-	{
-	  nodetextmap[node]->property_text().set_value("");
-	}
-    }
-  return 0;
-};
+	  nodetextmap[i]->property_text().set_value(ostr.str());
+	}
+    }
+  else
+    {
+      double number=(*actual_map)[node];
+
+      std::ostringstream ostr;
+      ostr << number;
+	      
+      nodetextmap[node]->property_text().set_value(ostr.str());
+    }
+  return 0;
+};
+
+int GraphDisplayerCanvas::resetNodeText (Node node)
+{
+
+  //the number in the map will be written on the node
+  //EXCEPT when the name of the map is Text, because
+  //in that case empty string will be written, because
+  //that is the deleter map
+
+  if(node==INVALID)
+    {
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+	{
+	  nodemap_to_edit="";
+	  nodetextmap[i]->property_text().set_value("");
+	}
+    }
+  else
+    {
+      nodetextmap[node]->property_text().set_value("");
+    }
+  return 0;
+};
Index: gui/graph_displayer_canvas.h
===================================================================
--- gui/graph_displayer_canvas.h	(revision 1648)
+++ gui/graph_displayer_canvas.h	(revision 1731)
@@ -25,24 +25,30 @@
   ///\param mapname is the name of the map which contains the new values
   int changeEdgeWidth (std::string mapname, Edge new_item=INVALID);
+  int resetEdgeWidth (Edge new_item=INVALID);
 
   ///Changes the linecolor attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
   int changeEdgeColor (std::string mapname, Edge new_item=INVALID);
+  int resetEdgeColor (Edge new_item=INVALID);
 
   ///Changes the text of line attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
   int changeEdgeText (std::string mapname, Edge new_item=INVALID);
+  int resetEdgeText (Edge new_item=INVALID);
 
   ///Changes the linewidth attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
   int changeNodeRadius (std::string mapname, Node new_item=INVALID);
+  int resetNodeRadius (Node new_item=INVALID);
 
   ///Changes the linecolor attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
   int changeNodeColor (std::string mapname, Node new_item=INVALID);
+  int resetNodeColor (Node new_item=INVALID);
 
   ///Changes the text of line attribute according to the given map.
   ///\param mapname is the name of the map which contains the new values
   int changeNodeText (std::string mapname, Node new_item=INVALID);
+  int resetNodeText (Node new_item=INVALID);
 
   ///Callback for 'ViewZoomIn' action.
Index: gui/map_win.cc
===================================================================
--- gui/map_win.cc	(revision 1648)
+++ gui/map_win.cc	(revision 1731)
@@ -18,45 +18,13 @@
   signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed));
 
-  e_combo_array=new Gtk::Combo [EDGE_PROPERTY_NUM];
+  e_combo_array=new MapSelector * [EDGE_PROPERTY_NUM];
 
-  table=new Gtk::Table(EDGE_PROPERTY_NUM, 2, false);
+  table=new Gtk::Table(EDGE_PROPERTY_NUM, 1, false);
 
   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
   {
-    //filling in combo box with choices
-    std::list<Glib::ustring> listStrings;
+    e_combo_array[i]=new MapSelector(gdc, ms, *this, i, true);
 
-    listStrings.push_back("Default");
-
-    std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
-    for(;emsi!=ms.endOfEdgeMaps();emsi++)
-    {
-	listStrings.push_back(emsi->first);
-    }
-
-    e_combo_array[i].set_popdown_strings(listStrings);
-
-    //Restrict it to these choices only:
-    e_combo_array[i].set_value_in_list();
-
-    //binding signal to the actual entry
-    e_combo_array[i].get_entry()->signal_changed().connect
-    (
-     sigc::bind
-     (
-      sigc::mem_fun(*this, &MapWin::eComboChanged),
-      i
-     )
-    );
-
-    //placing actual entry in the right place
-
-    label=new Gtk::Label;
-    label->set_text(edge_property_strings[i]);
-        
-    (*table).attach(*label,0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-    (*table).attach(e_combo_array[i],1,2,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-
-
+    (*table).attach((*(e_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
   }
 
@@ -67,49 +35,13 @@
   vbox.pack_start(*(new Gtk::HSeparator));
 
-  n_combo_array=new Gtk::Combo [NODE_PROPERTY_NUM];
+  n_combo_array=new MapSelector * [NODE_PROPERTY_NUM];
 
-  table=new Gtk::Table(NODE_PROPERTY_NUM, 2, false);
+  table=new Gtk::Table(NODE_PROPERTY_NUM, 1, false);
 
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
   {
-    //filling in combo box with choices
-    std::list<Glib::ustring> listStrings;
+    n_combo_array[i]=new MapSelector(gdc, ms, *this, i, false);
 
-    listStrings.push_back("Default");
-
-    std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
-
-    for(;emsi!=ms.endOfNodeMaps();emsi++)
-    {
-      if ((emsi->first != "coordinates_x") && (emsi->first != "coordinates_y"))
-      {
-        listStrings.push_back(emsi->first);
-      }
-    }
-
-    n_combo_array[i].set_popdown_strings(listStrings);
-
-    //Restrict it to these choices only:
-    n_combo_array[i].set_value_in_list();
-
-    //binding signal to thew actual entry
-    n_combo_array[i].get_entry()->signal_changed().connect
-    (
-     sigc::bind
-     (
-      sigc::mem_fun(*this, &MapWin::nComboChanged),
-      i
-     )
-    );
-
-    //placing actual entry in the right place
-
-    label=new Gtk::Label;
-    label->set_text(node_property_strings[i]);
-        
-    (*table).attach(*label,0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-    (*table).attach(n_combo_array[i],1,2,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-
-
+    (*table).attach((*(n_combo_array[i])),0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
   }
 
@@ -128,99 +60,13 @@
   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
   {
-    //filling in combo box with choices
-    std::list<Glib::ustring> listStrings;
+    e_combo_array[i]->update_list();
+  }
 
-    listStrings.push_back("Default");
-
-    std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
-    for(;emsi!=ms.endOfEdgeMaps();emsi++)
-    {
-      listStrings.push_back(emsi->first);
-    }
-
-    e_combo_array[i].set_popdown_strings(listStrings);
-  }
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
   {
-    //filling in combo box with choices
-    std::list<Glib::ustring> listStrings;
-
-    listStrings.push_back("Default");
-
-    std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
-
-    for(;emsi!=ms.endOfNodeMaps();emsi++)
-    {
-      if ((emsi->first != "coordinates_x") && (emsi->first != "coordinates_y"))
-      {
-        listStrings.push_back(emsi->first);
-      }
-    }
-
-    n_combo_array[i].set_popdown_strings(listStrings);
+    n_combo_array[i]->update_list();
   }
 }
 
-void MapWin::eComboChanged(int prop)
-{
-
-  Gtk::Entry* entry = e_combo_array[prop].get_entry();
-
-  if(entry)
-  {
-    Glib::ustring mapname = entry->get_text();
-    if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
-    {
-      if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") )
-      {
-	switch(prop)
-	{
-          case E_WIDTH:
-	    gdc.changeEdgeWidth(mapname);
-	    break;
-          case E_COLOR:
-	    gdc.changeEdgeColor(mapname);
-	    break;
-          case E_TEXT:
-	    gdc.changeEdgeText(mapname);
-	    break;
-          default:
-	    std::cerr<<"Error\n";
-	}
-      }
-    }
-  }
-};
-
-void MapWin::nComboChanged(int prop)
-{
-
-  Gtk::Entry* entry = n_combo_array[prop].get_entry();
-
-  if(entry)
-  {
-    Glib::ustring mapname = entry->get_text();
-    if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
-    {
-      if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") )
-      {
-	switch(prop)
-	{
-          case N_RADIUS:
-	    gdc.changeNodeRadius(mapname);
-	    break;
-          case N_COLOR:
-	    gdc.changeNodeColor(mapname);
-	    break;
-          case N_TEXT:
-	    gdc.changeNodeText(mapname);
-	    break;
-          default:
-	    std::cerr<<"Error\n";
-	}
-      }
-    }
-  }
-};
 
 void MapWin::updateNode(Node node)
@@ -228,30 +74,5 @@
   for(int i=0;i<NODE_PROPERTY_NUM;i++)
     {
-      Gtk::Entry* entry = n_combo_array[i].get_entry();
-
-      if(entry)
-	{
-	  Glib::ustring mapname = entry->get_text();
-	  if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
-	    {
-	      if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) || (mapname=="Default") )
-		{
-		  switch(i)
-		    {
-		    case N_RADIUS:
-		      gdc.changeNodeRadius(mapname, node);
-		      break;
-		    case N_COLOR:
-		      gdc.changeNodeColor(mapname, node);
-		      break;
-		    case N_TEXT:
-		      gdc.changeNodeText(mapname, node);
-		      break;
-		    default:
-		      std::cerr<<"Error\n";
-		    }
-		}
-	    }
-	}
+      n_combo_array[i]->update(node);
     }
 }
@@ -261,32 +82,5 @@
   for(int i=0;i<EDGE_PROPERTY_NUM;i++)
     {
-
-      Gtk::Entry* entry = e_combo_array[i].get_entry();
-
-      if(entry)
-	{
-	  Glib::ustring mapname = entry->get_text();
-	  if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
-	    {
-
-	      if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) || (mapname=="Default") )
-		{
-		  switch(i)
-		    {
-		    case E_WIDTH:
-		      gdc.changeEdgeWidth(mapname, edge);
-		      break;
-		    case E_COLOR:
-		      gdc.changeEdgeColor(mapname, edge);
-		      break;
-		    case E_TEXT:
-		      gdc.changeEdgeText(mapname, edge);
-		      break;
-		    default:
-		      std::cerr<<"Error\n";
-		    }
-		}
-	    }
-	}
+      e_combo_array[i]->update(edge);
     }
 }
@@ -297,11 +91,8 @@
   {
     //filling in combo box with choices
-    std::list<Glib::ustring> listStrings=e_combo_array[i].get_popdown_strings();
-    listStrings.push_back(newmapname);
-    e_combo_array[i].set_popdown_strings(listStrings);
+    e_combo_array[i]->append_text((Glib::ustring)newmapname);
   }
   //setting text property for the new map
-  Gtk::Entry* entry = e_combo_array[E_TEXT].get_entry();
-  entry->set_text((Glib::ustring)newmapname);
+  e_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
 }
 
@@ -311,10 +102,7 @@
   {
     //filling in combo box with choices
-    std::list<Glib::ustring> listStrings=n_combo_array[i].get_popdown_strings();
-    listStrings.push_back(newmapname);
-    n_combo_array[i].set_popdown_strings(listStrings);
+    e_combo_array[i]->append_text((Glib::ustring)newmapname);
   }
   //setting text property for the new map
-  Gtk::Entry* entry = n_combo_array[N_TEXT].get_entry();
-  entry->set_text((Glib::ustring)newmapname);
+  n_combo_array[N_TEXT]->set_active_text((Glib::ustring)newmapname);
 }
Index: gui/map_win.h
===================================================================
--- gui/map_win.h	(revision 1606)
+++ gui/map_win.h	(revision 1731)
@@ -9,4 +9,5 @@
 #include "graph_displayer_canvas.h"
 #include "mapstorage.h"
+#include "mapselector.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -29,5 +30,5 @@
   Gtk::Table * table;
   
-  Gtk::Combo * e_combo_array, * n_combo_array;
+  MapSelector ** e_combo_array, ** n_combo_array;
 
   Gtk::Label * label;
@@ -38,15 +39,4 @@
   ///Constructor of MapWin creates the widgets shown in MapWin.
   MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
-
-  ///If a radiobutton is clicked, this function determines
-  ///which button was that and after that calls the
-  ///appropriate function of the \ref GraphDisplayerCanvas
-  ///to change the visible values of that attribute.
-  virtual void eComboChanged(int);
-  ///If a radiobutton is clicked, this function determines
-  ///which button was that and after that calls the
-  ///appropriate function of the \ref GraphDisplayerCanvas
-  ///to change the visible values of that attribute.
-  virtual void nComboChanged(int);
 
   ///This function is created to set the appropriate maps on the newly created node
Index: gui/mapselector.cc
===================================================================
--- gui/mapselector.cc	(revision 1731)
+++ gui/mapselector.cc	(revision 1731)
@@ -0,0 +1,209 @@
+#include "mapselector.h"
+
+MapSelector::MapSelector(GraphDisplayerCanvas & grdispc, MapStorage & mapst, MapWin & mapw, int identifier, bool edge):gdc(grdispc),ms(mapst),mw(mapw),id(identifier),itisedge(edge),default_state(true),node_to_update(INVALID),edge_to_update(INVALID)
+{
+  update_list();
+
+  cbt.set_active(0);
+
+  //binding signal to the actual entry
+  cbt.signal_changed().connect
+    (
+     sigc::mem_fun((*this), &MapSelector::comboChanged),
+     false
+     );
+  
+  if(itisedge)
+    {
+      label=new Gtk::Label(edge_property_strings[id]);
+    }
+  else
+    {
+      label=new Gtk::Label(node_property_strings[id]);
+    }
+
+  label->set_width_chars(longest_property_string_length);
+
+  defbut=new Gtk::Button();
+  defbut->set_label("Reset");
+
+  defbut->signal_pressed().connect
+    (
+     sigc::mem_fun(*this, &MapSelector::reset)
+     );
+
+  newbut=new Gtk::Button(Gtk::Stock::NEW);
+
+  add(*label);
+
+  add(cbt);
+
+  add(*defbut);
+  add(*newbut);
+}
+
+void MapSelector::update_list()
+{
+  cbt.clear();
+  if(itisedge)
+    {
+      std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
+      for(;emsi!=ms.endOfEdgeMaps();emsi++)
+	{
+	  cbt.append_text(emsi->first);
+	}
+    }
+  else
+    {
+      std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
+      for(;emsi!=ms.endOfNodeMaps();emsi++)
+	{
+	  cbt.append_text(emsi->first);
+	}
+    }
+  cbt.prepend_text("Default values");
+}
+
+void MapSelector::comboChanged()
+{
+  if(cbt.get_active_row_number()!=0)
+    {
+      default_state=false;
+      Glib::ustring mapname = cbt.get_active_text();
+      if(!(mapname.empty())) //We seem to get 2 signals, one when the text is empty.
+	{
+	  if(itisedge)
+	    {
+	      if( ( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() ) )
+		{
+		  Edge edge=edge_to_update;
+		  switch(id)
+		    {
+		    case E_WIDTH:
+		      gdc.changeEdgeWidth(mapname, edge);
+		      break;
+		    case E_COLOR:
+		      gdc.changeEdgeColor(mapname, edge);
+		      break;
+		    case E_TEXT:
+		      gdc.changeEdgeText(mapname, edge);
+		      break;
+		    default:
+		      std::cerr<<"Error\n";
+		    }
+		}
+	    }
+	  else
+	    {
+	      if( ( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() ) )
+		{
+		  Node node=node_to_update;
+		  switch(id)
+		    {
+		    case N_RADIUS:
+		      gdc.changeNodeRadius(mapname, node);
+		      break;
+		    case N_COLOR:
+		      gdc.changeNodeColor(mapname, node);
+		      break;
+		    case N_TEXT:
+		      gdc.changeNodeText(mapname, node);
+		      break;
+		    default:
+		      std::cerr<<"Error\n";
+		    }
+		}
+	    }
+	}
+    }
+  else if((!default_state)&&(cbt.get_active_row_number()==0))
+    {
+      reset();
+    }
+}
+
+void MapSelector::reset()
+{
+  default_state=true;
+  cbt.set_active(0);
+
+  if(itisedge)
+    {
+      Edge edge=edge_to_update;
+      switch(id)
+	{
+	case E_WIDTH:
+	  gdc.resetEdgeWidth(edge);
+	  break;
+	case E_COLOR:
+	  gdc.resetEdgeColor(edge);
+	  break;
+	case E_TEXT:
+	  gdc.resetEdgeText(edge);
+	  break;
+	default:
+	  std::cerr<<"Error\n";
+	}
+    }
+  else
+    {
+      Node node=node_to_update;	
+      switch(id)
+	{
+	case N_RADIUS:
+	  gdc.resetNodeRadius(node);
+	  break;
+	case N_COLOR:
+	  gdc.resetNodeColor(node);
+	  break;
+	case N_TEXT:
+	  gdc.resetNodeText(node);
+	  break;
+	default:
+	  std::cerr<<"Error\n";
+	}
+    }
+}
+
+void MapSelector::update(Node node)
+{
+  node_to_update=node;
+  if(default_state)
+    {
+      reset();
+    }
+  else
+    {
+      comboChanged();
+    }
+  node_to_update=INVALID;
+}
+
+void MapSelector::update(Edge edge)
+{
+  edge_to_update=edge;
+  if(default_state)
+    {
+      reset();
+    }
+  else
+    {
+      comboChanged();
+    }
+  edge_to_update=INVALID;
+}
+
+Glib::ustring MapSelector::get_active_text()
+{
+  return cbt.get_active_text();
+}
+
+void MapSelector::set_active_text(Glib::ustring text)
+{
+  cbt.set_active_text(text);
+}
+
+void MapSelector::append_text(Glib::ustring text)
+{
+  cbt.append_text(text);
+}
Index: gui/mapselector.h
===================================================================
--- gui/mapselector.h	(revision 1731)
+++ gui/mapselector.h	(revision 1731)
@@ -0,0 +1,63 @@
+// -*- C++ -*- //
+
+#ifndef MAP_SELECTOR_H
+#define MAP_SELECTOR_H
+
+class MapSelector;
+
+#include "all_include.h"
+#include "mapstorage.h"
+#include "map_win.h"
+#include "graph_displayer_canvas.h"
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class MapSelector : public Gtk::HBox
+{
+protected:
+  GraphDisplayerCanvas & gdc;
+  ///The \ref MapStorage in which the visualizable maps are stored
+  MapStorage & ms;
+  MapWin & mw;
+
+  int id;
+
+  bool itisedge;
+
+  bool default_state;
+
+  Gtk::ComboBoxText cbt;
+
+  Gtk::Button * newbut, * defbut;
+
+  Gtk::HBox hbox;
+
+  Gtk::Label * label;
+
+  Node node_to_update;
+  Edge edge_to_update;
+
+
+public:
+
+  MapSelector(GraphDisplayerCanvas &, MapStorage &, MapWin &, int, bool);
+
+  void update_list();
+
+  ///If a radiobutton is clicked, this function determines
+  ///which button was that and after that calls the
+  ///appropriate function of the \ref GraphDisplayerCanvas
+  ///to change the visible values of that attribute.
+  virtual void comboChanged();
+
+  virtual void reset();
+
+  virtual void update(Node node);
+  virtual void update(Edge edge);
+
+  Glib::ustring get_active_text();
+  void set_active_text(Glib::ustring);
+  void append_text(Glib::ustring);
+};
+
+#endif
