broken_edge.h
author hegyi
Thu, 16 Jun 2005 18:58:15 +0000
branchgui
changeset 20 a3bd39d50930
parent 19 164783ceb9be
child 21 44bb92014108
permissions -rw-r--r--
First of all: revision 1981 is mine, what is important me because I was born in 1981. But what is new in my revision? If you drag nodes with left button, edge-breakpoints do not change location. If you drag nodes by right button, they do, they take up their base situation at the halfpoint of the edge.
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@17
     6
#include <all_include.h>
hegyi@17
     7
#include <libgnomecanvasmm.h>
hegyi@17
     8
#include <libgnomecanvasmm/polygon.h>
hegyi@17
     9
hegyi@17
    10
class BrokenEdge : public Gnome::Canvas::Line
hegyi@17
    11
{
hegyi@19
    12
  Gnome::Canvas::Polygon * arrow;
hegyi@19
    13
  Gnome::Art::Point * my_points;
hegyi@19
    14
hegyi@19
    15
  ///Indicates whether the button of mouse is pressed or not
hegyi@19
    16
  bool isbutton;
hegyi@19
    17
hegyi@19
    18
  ///At this location was the mousebutton pressed.
hegyi@19
    19
  ///It helps to calculate the distance of dragging.
hegyi@19
    20
  double clicked_x, clicked_y;
hegyi@19
    21
hegyi@19
    22
  ///event handler for forming edges
hegyi@19
    23
  bool edge_former_event_handler(GdkEvent*);
hegyi@17
    24
 public:
hegyi@17
    25
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points);
hegyi@19
    26
  ~BrokenEdge();
hegyi@20
    27
  void set_points(Gnome::Canvas::Points, bool move=false);
hegyi@17
    28
};
hegyi@17
    29
hegyi@17
    30
hegyi@17
    31
#endif //BROKEN_EDGE_H
hegyi@17
    32