496 if(edgesmap[i]==active_item) |
501 if(edgesmap[i]==active_item) |
497 { |
502 { |
498 active_edge=i; |
503 active_edge=i; |
499 } |
504 } |
500 } |
505 } |
501 if(active_edge!=INVALID) |
506 if((active_edge!=INVALID)&&(edgetextmap[active_edge]->property_text().get_value()!="")) |
502 { |
507 { |
503 if(canvasentrywidget) |
508 if(canvasentrywidget) |
504 { |
509 { |
505 delete(canvasentrywidget); |
510 delete(canvasentrywidget); |
506 } |
511 } |
507 entrywidget.show(); |
512 entrywidget.show(); |
508 entrywidget.set_text("Hello!"); |
513 entrywidget.set_text(edgetextmap[active_edge]->property_text().get_value()); |
509 // canvasentrywidget=new Gnome::Canvas::Widget(displayed_graph, clicked_x, clicked_y,entrywidget); |
514 xy<double> entry_coos; |
510 canvasentrywidget=new Gnome::Canvas::Widget(displayed_graph, e->button.x, e->button.y, entrywidget); |
515 entry_coos.x=(edgetextmap[active_edge])->property_x().get_value(); |
511 canvasentrywidget->property_width().set_value(70); |
516 entry_coos.x-=edgetextmap[active_edge]->property_text_width().get_value()/2; |
512 canvasentrywidget->property_height().set_value(50); |
517 entry_coos.y=(edgetextmap[active_edge])->property_y().get_value(); |
513 canvasentrywidget->show(); |
518 entry_coos.y-=edgetextmap[active_edge]->property_text_height().get_value()*1.5/2; |
514 *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("red"); |
519 canvasentrywidget=new Gnome::Canvas::Widget(displayed_graph, entry_coos.x, entry_coos.y, entrywidget); |
515 } |
520 canvasentrywidget->property_width().set_value(edgetextmap[active_edge]->property_text_width().get_value()*1.5); |
516 active_item=NULL; // !!!!!!!!!!!!!!!!!!!!!!!!!!! |
521 canvasentrywidget->property_height().set_value(edgetextmap[active_edge]->property_text_height().get_value()*1.5); |
517 active_edge=INVALID; // !!!!!!!!!!!!!!!!!!!!!!!!!!! |
522 } |
518 break; |
523 break; |
519 default: |
524 default: |
520 break; |
525 break; |
521 } |
526 } |
522 return false; |
527 return false; |