Changeset 204:8fec6a6472fe in glemon-0.x for graph_displayer_canvas-event.cc
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.