From: arif Date: Tue, 3 Nov 2009 22:13:43 +0000 (+0000) Subject: smyrna single select with right click added X-Git-Tag: LAST_LIBGRAPH~32^2~1602 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffa0c15f4cc13edc0335908347ac5476a33a782e;p=graphviz smyrna single select with right click added --- diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index ca346ceaa..1417781ff 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -299,9 +299,9 @@ static gboolean button_release_event(GtkWidget * widget, if (event->button == 1) //left click release - appmouse_left_click_up(view,(int) event->x,(int) event->x); + appmouse_left_click_up(view,(int) event->x,(int) event->y); if (event->button == 3) //right click - appmouse_right_click_up(view,(int) event->x,(int) event->x); + appmouse_right_click_up(view,(int) event->x,(int) event->y); expose_event(view->drawing_area, NULL, NULL); dx = 0.0; dy = 0.0; diff --git a/cmd/smyrna/gui/appmouse.c b/cmd/smyrna/gui/appmouse.c index 97ed5d43c..b654b6460 100644 --- a/cmd/smyrna/gui/appmouse.c +++ b/cmd/smyrna/gui/appmouse.c @@ -19,6 +19,8 @@ #include "arcball.h" #include "topview.h" #include "glmotion.h" +#include "beacon.h" + static float prevX=0; static float prevY=0; @@ -41,7 +43,8 @@ static void appmouse_left_click(ViewInfo* v,int x,int y) } static void appmouse_right_click(ViewInfo* v,int x,int y) { - + + pick_node_from_coords(view->mouse.GLfinalPos.x,view->mouse.GLfinalPos.y,view->mouse.GLfinalPos.z); } @@ -50,7 +53,12 @@ static void appmouse_down(ViewInfo* v,int x,int y) v->mouse.down=1; v->mouse.initPos.x=x; v->mouse.initPos.y=y; + v->mouse.pos.x=x; + v->mouse.pos.y=y; + GetFixedOGLPos((float) x,y, v->GLDepth,&v->mouse.GLinitPos.x,&v->mouse.GLinitPos.y,&v->mouse.GLinitPos.z); + GetFixedOGLPos((float) x,y,v->GLDepth, &v->mouse.GLpos.x,&v->mouse.GLpos.y,&v->mouse.GLpos.z); + prevX=0; prevY=0; diff --git a/cmd/smyrna/gui/beacon.c b/cmd/smyrna/gui/beacon.c index 27d3724a9..8ac8c9a17 100644 --- a/cmd/smyrna/gui/beacon.c +++ b/cmd/smyrna/gui/beacon.c @@ -39,6 +39,7 @@ static int remove_edge_from_pick_list(topview_edge * e) realloc(view->Topview->picked_edges, sizeof(topview_edge *) * view->Topview->picked_edge_count); + deselect_edge(e); return 1; } return 0; @@ -51,6 +52,7 @@ static int add_edge_to_pick_list(topview_edge * e) realloc(view->Topview->picked_edges, sizeof(topview_edge *) * view->Topview->picked_edge_count); view->Topview->picked_edges[view->Topview->picked_edge_count - 1] = e; + select_edge(e); return 1; } @@ -199,6 +201,7 @@ int remove_from_pick_list(topview_node * n) realloc(view->Topview->picked_nodes, sizeof(topview_node *) * view->Topview->picked_node_count); + deselect_node(n); return 1; } return 0; @@ -211,6 +214,7 @@ int add_to_pick_list(topview_node * n) realloc(view->Topview->picked_nodes, sizeof(topview_node *) * view->Topview->picked_node_count); view->Topview->picked_nodes[view->Topview->picked_node_count - 1] = n; + select_node(n); return 1; } @@ -282,7 +286,7 @@ int draw_node_hint_boxes(void) } glColor4f(0, 1, 0, 0.5); glLineWidth(2); - glBegin(GL_LINES); +/* glBegin(GL_LINES); for (ind = 0; ind < view->Topview->picked_edge_count; ind++) { float x1, x2, y1, y2, z1, z2; e = view->Topview->picked_edges[ind]; @@ -303,7 +307,7 @@ int draw_node_hint_boxes(void) } - glEnd(); + glEnd();*/ glLineWidth(1); for (ind = 0; ind < view->Topview->picked_edge_count; ind++) { float x1, x2, y1, y2, z1, z2; diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 4c2f32ba4..b3236b254 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -1119,8 +1119,10 @@ static int get_color_from_edge(topview_edge * e) return_value = 0; - /*if both head and tail nodes are selected use selection color for edges */ - if ((e->Node1->data.Selected) || (e->Node2->data.Selected)) { + /*if both head and tail nodes are selected use selection color for edges */ + if(e->data.Selected) +// if ((e->Node1->data.Selected) || (e->Node2->data.Selected)) + { glColor4f(view->selectedEdgeColor.R, view->selectedEdgeColor.G, view->selectedEdgeColor.B, view->selectedEdgeColor.A); return return_value;