gui/graph_displayer_canvas.h
changeset 1473 876c7b7f4dae
parent 1442 1e3c69aa035b
child 1474 75c6d2eb187a
equal deleted inserted replaced
3:70fc6cc50abe 4:d6b2ffc4503b
    38   ///Callback for 'ViewZoom100' action.
    38   ///Callback for 'ViewZoom100' action.
    39   virtual void zoom100();
    39   virtual void zoom100();
    40   ///Sets the scroll region of the convas to the bounding box of the graph.
    40   ///Sets the scroll region of the convas to the bounding box of the graph.
    41   void updateScrollRegion();
    41   void updateScrollRegion();
    42 
    42 
       
    43   ///This function changes the tool in the graph-editor's hand
       
    44   void changeEditorialTool(int);
       
    45 
    43 protected:
    46 protected:
    44 
    47 
    45   //maximizing, minimizing, restoring window, etc. 
    48   //maximizing, minimizing, restoring window, etc. 
    46   virtual bool on_expose_event(GdkEventExpose *);
    49   virtual bool on_expose_event(GdkEventExpose *);
    47 
    50 
    49 
    52 
    50   ///This function is responsible for the correct
    53   ///This function is responsible for the correct
    51   ///reaction of any action happened in the territory
    54   ///reaction of any action happened in the territory
    52   ///of the canvas
    55   ///of the canvas
    53   bool event_handler(GdkEvent* e, Node n);
    56   bool event_handler(GdkEvent* e, Node n);
       
    57 
       
    58   ///actual event handler
       
    59   ///
       
    60   ///Actual event handler should be stored, to be able to disconnect it and later reconnect it.
       
    61   sigc::connection actual_handler;
       
    62 
       
    63   ///event handler for the case when move-tool is active
       
    64   bool move_event_handler(GdkEvent*);
       
    65   ///event handler for the case when create_node-tool is active
       
    66   bool create_node_event_handler(GdkEvent*);
       
    67   ///event handler for the case when create_edge-tool is active
       
    68   bool create_edge_event_handler(GdkEvent*);
    54 
    69 
    55   ///The graph, on which we work
    70   ///The graph, on which we work
    56   Graph g;
    71   Graph g;
    57 
    72 
    58   ///Map of nodes of graph
    73   ///Map of nodes of graph
    80   ///Remembers which Gnome::Canvas::Item was pressed.
    95   ///Remembers which Gnome::Canvas::Item was pressed.
    81   ///this variable is needed, because
    96   ///this variable is needed, because
    82   ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
    97   ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
    83   ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
    98   ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
    84   Gnome::Canvas::Item * active_item;
    99   Gnome::Canvas::Item * active_item;
       
   100   Graph::NodeIt active_node;
    85 
   101 
    86   static const int zoom_step = 5;
   102   static const int zoom_step = 5;
    87 };
   103 };
    88 
   104 
    89 #endif //GRAPH_DISPLAYER_CANVAS_H
   105 #endif //GRAPH_DISPLAYER_CANVAS_H