broken_edge.h
author hegyi
Fri, 17 Jun 2005 12:25:53 +0000
branchgui
changeset 21 44bb92014108
parent 20 a3bd39d50930
child 25 c45a34eaa118
permissions -rw-r--r--
Very small bug is corrected: if node creator tool is active, the small red arrows won't move, if you click on them and if you drag the newly created node... 'was hard to notice it :-)
hegyi@17
     1
// -*- C++ -*- //
hegyi@17
     2
hegyi@17
     3
#ifndef BROKEN_EDGE_H
hegyi@17
     4
#define BROKEN_EDGE_H
hegyi@17
     5
hegyi@21
     6
class BrokenEdge;
hegyi@21
     7
hegyi@17
     8
#include <all_include.h>
hegyi@17
     9
#include <libgnomecanvasmm.h>
hegyi@17
    10
#include <libgnomecanvasmm/polygon.h>
hegyi@21
    11
#include <graph_displayer_canvas.h>
hegyi@17
    12
hegyi@17
    13
class BrokenEdge : public Gnome::Canvas::Line
hegyi@17
    14
{
hegyi@21
    15
  GraphDisplayerCanvas & gdc;
hegyi@19
    16
  Gnome::Canvas::Polygon * arrow;
hegyi@19
    17
  Gnome::Art::Point * my_points;
hegyi@19
    18
hegyi@21
    19
hegyi@19
    20
  ///Indicates whether the button of mouse is pressed or not
hegyi@19
    21
  bool isbutton;
hegyi@19
    22
hegyi@19
    23
  ///At this location was the mousebutton pressed.
hegyi@19
    24
  ///It helps to calculate the distance of dragging.
hegyi@19
    25
  double clicked_x, clicked_y;
hegyi@19
    26
hegyi@19
    27
  ///event handler for forming edges
hegyi@19
    28
  bool edge_former_event_handler(GdkEvent*);
hegyi@17
    29
 public:
hegyi@21
    30
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
hegyi@19
    31
  ~BrokenEdge();
hegyi@20
    32
  void set_points(Gnome::Canvas::Points, bool move=false);
hegyi@17
    33
};
hegyi@17
    34
hegyi@17
    35
hegyi@17
    36
#endif //BROKEN_EDGE_H
hegyi@17
    37