Index: graph_displayer_canvas-event.cc
===================================================================
--- graph_displayer_canvas-event.cc	(revision 94)
+++ graph_displayer_canvas-event.cc	(revision 96)
@@ -95,5 +95,5 @@
       active_item=(get_item_at(clicked_x, clicked_y));
       active_node=INVALID;
-      for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
 	{
 	  if(nodesmap[i]==active_item)
@@ -126,5 +126,5 @@
       if(active_node!=INVALID)
       {
-        (mainwin.mapstorage).modified = true;
+        (mytab.mapstorage).modified = true;
 
 	//new coordinates will be the old values,
@@ -145,6 +145,6 @@
 
         // the new coordinates of the centre of the node 
-        double coord_x = new_x - (clicked_x - (mainwin.mapstorage).coords[active_node].x);
-        double coord_y = new_y - (clicked_y - (mainwin.mapstorage).coords[active_node].y);
+        double coord_x = new_x - (clicked_x - (mytab.mapstorage).coords[active_node].x);
+        double coord_y = new_y - (clicked_y - (mytab.mapstorage).coords[active_node].y);
 
         clicked_x=new_x;
@@ -152,11 +152,11 @@
 
         // write back the new coordinates to the coords map
-        (mainwin.mapstorage).coords.set(active_node, xy<double>(coord_x, coord_y));
+        (mytab.mapstorage).coords.set(active_node, xy<double>(coord_x, coord_y));
 
         // reposition the coordinates text
         std::ostringstream ostr;
         ostr << "(" <<
-          (mainwin.mapstorage).coords[active_node].x << ", " <<
-          (mainwin.mapstorage).coords[active_node].y << ")";
+          (mytab.mapstorage).coords[active_node].x << ", " <<
+          (mytab.mapstorage).coords[active_node].y << ")";
         double radius =
           (nodesmap[active_node]->property_x2().get_value() -
@@ -165,7 +165,7 @@
         {
           coord_text->property_text().set_value(ostr.str());
-          coord_text->property_x().set_value((mainwin.mapstorage).coords[active_node].x +
+          coord_text->property_x().set_value((mytab.mapstorage).coords[active_node].x +
               radius);
-          coord_text->property_y().set_value((mainwin.mapstorage).coords[active_node].y -
+          coord_text->property_y().set_value((mytab.mapstorage).coords[active_node].y -
               radius);
         }
@@ -174,6 +174,6 @@
           coord_text = new Gnome::Canvas::Text(
               displayed_graph,
-              (mainwin.mapstorage).coords[active_node].x + radius,
-              (mainwin.mapstorage).coords[active_node].y - radius,
+              (mytab.mapstorage).coords[active_node].x + radius,
+              (mytab.mapstorage).coords[active_node].y - radius,
               ostr.str());
           coord_text->property_fill_color().set_value("black");
@@ -182,13 +182,13 @@
 
 	//all the edges connected to the moved point has to be redrawn
-        for(OutEdgeIt ei((mainwin.mapstorage).graph,active_node);ei!=INVALID;++ei)
+        for(OutEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei)
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[(mainwin.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[(mytab.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[(mainwin.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[(mytab.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
@@ -209,13 +209,13 @@
         }
 
-        for(InEdgeIt ei((mainwin.mapstorage).graph,active_node);ei!=INVALID;++ei)
+        for(InEdgeIt ei((mytab.mapstorage).graph,active_node);ei!=INVALID;++ei)
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[(mainwin.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[(mytab.mapstorage).graph.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[(mainwin.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[(mytab.mapstorage).graph.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
@@ -257,9 +257,9 @@
 
     case GDK_BUTTON_RELEASE:
-      (mainwin.mapstorage).modified = true;
+      (mytab.mapstorage).modified = true;
 
       isbutton=1;
 
-      active_node=(mainwin.mapstorage).graph.addNode();
+      active_node=(mytab.mapstorage).graph.addNode();
 
       //initiating values corresponding to new node in maps
@@ -268,10 +268,10 @@
 
       // update coordinates
-      (mainwin.mapstorage).coords.set(active_node, xy<double>(clicked_x, clicked_y));
+      (mytab.mapstorage).coords.set(active_node, xy<double>(clicked_x, clicked_y));
 
       // update all other maps
       for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
-          (mainwin.mapstorage).nodemap_storage.begin(); it !=
-          (mainwin.mapstorage).nodemap_storage.end(); ++it)
+          (mytab.mapstorage).nodemap_storage.begin(); it !=
+          (mytab.mapstorage).nodemap_storage.end(); ++it)
       {
         if ((it->first != "coordinates_x") &&
@@ -279,9 +279,9 @@
         {
           (*(it->second))[active_node] =
-            (mainwin.mapstorage).nodemap_default[it->first];
+            (mytab.mapstorage).nodemap_default[it->first];
         }
       }
       // increment the id map's default value
-      (mainwin.mapstorage).nodemap_default["id"] += 1.0;
+      (mytab.mapstorage).nodemap_default["id"] += 1.0;
 
       nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
@@ -333,5 +333,5 @@
           active_item=(get_item_at(clicked_x, clicked_y));
           active_node=INVALID;
-          for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+          for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
           {
             if(nodesmap[i]==active_item)
@@ -362,5 +362,5 @@
           target_item=(get_item_at(clicked_x, clicked_y));
           Node target_node=INVALID;
-          for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+          for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
           {
             if(nodesmap[i]==target_item)
@@ -374,5 +374,5 @@
             if(target_node!=active_node)		
             {
-              (mainwin.mapstorage).modified = true;
+              (mytab.mapstorage).modified = true;
 
               *(nodesmap[target_node]) <<
@@ -380,5 +380,5 @@
 
               //creating new edge
-              active_edge=(mainwin.mapstorage).graph.addEdge(active_node,
+              active_edge=(mytab.mapstorage).graph.addEdge(active_node,
                   target_node);
 
@@ -386,12 +386,12 @@
               for (std::map<std::string,
                   Graph::EdgeMap<double>*>::const_iterator it =
-                  (mainwin.mapstorage).edgemap_storage.begin(); it !=
-                  (mainwin.mapstorage).edgemap_storage.end(); ++it)
+                  (mytab.mapstorage).edgemap_storage.begin(); it !=
+                  (mytab.mapstorage).edgemap_storage.end(); ++it)
               {
                 (*(it->second))[active_edge] =
-                  (mainwin.mapstorage).edgemap_default[it->first];
+                  (mytab.mapstorage).edgemap_default[it->first];
               }
               // increment the id map's default value
-              (mainwin.mapstorage).edgemap_default["id"] += 1.0;
+              (mytab.mapstorage).edgemap_default["id"] += 1.0;
 
               //calculating coordinates of new edge
@@ -481,5 +481,5 @@
       active_edge=INVALID;
       //was it a node?
-      for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+      for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
 	{
 	  if(nodesmap[i]==active_item)
@@ -491,5 +491,5 @@
       if(active_node==INVALID)
 	{
-	  for (EdgeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+	  for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
 	    {
 	      if(edgesmap[i]==active_item)
@@ -517,14 +517,14 @@
 	      if(active_node!=INVALID)
 		{
-                  (mainwin.mapstorage).modified = true;
+                  (mytab.mapstorage).modified = true;
 
 		  std::set<Graph::Edge> edges_to_delete;
 
-		  for(OutEdgeIt e((mainwin.mapstorage).graph,active_node);e!=INVALID;++e)
+		  for(OutEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e)
 		    {
 		      edges_to_delete.insert(e);
 		    }
 		  
-		  for(InEdgeIt e((mainwin.mapstorage).graph,active_node);e!=INVALID;++e)
+		  for(InEdgeIt e((mytab.mapstorage).graph,active_node);e!=INVALID;++e)
 		    {
 		      edges_to_delete.insert(e);
@@ -590,5 +590,5 @@
 
           //find the activated item between texts
-          for (EdgeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+          for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
           {
             //at the same time only one can be active
@@ -602,5 +602,5 @@
           if(clicked_edge==INVALID)
           {
-            for (EdgeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+            for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
             {
               //at the same time only one can be active
@@ -625,5 +625,5 @@
 
               //create a dialog
-              Gtk::Dialog dialog("Edit value", mainwin, true);
+              Gtk::Dialog dialog("Edit value", true);
               dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
               dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
@@ -642,5 +642,5 @@
                 case Gtk::RESPONSE_ACCEPT:
                   double new_value = spin.get_value();
-                  (*(mainwin.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] =
+                  (*(mytab.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] =
                     new_value;
                   std::ostringstream ostr;
@@ -678,5 +678,5 @@
 
           //find the activated item between texts
-          for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+          for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
           {
             //at the same time only one can be active
@@ -690,5 +690,5 @@
           if(clicked_node==INVALID)
           {
-            for (NodeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+            for (NodeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
             {
               //at the same time only one can be active
@@ -713,5 +713,5 @@
 
               //create a dialog
-              Gtk::Dialog dialog("Edit value", mainwin, true);
+              Gtk::Dialog dialog("Edit value", true);
               dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
               dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);
@@ -730,5 +730,5 @@
                 case Gtk::RESPONSE_ACCEPT:
                   double new_value = spin.get_value();
-                  (*(mainwin.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] =
+                  (*(mytab.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] =
                     new_value;
                   std::ostringstream ostr;
@@ -755,5 +755,5 @@
   delete(nodetextmap[node_to_delete]);
   delete(nodesmap[node_to_delete]);
-  (mainwin.mapstorage).graph.erase(node_to_delete);
+  (mytab.mapstorage).graph.erase(node_to_delete);
 }
 
@@ -762,5 +762,5 @@
   delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
-  (mainwin.mapstorage).graph.erase(edge_to_delete);
+  (mytab.mapstorage).graph.erase(edge_to_delete);
 }
 
@@ -782,5 +782,5 @@
       else
 	{
-	  for (EdgeIt i((mainwin.mapstorage).graph); i!=INVALID; ++i)
+	  for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
 	    {
 	      if(edgesmap[i]==active_bre)
@@ -808,9 +808,9 @@
 {
   //create the new map
-  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> ((mainwin.mapstorage).graph, default_value);
+  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> ((mytab.mapstorage).graph, default_value);
 
   //if addition was not successful addEdgeMap returns one.
   //cause can be that there is already a map named like the new one
-  if((mainwin.mapstorage).addEdgeMap(mapname,emptr, default_value))
+  if((mytab.mapstorage).addEdgeMap(mapname,emptr, default_value))
     {
       return 1;
@@ -819,5 +819,5 @@
 
   //add it to the list of the displayable maps
-  mainwin.registerNewEdgeMap(mapname);
+  mytab.registerNewEdgeMap(mapname);
 
   //display it
@@ -830,9 +830,9 @@
 {
   //create the new map
-  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> ((mainwin.mapstorage).graph,default_value);
+  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> ((mytab.mapstorage).graph,default_value);
 
   //if addition was not successful addNodeMap returns one.
   //cause can be that there is already a map named like the new one
-  if((mainwin.mapstorage).addNodeMap(mapname,emptr, default_value))
+  if((mytab.mapstorage).addNodeMap(mapname,emptr, default_value))
     {
       return 1;
@@ -840,5 +840,5 @@
 
   //add it to the list of the displayable maps
-  mainwin.registerNewNodeMap(mapname);
+  mytab.registerNewNodeMap(mapname);
 
   //display it
