gui/graph_displayer_canvas.cc
changeset 1653 9955e7ec7e89
parent 1645 4a04bb856ac7
child 1819 fd82adfbe905
equal deleted inserted replaced
31:810ec479c75b 32:48de9875a447
     2 #include "broken_edge.h"
     2 #include "broken_edge.h"
     3 #include <cmath>
     3 #include <cmath>
     4 
     4 
     5 GraphDisplayerCanvas::GraphDisplayerCanvas(MapStorage & ms, MapWin & mw, Gtk::Window * mainwin) :
     5 GraphDisplayerCanvas::GraphDisplayerCanvas(MapStorage & ms, MapWin & mw, Gtk::Window * mainwin) :
     6   nodesmap(ms.graph), edgesmap(ms.graph), edgetextmap(ms.graph),
     6   nodesmap(ms.graph), edgesmap(ms.graph), edgetextmap(ms.graph),
     7   nodetextmap(ms.graph), displayed_graph(*(root()), 0, 0),
     7   nodetextmap(ms.graph), displayed_graph(*(root()), 0, 0), mapstorage(ms),
     8   canvasentrywidget(NULL), mapstorage(ms), isbutton(0), active_item(NULL),
     8   isbutton(0), active_item(NULL), target_item(NULL), nodemap_to_edit(""),
     9   target_item(NULL), nodemap_to_edit(""), edgemap_to_edit(""), mapwin(mw)
     9   edgemap_to_edit(""), mapwin(mw)
    10 {
    10 {
    11   parentwin=mainwin;
    11   parentwin=mainwin;
    12 
    12 
    13   //base event handler is move tool
    13   //base event handler is move tool
    14   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
    14   actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
    15   actual_tool=MOVE;
    15   actual_tool=MOVE;
    16 
       
    17   //setting event handler for the editor widget
       
    18   entrywidget.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::entryWidgetChangeHandler), false);
       
    19 
    16 
    20   active_node=INVALID;
    17   active_node=INVALID;
    21   active_edge=INVALID;
    18   active_edge=INVALID;
    22   forming_edge=INVALID;
    19   forming_edge=INVALID;
    23 }
    20 }
    32 
    29 
    33   for (EdgeIt e(mapstorage.graph); e != INVALID; ++e)
    30   for (EdgeIt e(mapstorage.graph); e != INVALID; ++e)
    34   {
    31   {
    35     delete edgesmap[e];
    32     delete edgesmap[e];
    36     delete edgetextmap[e];
    33     delete edgetextmap[e];
    37   }
       
    38 
       
    39   if(canvasentrywidget)
       
    40   {
       
    41     delete(canvasentrywidget);
       
    42   }
    34   }
    43 }
    35 }
    44 
    36 
    45 void GraphDisplayerCanvas::drawGraph()
    37 void GraphDisplayerCanvas::drawGraph()
    46 {
    38 {