]> granicus.if.org Git - graphviz/commitdiff
smyrna single select with right click added
authorarif <devnull@localhost>
Tue, 3 Nov 2009 22:13:43 +0000 (22:13 +0000)
committerarif <devnull@localhost>
Tue, 3 Nov 2009 22:13:43 +0000 (22:13 +0000)
cmd/smyrna/gltemplate.c
cmd/smyrna/gui/appmouse.c
cmd/smyrna/gui/beacon.c
cmd/smyrna/topview.c

index ca346ceaa0b348be8b12631b8bc20708abdb8750..1417781ff66852742a921cd02d032e373a37473b 100755 (executable)
@@ -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;
index 97ed5d43c372fc5f1f02b0787909ab48aeffc327..b654b6460cb426239a18e0725c4d0bbb9627671c 100644 (file)
@@ -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;
 
index 27d3724a952cae52211ab459e648c3b111784ce9..8ac8c9a179a3e2f504ccf663f8d84b834ff8a3d1 100644 (file)
@@ -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;
index 4c2f32ba4b4402b9425b338b4bd971ed07bfc808..b3236b2548635169ea8e44f29a0f2db681a9480c 100755 (executable)
@@ -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;