gui/broken_edge.h
author hegyi
Fri, 17 Jun 2005 12:25:53 +0000
changeset 1501 39d59aee2a1a
parent 1500 a222eb109e52
child 1505 7121597da9ba
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@1497
     1
// -*- C++ -*- //
hegyi@1497
     2
hegyi@1497
     3
#ifndef BROKEN_EDGE_H
hegyi@1497
     4
#define BROKEN_EDGE_H
hegyi@1497
     5
hegyi@1501
     6
class BrokenEdge;
hegyi@1501
     7
hegyi@1497
     8
#include <all_include.h>
hegyi@1497
     9
#include <libgnomecanvasmm.h>
hegyi@1497
    10
#include <libgnomecanvasmm/polygon.h>
hegyi@1501
    11
#include <graph_displayer_canvas.h>
hegyi@1497
    12
hegyi@1497
    13
class BrokenEdge : public Gnome::Canvas::Line
hegyi@1497
    14
{
hegyi@1501
    15
  GraphDisplayerCanvas & gdc;
hegyi@1499
    16
  Gnome::Canvas::Polygon * arrow;
hegyi@1499
    17
  Gnome::Art::Point * my_points;
hegyi@1499
    18
hegyi@1501
    19
hegyi@1499
    20
  ///Indicates whether the button of mouse is pressed or not
hegyi@1499
    21
  bool isbutton;
hegyi@1499
    22
hegyi@1499
    23
  ///At this location was the mousebutton pressed.
hegyi@1499
    24
  ///It helps to calculate the distance of dragging.
hegyi@1499
    25
  double clicked_x, clicked_y;
hegyi@1499
    26
hegyi@1499
    27
  ///event handler for forming edges
hegyi@1499
    28
  bool edge_former_event_handler(GdkEvent*);
hegyi@1497
    29
 public:
hegyi@1501
    30
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
hegyi@1499
    31
  ~BrokenEdge();
hegyi@1500
    32
  void set_points(Gnome::Canvas::Points, bool move=false);
hegyi@1497
    33
};
hegyi@1497
    34
hegyi@1497
    35
hegyi@1497
    36
#endif //BROKEN_EDGE_H
hegyi@1497
    37