Changeset 1524:587a823bcdd0 in lemon-0.x
- Timestamp:
- 06/29/05 17:41:33 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2010
- Location:
- gui
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
gui/broken_edge.cc
r1505 r1524 8 8 arrow=new Gnome::Canvas::Polygon(g); 9 9 *arrow << Gnome::Canvas::Properties::fill_color("red"); 10 arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edge _former_event_handler));11 set _points(p);10 arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edgeFormerEventHandler)); 11 setPoints(p); 12 12 } 13 13 … … 17 17 } 18 18 19 void BrokenEdge::set _points(Gnome::Canvas::Points p, bool move)19 void BrokenEdge::setPoints(Gnome::Canvas::Points p, bool move) 20 20 { 21 21 bool set_arrow=false; … … 104 104 } 105 105 106 bool BrokenEdge::edge _former_event_handler(GdkEvent* e)106 bool BrokenEdge::edgeFormerEventHandler(GdkEvent* e) 107 107 { 108 108 switch(e->type) … … 110 110 case GDK_BUTTON_PRESS: 111 111 //we mark the location of the event to be able to calculate parameters of dragging 112 if(gdc.get _actual_tool()!=CREATE_NODE)112 if(gdc.getActualTool()!=CREATE_NODE) 113 113 { 114 gdc.toggle _edge_activity(this, true);114 gdc.toggleEdgeActivity(this, true); 115 115 clicked_x=e->button.x; 116 116 clicked_y=e->button.y; … … 119 119 break; 120 120 case GDK_BUTTON_RELEASE: 121 if(gdc.get _actual_tool()!=CREATE_NODE)121 if(gdc.getActualTool()!=CREATE_NODE) 122 122 { 123 gdc.toggle _edge_activity(this, false);123 gdc.toggleEdgeActivity(this, false); 124 124 isbutton=false; 125 125 } … … 143 143 points_new.push_back(my_points[2]); 144 144 145 set _points(points_new);146 gdc.text _reposition(xy<double>(my_points[1].get_x(),my_points[1].get_y()));145 setPoints(points_new); 146 gdc.textReposition(xy<double>(my_points[1].get_x(),my_points[1].get_y())); 147 147 148 148 clicked_x=e->motion.x; … … 156 156 } 157 157 158 xy<double> BrokenEdge::get _arrow_pos()158 xy<double> BrokenEdge::getArrowPos() 159 159 { 160 160 xy<double> ret_val(my_points[1].get_x(),my_points[1].get_y()); -
gui/broken_edge.h
r1505 r1524 27 27 28 28 ///event handler for forming edges 29 bool edge _former_event_handler(GdkEvent*);29 bool edgeFormerEventHandler(GdkEvent*); 30 30 public: 31 31 BrokenEdge(Gnome::Canvas::Group &, Gnome::Canvas::Points, GraphDisplayerCanvas &); 32 32 ~BrokenEdge(); 33 void set _points(Gnome::Canvas::Points, bool move=false);34 xy<double> get _arrow_pos();33 void setPoints(Gnome::Canvas::Points, bool move=false); 34 xy<double> getArrowPos(); 35 35 }; 36 36 -
gui/edit_win.cc
r1494 r1524 2 2 #include <set> 3 3 4 bool EditWin::close _if_escape_is_pressed(GdkEventKey* e)4 bool EditWin::closeIfEscapeIsPressed(GdkEventKey* e) 5 5 { 6 6 if(e->keyval==GDK_Escape) … … 16 16 set_default_size(200, 50); 17 17 set_keep_above(true); 18 signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::close _if_escape_is_pressed));18 signal_key_press_event().connect(sigc::mem_fun(*this, &EditWin::closeIfEscapeIsPressed)); 19 19 20 20 //buttons array -
gui/edit_win.h
r1478 r1524 30 30 EditWin(const std::string& title, GraphDisplayerCanvas &); 31 31 32 virtual bool close _if_escape_is_pressed(GdkEventKey*);32 virtual bool closeIfEscapeIsPressed(GdkEventKey*); 33 33 34 34 ///Callback function in case of button pression. -
gui/graph_displayer_canvas-event.cc
r1512 r1524 21 21 generated->type=GDK_BUTTON_RELEASE; 22 22 generated->button.button=3; 23 create _edge_event_handler(generated);23 createEdgeEventHandler(generated); 24 24 } 25 25 … … 29 29 { 30 30 case MOVE: 31 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::move _event_handler), false);31 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false); 32 32 break; 33 33 34 34 //it has to assigned to canvas, because all the canvas has to be monitored, not only the elements of the already drawn group 35 35 case CREATE_NODE: 36 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create _node_event_handler), false);36 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false); 37 37 break; 38 38 39 39 case CREATE_EDGE: 40 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create _edge_event_handler), false);40 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createEdgeEventHandler), false); 41 41 break; 42 42 43 43 case ERASER: 44 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraser _event_handler), false);44 actual_handler=displayed_graph.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::eraserEventHandler), false); 45 45 break; 46 46 … … 50 50 } 51 51 52 int GraphDisplayerCanvas::get _actual_tool()52 int GraphDisplayerCanvas::getActualTool() 53 53 { 54 54 return actual_tool; 55 55 } 56 56 57 bool GraphDisplayerCanvas::move _event_handler(GdkEvent* e)57 bool GraphDisplayerCanvas::moveEventHandler(GdkEvent* e) 58 58 { 59 59 switch(e->type) … … 125 125 if(isbutton==3) 126 126 { 127 edgesmap[ei]->set _points(coos);127 edgesmap[ei]->setPoints(coos); 128 128 } 129 129 else 130 130 { 131 edgesmap[ei]->set _points(coos,true);131 edgesmap[ei]->setPoints(coos,true); 132 132 } 133 133 134 134 //reposition of edgetext 135 xy<double> text_pos=edgesmap[ei]->get _arrow_pos();135 xy<double> text_pos=edgesmap[ei]->getArrowPos(); 136 136 text_pos+=(xy<double>(10,10)); 137 137 edgetextmap[ei]->property_x().set_value(text_pos.x); … … 153 153 if(isbutton==3) 154 154 { 155 edgesmap[ei]->set _points(coos);155 edgesmap[ei]->setPoints(coos); 156 156 } 157 157 else 158 158 { 159 edgesmap[ei]->set _points(coos,true);159 edgesmap[ei]->setPoints(coos,true); 160 160 } 161 161 162 xy<double> text_pos=edgesmap[ei]->get _arrow_pos();162 xy<double> text_pos=edgesmap[ei]->getArrowPos(); 163 163 text_pos+=(xy<double>(10,10)); 164 164 edgetextmap[ei]->property_x().set_value(text_pos.x); … … 172 172 } 173 173 174 bool GraphDisplayerCanvas::create _node_event_handler(GdkEvent* e)174 bool GraphDisplayerCanvas::createNodeEventHandler(GdkEvent* e) 175 175 { 176 176 switch(e->type) … … 197 197 nodetextmap[active_node]->property_fill_color().set_value("darkblue"); 198 198 199 mapwin->update _node(active_node);199 mapwin->updateNode(active_node); 200 200 201 201 break; … … 210 210 generated->motion.y=world_motion_y; 211 211 generated->type=GDK_MOTION_NOTIFY; 212 move _event_handler(generated);212 moveEventHandler(generated); 213 213 break; 214 214 } … … 228 228 } 229 229 230 bool GraphDisplayerCanvas::create _edge_event_handler(GdkEvent* e)230 bool GraphDisplayerCanvas::createEdgeEventHandler(GdkEvent* e) 231 231 { 232 232 switch(e->type) … … 290 290 291 291 //initiating values corresponding to new edge in maps 292 mapstorage.init _maps_for_edge(active_edge);292 mapstorage.initMapsForEdge(active_edge); 293 293 294 294 //calculating coordinates of new edge … … 312 312 313 313 //initializing edge-text as well, to empty string 314 xy<double> text_pos=edgesmap[active_edge]->get _arrow_pos();314 xy<double> text_pos=edgesmap[active_edge]->getArrowPos(); 315 315 text_pos+=(xy<double>(10,10)); 316 316 … … 319 319 320 320 //updating its properties 321 mapwin->update _edge(active_edge);321 mapwin->updateEdge(active_edge); 322 322 } 323 323 else … … 362 362 } 363 363 364 bool GraphDisplayerCanvas::eraser _event_handler(GdkEvent* e)364 bool GraphDisplayerCanvas::eraserEventHandler(GdkEvent* e) 365 365 { 366 366 switch(e->type) … … 415 415 for(std::set<Graph::Edge>::iterator edge_set_it=edges_to_delete.begin();edge_set_it!=edges_to_delete.end();edge_set_it++) 416 416 { 417 delete _item(*edge_set_it);418 } 419 delete _item(active_node);417 deleteItem(*edge_set_it); 418 } 419 deleteItem(active_node); 420 420 } 421 421 //a simple edge was chosen 422 422 else 423 423 { 424 delete _item(active_edge);424 deleteItem(active_edge); 425 425 } 426 426 … … 454 454 } 455 455 456 void GraphDisplayerCanvas::delete _item(NodeIt node_to_delete)456 void GraphDisplayerCanvas::deleteItem(NodeIt node_to_delete) 457 457 { 458 458 delete(nodetextmap[node_to_delete]); … … 461 461 } 462 462 463 void GraphDisplayerCanvas::delete _item(EdgeIt edge_to_delete)463 void GraphDisplayerCanvas::deleteItem(EdgeIt edge_to_delete) 464 464 { 465 465 delete(edgetextmap[edge_to_delete]); … … 468 468 } 469 469 470 void GraphDisplayerCanvas::delete _item(Graph::Edge edge_to_delete)470 void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete) 471 471 { 472 472 delete(edgetextmap[edge_to_delete]); … … 475 475 } 476 476 477 void GraphDisplayerCanvas::text _reposition(xy<double> new_place)477 void GraphDisplayerCanvas::textReposition(xy<double> new_place) 478 478 { 479 479 new_place+=(xy<double>(10,10)); … … 482 482 } 483 483 484 void GraphDisplayerCanvas::toggle _edge_activity(BrokenEdge* active_bre, bool on)484 void GraphDisplayerCanvas::toggleEdgeActivity(BrokenEdge* active_bre, bool on) 485 485 { 486 486 if(on) -
gui/graph_displayer_canvas.cc
r1512 r1524 6 6 { 7 7 8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::create _node_event_handler), false);8 actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::createNodeEventHandler), false); 9 9 actual_tool=CREATE_NODE; 10 10 … … 31 31 //initializing edge-text as well, to empty string 32 32 33 xy<double> text_pos=edgesmap[i]->get _arrow_pos();33 xy<double> text_pos=edgesmap[i]->getArrowPos(); 34 34 text_pos+=(xy<double>(10,10)); 35 35 -
gui/graph_displayer_canvas.h
r1512 r1524 71 71 ///of the canvas 72 72 ///DEPRECATED!!!! 73 bool event _handler(GdkEvent* e, Node n);73 bool eventHandler(GdkEvent* e, Node n); 74 74 75 75 ///actual event handler … … 79 79 80 80 ///event handler for the case when move-tool is active 81 bool move _event_handler(GdkEvent*);81 bool moveEventHandler(GdkEvent*); 82 82 ///event handler for the case when create_node-tool is active 83 bool create _node_event_handler(GdkEvent*);83 bool createNodeEventHandler(GdkEvent*); 84 84 ///event handler for the case when create_edge-tool is active 85 bool create _edge_event_handler(GdkEvent*);85 bool createEdgeEventHandler(GdkEvent*); 86 86 ///event handler for the case when eraser-tool is active 87 bool eraser _event_handler(GdkEvent*);87 bool eraserEventHandler(GdkEvent*); 88 88 ///event handler for the case when eraser-tool is active 89 bool edge _map_edit_event_handler(GdkEvent*);89 bool edgeMapEditEventHandler(GdkEvent*); 90 90 91 91 public: 92 92 ///Moves the text to new place 93 void text _reposition(xy<double>);93 void textReposition(xy<double>); 94 94 ///Activates an edge belonging to a BrokenEdge 95 void toggle _edge_activity(BrokenEdge*, bool);95 void toggleEdgeActivity(BrokenEdge*, bool); 96 96 97 97 public: 98 98 ///\return the actual tool in hand 99 int get _actual_tool();99 int getActualTool(); 100 100 101 101 private: 102 102 ///Deletes the given element. 103 void delete _item(NodeIt);103 void deleteItem(NodeIt); 104 104 ///Deletes the given element. 105 void delete _item(EdgeIt);105 void deleteItem(EdgeIt); 106 106 ///Deletes the given element. 107 void delete _item(Graph::Edge);107 void deleteItem(Graph::Edge); 108 108 109 109 private: 110 110 111 111 ///The graph, on which we work 112 Graph g;112 Graph & g; 113 113 114 114 ///Map of nodes of graph -
gui/map_win.cc
r1512 r1524 2 2 #include <set> 3 3 4 bool MapWin::close _if_escape_is_pressed(GdkEventKey* e)4 bool MapWin::closeIfEscapeIsPressed(GdkEventKey* e) 5 5 { 6 6 if(e->keyval==GDK_Escape) … … 16 16 set_default_size(200, 50); 17 17 18 signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::close _if_escape_is_pressed));18 signal_key_press_event().connect(sigc::mem_fun(*this, &MapWin::closeIfEscapeIsPressed)); 19 19 20 20 e_combo_array=new Gtk::Combo [EDGE_PROPERTY_NUM]; … … 75 75 sigc::bind 76 76 ( 77 sigc::mem_fun(*this, &MapWin::e _combo_changed),77 sigc::mem_fun(*this, &MapWin::eComboChanged), 78 78 i 79 79 ) … … 154 154 sigc::bind 155 155 ( 156 sigc::mem_fun(*this, &MapWin::n _combo_changed),156 sigc::mem_fun(*this, &MapWin::nComboChanged), 157 157 i 158 158 ) … … 180 180 } 181 181 182 void MapWin::e _combo_changed(int prop)182 void MapWin::eComboChanged(int prop) 183 183 { 184 184 Gtk::Entry* entry = e_combo_array[prop].get_entry(); … … 215 215 }; 216 216 217 void MapWin::n _combo_changed(int prop)217 void MapWin::nComboChanged(int prop) 218 218 { 219 219 … … 251 251 }; 252 252 253 void MapWin::update _node(Graph::Node node)253 void MapWin::updateNode(Graph::Node node) 254 254 { 255 255 for(int i=0;i<NODE_PROPERTY_NUM;i++) … … 290 290 } 291 291 292 void MapWin::update _edge(Graph::Edge edge)292 void MapWin::updateEdge(Graph::Edge edge) 293 293 { 294 294 for(int i=0;i<EDGE_PROPERTY_NUM;i++) -
gui/map_win.h
r1512 r1524 43 43 ///appropriate function of the \ref GraphDisplayerCanvas 44 44 ///to change the visible values of that attribute. 45 virtual void e _combo_changed(int);45 virtual void eComboChanged(int); 46 46 ///If a radiobutton is clicked, this function determines 47 47 ///which button was that and after that calls the 48 48 ///appropriate function of the \ref GraphDisplayerCanvas 49 49 ///to change the visible values of that attribute. 50 virtual void n _combo_changed(int);50 virtual void nComboChanged(int); 51 51 52 52 ///This function is created to set the appropriate maps on the newly created node 53 void update _node(Graph::Node);53 void updateNode(Graph::Node); 54 54 55 55 ///This function is created to set the appropriate maps on the newly created edge 56 void update _edge(Graph::Edge);56 void updateEdge(Graph::Edge); 57 57 58 virtual bool close _if_escape_is_pressed(GdkEventKey*);58 virtual bool closeIfEscapeIsPressed(GdkEventKey*); 59 59 }; 60 60 -
gui/mapstorage.cc
r1512 r1524 101 101 } 102 102 103 void MapStorage::init _maps_for_edge(Graph::Edge e)103 void MapStorage::initMapsForEdge(Graph::Edge e) 104 104 { 105 105 e=e; -
gui/mapstorage.h
r1523 r1524 83 83 84 84 ///This function sets a default base value for the newly created node 85 void init _maps_for_node(NodeIt);85 void initMapsForNode(NodeIt); 86 86 87 87 ///This function sets a default base value for the newly created node 88 void init _maps_for_edge(Graph::Edge);88 void initMapsForEdge(Graph::Edge); 89 89 }; 90 90
Note: See TracChangeset
for help on using the changeset viewer.