graph_displayer_canvas.cc
branchgui
changeset 75 d5aadf09197b
parent 63 59768817442a
child 89 4042761b21e3
equal deleted inserted replaced
31:e56788bcdb57 32:3db9792921cb
     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 {