Changeset 204:8fec6a6472fe in glemon-0.x
- Timestamp:
- 02/20/07 16:08:30 (18 years ago)
- Branch:
- fastopen
- Phase:
- public
- Tags:
- tip
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/glemon/branches/fastopen@3191
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
graph_displayer_canvas-edge.cc
r179 r204 245 245 ostr << number; 246 246 247 edgetextmap[i]->property_text().set_value(ostr.str());247 // edgetextmap[i]->property_text().set_value(ostr.str()); 248 248 } 249 249 … … 256 256 ostr << number; 257 257 258 edgetextmap[edge]->property_text().set_value(ostr.str());258 // edgetextmap[edge]->property_text().set_value(ostr.str()); 259 259 } 260 260 … … 275 275 { 276 276 edgemap_to_edit=""; 277 edgetextmap[i]->property_text().set_value("");278 } 279 280 } 281 else 282 { 283 edgetextmap[edge]->property_text().set_value("");284 } 285 286 return 0; 287 288 }; 277 // edgetextmap[i]->property_text().set_value(""); 278 } 279 280 } 281 else 282 { 283 // edgetextmap[edge]->property_text().set_value(""); 284 } 285 286 return 0; 287 288 }; -
graph_displayer_canvas-event.cc
r187 r204 341 341 (nodesmap[active_node])->show(); 342 342 343 nodetextmap[active_node]=new Gnome::Canvas::Text(displayed_graph,344 clicked_x+node_property_defaults[N_RADIUS]+5,345 clicked_y+node_property_defaults[N_RADIUS]+5, "");346 nodetextmap[active_node]->property_fill_color().set_value("darkblue");347 nodetextmap[active_node]->raise_to_top();343 // nodetextmap[active_node]=new Gnome::Canvas::Text(displayed_graph, 344 // clicked_x+node_property_defaults[N_RADIUS]+5, 345 // clicked_y+node_property_defaults[N_RADIUS]+5, ""); 346 // nodetextmap[active_node]->property_fill_color().set_value("darkblue"); 347 // nodetextmap[active_node]->raise_to_top(); 348 348 349 349 // mapwin.updateNode(active_node); … … 467 467 text_pos+=(XY(10,10)); 468 468 469 edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph,470 text_pos.x, text_pos.y, "");471 edgetextmap[active_edge]->property_fill_color().set_value(472 "darkgreen");473 edgetextmap[active_edge]->raise_to_top();469 // edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, 470 // text_pos.x, text_pos.y, ""); 471 // edgetextmap[active_edge]->property_fill_color().set_value( 472 // "darkgreen"); 473 // edgetextmap[active_edge]->raise_to_top(); 474 474 475 475 propertyUpdate(active_edge); … … 639 639 { 640 640 //at the same time only one can be active 641 if(nodetextmap[i]==active_item)642 {643 clicked_node=i;644 }641 // if(nodetextmap[i]==active_item) 642 // { 643 // clicked_node=i; 644 // } 645 645 } 646 646 … … 664 664 { 665 665 //at the same time only one can be active 666 if(edgetextmap[i]==active_item)667 {668 clicked_edge=i;669 }666 // if(edgetextmap[i]==active_item) 667 // { 668 // clicked_edge=i; 669 // } 670 670 } 671 671 … … 691 691 692 692 //and there is activated map 693 if(nodetextmap[clicked_node]->property_text().get_value()!="")694 {695 //activate the general variable for it696 active_node=clicked_node;697 698 //create a dialog699 Gtk::Dialog dialog("Edit value", true);700 dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);701 dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);702 Gtk::VBox* vbox = dialog.get_vbox();703 Gtk::SpinButton spin(0.0, 4);704 spin.set_increments(1.0, 10.0);705 spin.set_range(-1000000.0, 1000000.0);706 spin.set_numeric(true);707 spin.set_value(atof(nodetextmap[active_node]->property_text().get_value().c_str()));708 vbox->add(spin);709 spin.show();710 switch (dialog.run())711 {712 case Gtk::RESPONSE_NONE:713 case Gtk::RESPONSE_CANCEL:714 break;715 case Gtk::RESPONSE_ACCEPT:716 double new_value = spin.get_value();717 (*(mytab.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] =718 new_value;719 std::ostringstream ostr;720 ostr << new_value;721 nodetextmap[active_node]->property_text().set_value(ostr.str());722 //mapwin.updateNode(active_node);723 //mapwin.updateNode(Node(INVALID));724 propertyUpdate(Node(INVALID));725 }726 }693 // if(nodetextmap[clicked_node]->property_text().get_value()!="") 694 // { 695 // //activate the general variable for it 696 // active_node=clicked_node; 697 698 // //create a dialog 699 // Gtk::Dialog dialog("Edit value", true); 700 // dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); 701 // dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT); 702 // Gtk::VBox* vbox = dialog.get_vbox(); 703 // Gtk::SpinButton spin(0.0, 4); 704 // spin.set_increments(1.0, 10.0); 705 // spin.set_range(-1000000.0, 1000000.0); 706 // spin.set_numeric(true); 707 // spin.set_value(atof(nodetextmap[active_node]->property_text().get_value().c_str())); 708 // vbox->add(spin); 709 // spin.show(); 710 // switch (dialog.run()) 711 // { 712 // case Gtk::RESPONSE_NONE: 713 // case Gtk::RESPONSE_CANCEL: 714 // break; 715 // case Gtk::RESPONSE_ACCEPT: 716 // double new_value = spin.get_value(); 717 // (*(mytab.mapstorage).nodemap_storage[nodemap_to_edit])[active_node] = 718 // new_value; 719 // std::ostringstream ostr; 720 // ostr << new_value; 721 // nodetextmap[active_node]->property_text().set_value(ostr.str()); 722 // //mapwin.updateNode(active_node); 723 // //mapwin.updateNode(Node(INVALID)); 724 // propertyUpdate(Node(INVALID)); 725 // } 726 // } 727 727 } 728 728 else … … 734 734 735 735 //and there is activated map 736 if(edgetextmap[clicked_edge]->property_text().get_value()!="")737 {738 //activate the general variable for it739 active_edge=clicked_edge;740 741 //create a dialog742 Gtk::Dialog dialog("Edit value", true);743 dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);744 dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT);745 Gtk::VBox* vbox = dialog.get_vbox();746 Gtk::SpinButton spin(0.0, 4);747 spin.set_increments(1.0, 10.0);748 spin.set_range(-1000000.0, 1000000.0);749 spin.set_numeric(true);750 spin.set_value(atof(edgetextmap[active_edge]->property_text().get_value().c_str()));751 vbox->add(spin);752 spin.show();753 switch (dialog.run())754 {755 case Gtk::RESPONSE_NONE:756 case Gtk::RESPONSE_CANCEL:757 break;758 case Gtk::RESPONSE_ACCEPT:759 double new_value = spin.get_value();760 (*(mytab.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] =761 new_value;762 std::ostringstream ostr;763 ostr << new_value;764 edgetextmap[active_edge]->property_text().set_value(765 ostr.str());766 //mapwin.updateEdge(active_edge);767 // mapwin.updateEdge(Edge(INVALID));768 propertyUpdate(Edge(INVALID));769 }770 }736 // if(edgetextmap[clicked_edge]->property_text().get_value()!="") 737 // { 738 // //activate the general variable for it 739 // active_edge=clicked_edge; 740 741 // //create a dialog 742 // Gtk::Dialog dialog("Edit value", true); 743 // dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); 744 // dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_ACCEPT); 745 // Gtk::VBox* vbox = dialog.get_vbox(); 746 // Gtk::SpinButton spin(0.0, 4); 747 // spin.set_increments(1.0, 10.0); 748 // spin.set_range(-1000000.0, 1000000.0); 749 // spin.set_numeric(true); 750 // spin.set_value(atof(edgetextmap[active_edge]->property_text().get_value().c_str())); 751 // vbox->add(spin); 752 // spin.show(); 753 // switch (dialog.run()) 754 // { 755 // case Gtk::RESPONSE_NONE: 756 // case Gtk::RESPONSE_CANCEL: 757 // break; 758 // case Gtk::RESPONSE_ACCEPT: 759 // double new_value = spin.get_value(); 760 // (*(mytab.mapstorage).edgemap_storage[edgemap_to_edit])[active_edge] = 761 // new_value; 762 // std::ostringstream ostr; 763 // ostr << new_value; 764 // edgetextmap[active_edge]->property_text().set_value( 765 // ostr.str()); 766 // //mapwin.updateEdge(active_edge); 767 // // mapwin.updateEdge(Edge(INVALID)); 768 // propertyUpdate(Edge(INVALID)); 769 // } 770 // } 771 771 } 772 772 break; … … 781 781 void GraphDisplayerCanvas::deleteItem(Node node_to_delete) 782 782 { 783 delete(nodetextmap[node_to_delete]);783 // delete(nodetextmap[node_to_delete]); 784 784 delete(nodesmap[node_to_delete]); 785 785 (mytab.mapstorage).graph.erase(node_to_delete); … … 788 788 void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete) 789 789 { 790 delete(edgetextmap[edge_to_delete]);790 // delete(edgetextmap[edge_to_delete]); 791 791 delete(edgesmap[edge_to_delete]); 792 792 (mytab.mapstorage).graph.erase(edge_to_delete); … … 796 796 { 797 797 new_place+=(XY(10,10)); 798 edgetextmap[forming_edge]->property_x().set_value(new_place.x);799 edgetextmap[forming_edge]->property_y().set_value(new_place.y);798 // edgetextmap[forming_edge]->property_x().set_value(new_place.x); 799 // edgetextmap[forming_edge]->property_y().set_value(new_place.y); 800 800 } 801 801 … … 849 849 //repositioning node and its text 850 850 moved_item->move(dx, dy); 851 nodetextmap[moved_node]->move(dx, dy);851 // nodetextmap[moved_node]->move(dx, dy); 852 852 853 853 // the new coordinates of the centre of the node … … 885 885 XY text_pos=mytab.mapstorage.arrow_pos[ei]; 886 886 text_pos+=(XY(10,10)); 887 edgetextmap[ei]->property_x().set_value(text_pos.x);888 edgetextmap[ei]->property_y().set_value(text_pos.y);887 // edgetextmap[ei]->property_x().set_value(text_pos.x); 888 // edgetextmap[ei]->property_y().set_value(text_pos.y); 889 889 } 890 890 … … 909 909 XY text_pos=mytab.mapstorage.arrow_pos[ei]; 910 910 text_pos+=(XY(10,10)); 911 edgetextmap[ei]->property_x().set_value(text_pos.x);912 edgetextmap[ei]->property_y().set_value(text_pos.y);911 // edgetextmap[ei]->property_x().set_value(text_pos.x); 912 // edgetextmap[ei]->property_y().set_value(text_pos.y); 913 913 } 914 914 } -
graph_displayer_canvas-node.cc
r179 r204 292 292 ostr << number; 293 293 294 nodetextmap[i]->property_text().set_value(ostr.str());294 // nodetextmap[i]->property_text().set_value(ostr.str()); 295 295 } 296 296 } … … 302 302 ostr << number; 303 303 304 nodetextmap[node]->property_text().set_value(ostr.str());304 // nodetextmap[node]->property_text().set_value(ostr.str()); 305 305 } 306 306 return 0; … … 320 320 { 321 321 nodemap_to_edit=""; 322 nodetextmap[i]->property_text().set_value("");323 } 324 } 325 else 326 { 327 nodetextmap[node]->property_text().set_value("");328 } 329 return 0; 330 }; 322 // nodetextmap[i]->property_text().set_value(""); 323 } 324 } 325 else 326 { 327 // nodetextmap[node]->property_text().set_value(""); 328 } 329 return 0; 330 }; -
graph_displayer_canvas.cc
r187 r204 73 73 { 74 74 delete nodesmap[n]; 75 delete nodetextmap[n];75 // delete nodetextmap[n]; 76 76 } 77 77 … … 79 79 { 80 80 delete edgesmap[e]; 81 delete edgetextmap[e];81 // delete edgetextmap[e]; 82 82 } 83 83 } … … 223 223 text_pos+=(XY(10,10)); 224 224 225 edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");226 edgetextmap[i]->property_fill_color().set_value("darkgreen");227 edgetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::mapEditEventHandler), false);228 edgetextmap[i]->raise_to_top();225 // edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, ""); 226 // edgetextmap[i]->property_fill_color().set_value("darkgreen"); 227 // edgetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::mapEditEventHandler), false); 228 // edgetextmap[i]->raise_to_top(); 229 229 } 230 230 … … 251 251 ((mytab.mapstorage).coords[i].y+node_property_defaults[N_RADIUS]+5)); 252 252 253 nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph,254 text_pos.x, text_pos.y, "");255 nodetextmap[i]->property_fill_color().set_value("darkblue");256 nodetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::mapEditEventHandler), false);257 nodetextmap[i]->raise_to_top();253 // nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph, 254 // text_pos.x, text_pos.y, ""); 255 // nodetextmap[i]->property_fill_color().set_value("darkblue"); 256 // nodetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::mapEditEventHandler), false); 257 // nodetextmap[i]->raise_to_top(); 258 258 } 259 259 … … 285 285 { 286 286 delete nodesmap[n]; 287 delete nodetextmap[n];287 // delete nodetextmap[n]; 288 288 } 289 289 … … 291 291 { 292 292 delete edgesmap[e]; 293 delete edgetextmap[e];293 // delete edgetextmap[e]; 294 294 } 295 295
Note: See TracChangeset
for help on using the changeset viewer.