branch | gui |
changeset 30 | f70bbee5350a |
parent 28 | fa28f1071bd6 |
child 31 | 66e85f44a66f |
18:9fb7cab70433 | 19:4ed2302ef53f |
---|---|
3 #include <math.h> |
3 #include <math.h> |
4 |
4 |
5 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),mapwin(mw) |
5 GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),mapwin(mw) |
6 { |
6 { |
7 |
7 |
8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create_node_event_handler), false); |
8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false); |
9 actual_tool=CREATE_NODE; |
9 actual_tool=CREATE_NODE; |
10 |
10 |
11 active_node=INVALID; |
11 active_node=INVALID; |
12 active_edge=INVALID; |
12 active_edge=INVALID; |
13 |
13 |
28 *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); |
28 *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green"); |
29 edgesmap[i]->property_width_pixels().set_value(10); |
29 edgesmap[i]->property_width_pixels().set_value(10); |
30 |
30 |
31 //initializing edge-text as well, to empty string |
31 //initializing edge-text as well, to empty string |
32 |
32 |
33 xy<double> text_pos=edgesmap[i]->get_arrow_pos(); |
33 xy<double> text_pos=edgesmap[i]->getArrowPos(); |
34 text_pos+=(xy<double>(10,10)); |
34 text_pos+=(xy<double>(10,10)); |
35 |
35 |
36 edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); |
36 edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); |
37 edgetextmap[i]->property_fill_color().set_value("darkgreen"); |
37 edgetextmap[i]->property_fill_color().set_value("darkgreen"); |
38 } |
38 } |