broken_edge.h
author hegyi
Fri, 17 Jun 2005 17:08:45 +0000
branchgui
changeset 25 c45a34eaa118
parent 21 44bb92014108
child 30 f70bbee5350a
permissions -rw-r--r--
Previous commit was also mine, but I forgot to say, that it was my younger brother's birthyear. From this commit texts of activated maps move together with red arrows.
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@25
    12
#include <lemon/xy.h>
hegyi@17
    13
hegyi@17
    14
class BrokenEdge : public Gnome::Canvas::Line
hegyi@17
    15
{
hegyi@21
    16
  GraphDisplayerCanvas & gdc;
hegyi@19
    17
  Gnome::Canvas::Polygon * arrow;
hegyi@19
    18
  Gnome::Art::Point * my_points;
hegyi@19
    19
hegyi@21
    20
hegyi@19
    21
  ///Indicates whether the button of mouse is pressed or not
hegyi@19
    22
  bool isbutton;
hegyi@19
    23
hegyi@19
    24
  ///At this location was the mousebutton pressed.
hegyi@19
    25
  ///It helps to calculate the distance of dragging.
hegyi@19
    26
  double clicked_x, clicked_y;
hegyi@19
    27
hegyi@19
    28
  ///event handler for forming edges
hegyi@19
    29
  bool edge_former_event_handler(GdkEvent*);
hegyi@17
    30
 public:
hegyi@21
    31
  BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &);
hegyi@19
    32
  ~BrokenEdge();
hegyi@20
    33
  void set_points(Gnome::Canvas::Points, bool move=false);
hegyi@25
    34
  xy<double> get_arrow_pos();
hegyi@17
    35
};
hegyi@17
    36
hegyi@17
    37
hegyi@17
    38
#endif //BROKEN_EDGE_H
hegyi@17
    39