equal
deleted
inserted
replaced
562 { |
562 { |
563 //for determine, whether it was an edge |
563 //for determine, whether it was an edge |
564 Edge clicked_edge=INVALID; |
564 Edge clicked_edge=INVALID; |
565 |
565 |
566 //find the activated item between texts |
566 //find the activated item between texts |
567 active_item=(get_item_at(e->button.x, e->button.y)); |
567 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); |
|
568 active_item=(get_item_at(clicked_x, clicked_y)); |
568 for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) |
569 for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) |
569 { |
570 { |
570 if(edgetextmap[i]==active_item) |
571 if(edgetextmap[i]==active_item) |
571 { |
572 { |
572 clicked_edge=i; |
573 clicked_edge=i; |
574 } |
575 } |
575 |
576 |
576 //if it was not between texts, search for it between edges |
577 //if it was not between texts, search for it between edges |
577 if(clicked_edge==INVALID) |
578 if(clicked_edge==INVALID) |
578 { |
579 { |
579 window_to_world (e->button.x, e->button.y, clicked_x, clicked_y); |
|
580 active_item=(get_item_at(clicked_x, clicked_y)); |
|
581 |
|
582 for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) |
580 for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i) |
583 { |
581 { |
584 //at the same time only one can be active |
582 //at the same time only one can be active |
585 if((edgesmap[i]==active_item)||(edgetextmap[i]==active_item)) |
583 if((edgesmap[i]==active_item)||(edgetextmap[i]==active_item)) |
586 { |
584 { |
590 } |
588 } |
591 //if it was really an edge... |
589 //if it was really an edge... |
592 if(clicked_edge!=INVALID) |
590 if(clicked_edge!=INVALID) |
593 { |
591 { |
594 // the id map is not editable |
592 // the id map is not editable |
595 if (nodemap_to_edit == "id") return 0; |
593 if (edgemap_to_edit == "id") return 0; |
|
594 |
596 //If there is already edited edge, it has to be saved first |
595 //If there is already edited edge, it has to be saved first |
597 if(entrywidget.is_visible()) |
596 if(entrywidget.is_visible()) |
598 { |
597 { |
599 GdkEvent * generated=new GdkEvent(); |
598 GdkEvent * generated=new GdkEvent(); |
600 generated->type=GDK_KEY_PRESS; |
599 generated->type=GDK_KEY_PRESS; |