Index: gui/Makefile.am
===================================================================
--- gui/Makefile.am	(revision 1435)
+++ gui/Makefile.am	(revision 1468)
@@ -14,5 +14,7 @@
 	mapstorage.h \
 	map_win.cc \
-	map_win.h
+	map_win.h \
+	edit_win.cc \
+	edit_win.h
 
 gd_CXXFLAGS = $(GTK_CFLAGS)
Index: gui/all_include.h
===================================================================
--- gui/all_include.h	(revision 1442)
+++ gui/all_include.h	(revision 1468)
@@ -17,5 +17,6 @@
 #include <lemon/xy.h>
 
-enum {WIDTH, COLOR, TEXT, PROPERTY_NUM};// properties;
+enum {WIDTH, COLOR, TEXT, PROPERTY_NUM}; // edge properties;
+enum {MOVE, CREATE_NODE, CREATE_EDGE, TOOL_NUM}; // tools;
 #define RANGE 3
 #define WIN_WIDTH 900
Index: gui/graph_displayer_canvas.cc
===================================================================
--- gui/graph_displayer_canvas.cc	(revision 1444)
+++ gui/graph_displayer_canvas.cc	(revision 1468)
@@ -4,4 +4,10 @@
 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(false),active_item(NULL)
 {
+  Gnome::Canvas::Ellipse * origo=new Gnome::Canvas::Ellipse(displayed_graph, 0-20, 0-20, 0+20, 0+20);
+  *origo << Gnome::Canvas::Properties::fill_color("black");
+  *origo << Gnome::Canvas::Properties::outline_color("black");
+  
+  actual_handler=/*displayed_graph.*/signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false);
+
   //set_center_scroll_region(true);
 
@@ -49,18 +55,7 @@
     *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue");
     *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
-    (nodesmap[i])->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &GraphDisplayerCanvas::event_handler),i));
-  }
-
-/*
-  //setting zoom to be able to see the whole graph on the canvas
-
-  double biggest_x=(abs(maxx)>abs(minx))?(abs(maxx)+80):(abs(minx)+80);
-  double biggest_y=(abs(maxy)>abs(miny))?(abs(maxy)+80):(abs(miny)+80);
-
-  set_pixels_per_unit((biggest_x>biggest_y)?(WIN_WIDTH/biggest_x/2):(WIN_HEIGHT/biggest_y/2));
-  std::cout<<abs(maxx)<<" "<<abs(minx)<<" big x "<<biggest_x<<" "<<abs(maxy)<<" "<<abs(miny)<<" big y "<<biggest_y<<std::endl;
-  std::cout<<maxx<<" "<<minx<<" big x "<<biggest_x<<" "<<maxy<<" "<<miny<<" big y "<<biggest_y<<std::endl;
-  std::cout<<"dx "<<(maxx-minx)<<" dy "<<(maxy-miny)<<" xrate "<<((maxx-minx)/WIN_WIDTH)<<" yrate "<<((maxy-miny)/WIN_HEIGHT)<<std::endl;
-*/
+    //!!!!!!! (nodesmap[i])->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &GraphDisplayerCanvas::event_handler),i));
+  }
+
   updateScrollRegion();
 }
@@ -309,2 +304,161 @@
   set_scroll_region(wx1, wy1, wx2, wy2);
 }
+
+void GraphDisplayerCanvas::changeEditorialTool(int newtool)
+{
+  actual_handler.disconnect();
+
+  switch(newtool)
+    {
+    case MOVE:
+      actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::move_event_handler), false);
+      break;
+    case CREATE_NODE:
+      actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false);
+      break;
+    case CREATE_EDGE:
+      actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_edge_event_handler), false);
+      break;
+    default:
+      break;
+    }
+}
+
+bool GraphDisplayerCanvas::move_event_handler(GdkEvent* e)
+{
+  switch(e->type)
+  {
+    case GDK_BUTTON_PRESS:
+      //we mark the location of the event to be able to calculate parameters of dragging
+      clicked_x=e->button.x;
+      clicked_y=e->button.y;
+      active_item=(get_item_at(e->button.x, e->button.y));
+      active_node=INVALID;
+      for (NodeIt i(g); i!=INVALID; ++i)
+	{
+	  if(nodesmap[i]==active_item)
+	    {
+	      active_node=i;
+	    }
+	}
+      isbutton=true;
+      break;
+    case GDK_BUTTON_RELEASE:
+      isbutton=false;
+      active_item=NULL;
+      updateScrollRegion();
+      break;
+    case GDK_MOTION_NOTIFY:
+      //we only have to do sg. if the mouse button is pressed
+      if(isbutton)
+      {
+	//new coordinates will be the old values,
+	//because the item will be moved to the
+	//new coordinate therefore the new movement
+	//has to be calculated from here
+
+        double dx=e->motion.x-clicked_x;
+        double dy=e->motion.y-clicked_y;
+
+        active_item->move(dx, dy);
+
+        clicked_x=e->motion.x;
+        clicked_y=e->motion.y;
+
+	//all the edges connected to the moved point has to be redrawn
+
+        EdgeIt e;
+
+        g.firstOut(e,active_node);
+
+        for(;e!=INVALID;g.nextOut(e))
+        {
+            Gnome::Canvas::Points coos;
+            double x1, x2, y1, y2;
+
+            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            edgesmap[e]->property_points().set_value(coos);
+
+	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+        }
+
+        g.firstIn(e,active_node);
+        for(;e!=INVALID;g.nextIn(e))
+        {
+            Gnome::Canvas::Points coos;
+            double x1, x2, y1, y2;
+
+            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            edgesmap[e]->property_points().set_value(coos);
+
+	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+        }
+      }
+    default: break;
+  }
+
+  return true;
+}
+
+bool GraphDisplayerCanvas::create_node_event_handler(GdkEvent* e)
+{
+  switch(e->type)
+    {
+    case GDK_BUTTON_PRESS:
+      isbutton=true;
+
+      active_node=NodeIt(g,g.addNode());
+
+      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
+
+      nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph, clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
+      active_item=(Gnome::Canvas::Item *)(nodesmap[active_node]);
+      *(nodesmap[active_node]) << Gnome::Canvas::Properties::fill_color("red");
+      *(nodesmap[active_node]) << Gnome::Canvas::Properties::outline_color("black");
+      (nodesmap[active_node])->show();
+      break;
+    case GDK_MOTION_NOTIFY:
+      {
+	double world_motion_x, world_motion_y;
+	GdkEvent * generated=new GdkEvent();
+	window_to_world (e->motion.x, e->motion.y, world_motion_x, world_motion_y);
+	generated->motion.x=world_motion_x;
+	generated->motion.y=world_motion_y;
+	generated->type=GDK_MOTION_NOTIFY;
+	move_event_handler(generated);      
+	break;
+      }
+    case GDK_BUTTON_RELEASE:
+      isbutton=false;
+      *active_item << Gnome::Canvas::Properties::fill_color("blue");
+      active_item=NULL;
+      updateScrollRegion();
+      break;
+    default:
+      break;
+    }
+  return false;
+}
+
+bool GraphDisplayerCanvas::create_edge_event_handler(GdkEvent* e)
+{
+  e=e;
+  return false;
+}
+
Index: gui/graph_displayer_canvas.h
===================================================================
--- gui/graph_displayer_canvas.h	(revision 1442)
+++ gui/graph_displayer_canvas.h	(revision 1468)
@@ -41,4 +41,7 @@
   void updateScrollRegion();
 
+  ///This function changes the tool in the graph-editor's hand
+  void changeEditorialTool(int);
+
 protected:
 
@@ -52,4 +55,16 @@
   ///of the canvas
   bool event_handler(GdkEvent* e, Node n);
+
+  ///actual event handler
+  ///
+  ///Actual event handler should be stored, to be able to disconnect it and later reconnect it.
+  sigc::connection actual_handler;
+
+  ///event handler for the case when move-tool is active
+  bool move_event_handler(GdkEvent*);
+  ///event handler for the case when create_node-tool is active
+  bool create_node_event_handler(GdkEvent*);
+  ///event handler for the case when create_edge-tool is active
+  bool create_edge_event_handler(GdkEvent*);
 
   ///The graph, on which we work
@@ -83,4 +98,5 @@
   ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
   Gnome::Canvas::Item * active_item;
+  Graph::NodeIt active_node;
 
   static const int zoom_step = 5;
Index: gui/main_win.cc
===================================================================
--- gui/main_win.cc	(revision 1442)
+++ gui/main_win.cc	(revision 1468)
@@ -2,5 +2,5 @@
 
 MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm,
-    MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),gd_canvas(graph, cm, ms)
+    MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),editwin("Editorial Window", gd_canvas),gd_canvas(graph, cm, ms)
 {
   set_title (title);
@@ -35,4 +35,6 @@
   ag->add( Gtk::Action::create("ShowMaps", "_Maps"),
       sigc::mem_fun(*this, &MainWin::showMaps));
+  ag->add( Gtk::Action::create("ShowEditorials", "_Editorials"),
+      sigc::mem_fun(*this, &MainWin::showEditorials));
 
   uim=Gtk::UIManager::create();
@@ -61,4 +63,5 @@
       "    <menu action='ShowMenu'>"
       "      <menuitem action='ShowMaps'/>"
+      "      <menuitem action='ShowEditorials'/>"
       "    </menu>"
       "  </menubar>"
@@ -108,4 +111,9 @@
 }
 
+void MainWin::showEditorials()
+{
+  editwin.show();
+}
+
 void MainWin::quit()
 {
Index: gui/main_win.h
===================================================================
--- gui/main_win.h	(revision 1442)
+++ gui/main_win.h	(revision 1468)
@@ -7,4 +7,5 @@
 #include <mapstorage.h>
 #include <map_win.h>
+#include <edit_win.h>
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -26,4 +27,7 @@
   MapWin mapwin;
 
+  ///Window of editorial tools. Its type is \ref EditWin
+  EditWin editwin;
+
   ///The graph will be drawn on this \ref GraphDisplayerCanvas
   GraphDisplayerCanvas gd_canvas;
@@ -40,4 +44,6 @@
   ///This function makes map-setup window popped up.
   virtual void showMaps();
+  ///This function makes editorial window popped up.
+  virtual void showEditorials();
   ///Callback for 'FileNew' action.
   virtual void newFile();
