graph_displayer_canvas.h
branchgui
changeset 89 4042761b21e3
parent 88 c397e85ec555
child 94 adfdc2f70548
     1.1 --- a/graph_displayer_canvas.h	Thu Nov 17 15:34:18 2005 +0000
     1.2 +++ b/graph_displayer_canvas.h	Mon Nov 21 12:07:05 2005 +0000
     1.3 @@ -7,14 +7,36 @@
     1.4  
     1.5  #include "all_include.h"
     1.6  #include "mapstorage.h"
     1.7 -#include "broken_edge.h"
     1.8  #include "map_win.h"
     1.9  #include <libgnomecanvasmm.h>
    1.10  #include <libgnomecanvasmm/polygon.h>
    1.11 +#include <lemon/xy.h>
    1.12  
    1.13  ///This class is the canvas, on which the graph can be drawn.
    1.14  class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
    1.15  {
    1.16 +  class BrokenEdge : public Gnome::Canvas::Line
    1.17 +  {
    1.18 +    GraphDisplayerCanvas & gdc;
    1.19 +    Gnome::Canvas::Polygon * arrow;
    1.20 +    Gnome::Art::Point * my_points;
    1.21 +
    1.22 +
    1.23 +    ///Indicates whether the button of mouse is pressed or not
    1.24 +    bool isbutton;
    1.25 +
    1.26 +    ///At this location was the mousebutton pressed.
    1.27 +    ///It helps to calculate the distance of dragging.
    1.28 +    double clicked_x, clicked_y;
    1.29 +
    1.30 +    ///event handler for forming edges
    1.31 +    bool edgeFormerEventHandler(GdkEvent*);
    1.32 +  public:
    1.33 +    BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
    1.34 +    ~BrokenEdge();
    1.35 +    void setPoints(Gnome::Canvas::Points, bool move=false);
    1.36 +    xy<double> getArrowPos();
    1.37 +  };
    1.38    typedef Gnome::Canvas::CanvasAA Parent;
    1.39  
    1.40  public: