Index: map_win.cc
===================================================================
--- map_win.cc	(revision 8)
+++ map_win.cc	(revision 28)
@@ -11,5 +11,5 @@
 }
 
-MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst),table(PROPERTY_NUM, 2, false)
+MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst)
 {
   set_title(title);
@@ -18,7 +18,9 @@
   signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::close_if_escape_is_pressed));
 
-  combo_array=new Gtk::Combo [PROPERTY_NUM];
-
-  for(int i=0;i<PROPERTY_NUM;i++)
+  e_combo_array=new Gtk::Combo [EDGE_PROPERTY_NUM];
+
+  table=new Gtk::Table(EDGE_PROPERTY_NUM, 2, false);
+
+  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
   {
 
@@ -36,6 +38,6 @@
 	actprop=j;
       }
-      //this is the other maps to show for this property
-      for(int k=0;k<PROPERTY_NUM;k++)
+      //these are the maps NOT to show for this property
+      for(int k=0;k<EDGE_PROPERTY_NUM;k++)
       {
 	if(emsi->second==&(ms.default_edgemaps[k]))
@@ -46,6 +48,4 @@
       emsi++;
     }
-
-    //combo_array[i].set_group(group);
 
     //filling in combo box with choices
@@ -65,15 +65,15 @@
     }
 
-    combo_array[i].set_popdown_strings(listStrings);
+    e_combo_array[i].set_popdown_strings(listStrings);
 
     //Restrict it to these choices only:
-    combo_array[i].set_value_in_list();
-
-    //binding signal to thew actual entry
-    combo_array[i].get_entry()->signal_changed().connect
+    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::combo_changed),
+      sigc::mem_fun(*this, &MapWin::e_combo_changed),
       i
      )
@@ -83,32 +83,96 @@
 
     label=new Gtk::Label;
-    label->set_text(property_strings[i]);
-
-    //    labelpluscombo=new Gtk::HBox;
-    //    labelpluscombo->pack_start(*label);
-    //    labelpluscombo->pack_start(combo_array[i]);
+    label->set_text(edge_property_strings[i]);
         
-    table.attach(*label,0,1,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-    table.attach(combo_array[i],1,2,i,i+1,Gtk::SHRINK,Gtk::SHRINK,10,3);
-
-    /*
-    if(actpos<(ms.numOfEdgeMaps()-PROPERTY_NUM+1)/2)
-    {
-      vbox_r1.pack_start(*labelpluscombo);
-    }
-    else
-    {
-      vbox_r2.pack_start(*labelpluscombo);
-    }
-    actpos++;
-    //*/
-
-  }
-
-  combos.pack_start(vbox_r1);
-  combos.pack_start(vbox_r2);
-
-  //add(combos);
-  add(table);
+    (*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);
+
+
+  }
+
+  vbox.pack_start(*(new Gtk::Label("Edge properties")));
+
+  vbox.pack_start(*table);
+
+  vbox.pack_start(*(new Gtk::HSeparator));
+
+  n_combo_array=new Gtk::Combo [NODE_PROPERTY_NUM];
+
+  table=new Gtk::Table(NODE_PROPERTY_NUM, 2, false);
+
+  for(int i=0;i<NODE_PROPERTY_NUM;i++)
+  {
+
+    std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
+    std::set<int> props;
+
+    int actprop;
+
+    //here we find out, which map is the default in MapStorage for this property, which are not
+    for(int j=0;j<ms.numOfNodeMaps();j++)
+    {
+      //these are the maps NOT to show for this property
+      if(emsi->second==&(ms.default_nodemaps[i]))
+      {
+	actprop=j;
+      }
+      //this is the other maps to show for this property
+      for(int k=0;k<NODE_PROPERTY_NUM;k++)
+      {
+	if(emsi->second==&(ms.default_nodemaps[k]))
+	{
+	  props.insert(j);
+	}
+      }
+      emsi++;
+    }
+
+    //filling in combo box with choices
+    std::list<Glib::ustring> listStrings;
+
+    listStrings.push_back("Default");
+
+    emsi=ms.beginOfNodeMaps();
+
+    for(int j=0;j<ms.numOfNodeMaps();j++)
+    {
+      if( ( props.find(j) )==( props.end() ) )
+      {
+	listStrings.push_back(emsi->first);
+      }
+      emsi++;
+    }
+
+    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::n_combo_changed),
+      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);
+
+
+  }
+
+  add(vbox);
+
+  vbox.pack_start(*(new Gtk::Label("Node properties")));
+
+  vbox.pack_start(*table);
 
   show_all_children();
@@ -116,9 +180,7 @@
 }
 
-void MapWin::combo_changed(int prop)
-{
-
-  //most nem kommentezem fel, mert ugyis valtozik
-  Gtk::Entry* entry = combo_array[prop].get_entry();
+void MapWin::e_combo_changed(int prop)
+{
+  Gtk::Entry* entry = e_combo_array[prop].get_entry();
 
   if(entry)
@@ -129,5 +191,5 @@
       if(mapname=="Default")
       {
-	mapname=property_strings[prop];
+	mapname=edge_property_strings[prop];
       }
 
@@ -136,12 +198,12 @@
 	switch(prop)
 	{
-          case WIDTH:
-	    gdc.changeLineWidth(mapname);
-	    break;
-          case COLOR:
-	    gdc.changeColor(mapname);
-	    break;
-          case TEXT:
-	    gdc.changeText(mapname);
+          case E_WIDTH:
+	    gdc.changeEdgeWidth(mapname);
+	    break;
+          case E_COLOR:
+	    gdc.changeEdgeColor(mapname);
+	    break;
+          case E_TEXT:
+	    gdc.changeEdgeText(mapname);
 	    break;
           default:
@@ -152,2 +214,117 @@
   }
 };
+
+void MapWin::n_combo_changed(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(mapname=="Default")
+      {
+	mapname=node_property_strings[prop];
+      }
+
+      if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() )
+      {
+	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::cout<<"Error\n";
+	}
+      }
+    }
+  }
+};
+
+void MapWin::update_node(Graph::Node node)
+{
+  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(mapname=="Default")
+		{
+		  mapname=node_property_strings[i];
+		}
+
+	      if( (ms.nodemap_storage).find(mapname) != (ms.nodemap_storage).end() )
+		{
+		  switch(i)
+		    {
+		    case N_RADIUS:
+		      //gdc.changeNodeRadius(mapname, node);
+		      std::cout << "If default map-value problem is solved, uncomment line in MapWin::node_update!" << std::endl;
+		      break;
+		    case N_COLOR:
+		      gdc.changeNodeColor(mapname, node);
+		      break;
+		    case N_TEXT:
+		      gdc.changeNodeText(mapname, node);
+		      break;
+		    default:
+		      std::cout<<"Error\n";
+		    }
+		}
+	    }
+	}
+    }
+}
+
+void MapWin::update_edge(Graph::Edge edge)
+{
+  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(mapname=="Default")
+		{
+		  mapname=edge_property_strings[i];
+		}
+
+	      if( (ms.edgemap_storage).find(mapname) != (ms.edgemap_storage).end() )
+		{
+		  switch(i)
+		    {
+		    case E_WIDTH:
+		      //gdc.changeEdgeWidth(mapname, edge);
+		      std::cout << "If default map-value problem is solved, uncomment line in MapWin::edge_update!" << std::endl;
+		      break;
+		    case E_COLOR:
+		      gdc.changeEdgeColor(mapname, edge);
+		      break;
+		    case E_TEXT:
+		      gdc.changeEdgeText(mapname, edge);
+		      break;
+		    default:
+		      std::cout<<"Error\n";
+		    }
+		}
+	    }
+	}
+    }
+}
