]> granicus.if.org Git - graphviz/commitdiff
disabling edge or node selection from setting windows
authorarif <devnull@localhost>
Thu, 19 Nov 2009 20:24:02 +0000 (20:24 +0000)
committerarif <devnull@localhost>
Thu, 19 Nov 2009 20:24:02 +0000 (20:24 +0000)
cmd/smyrna/gui/beacon.c
cmd/smyrna/selection.c
share/gui/attr_widgets.dot
share/gui/template.dot

index 7fed35bb76e1621f15f8a5a4f59345146750cf72..d73da6810499a3c0ddf824e6343992812d77f3b7 100644 (file)
@@ -71,6 +71,7 @@ static int is_edge_picked(topview_edge * e)
     return 0;
 }
 
+
 void pick_node_from_coords(float x, float y, float z)
 {
     topview_node *n;
@@ -82,6 +83,8 @@ void pick_node_from_coords(float x, float y, float z)
     float a, b, c;
     double d;
     int ind;
+    int selnodes=atoi(agget(view->g[view->activeGraph],"nodesselectable"));
+    int seledges=atoi(agget(view->g[view->activeGraph],"edgesselectable"));
     sn = (topview_node *) 0;
     se = (topview_edge *) 0;
 
@@ -89,10 +92,11 @@ void pick_node_from_coords(float x, float y, float z)
 
 
 
-    for (ind = 0; ind < view->Topview->Nodecount; ind++) {
+    for (ind = 0;( (selnodes)&&(ind < view->Topview->Nodecount)); ind++) {
        n = &view->Topview->Nodes[ind];
-       if (!n->data.Visible)
-           continue;
+       if (!select_node)
+           break;
+
 
        a = ABS(n->distorted_x - view->mouse.GLpos.x);
        b = ABS(n->distorted_y - view->mouse.GLpos.y);
@@ -104,7 +108,7 @@ void pick_node_from_coords(float x, float y, float z)
        }
     }
 
-    for (ind = 0; ind < view->Topview->Edgecount; ind++) {
+    for (ind = 0; ((seledges)&&(ind < view->Topview->Edgecount)); ind++) {
        point3f p1, p2, p3;
        e = &view->Topview->Edges[ind];
        if (!e->data.Visible)
@@ -129,7 +133,8 @@ void pick_node_from_coords(float x, float y, float z)
        }
     }
 
-    if (closest_dif < closest_dif2 * 3) {
+    if ((closest_dif < closest_dif2 * 3) ) 
+    {
        if (sn) {
            if (!is_node_picked(sn))
                add_to_pick_list(sn);
index f0bf50ba9f529445c5ed1a0e44f979059c74787a..a3da38d8018311eb7eb283a53b8bae12abb65561 100755 (executable)
@@ -673,8 +673,12 @@ static void edge_rectangle_select(ViewInfo* v)
 }
 void rectangle_select(ViewInfo* v)
 {
-    node_rectangle_select(v);
-    edge_rectangle_select(v);
+    int selnodes=atoi(agget(view->g[view->activeGraph],"nodesselectable"));
+    int seledges=atoi(agget(view->g[view->activeGraph],"edgesselectable"));
+    if(selnodes)
+       node_rectangle_select(v);
+    if(seledges)
+        edge_rectangle_select(v);
 }
 
 
index b0e2f73d43b681c13dbe5fdc72559da4d46709be..7e51193938007566fbc6af105d0288038ac1847b 100644 (file)
@@ -18,6 +18,8 @@ digraph smyrna_attr_widgets
     graph[check_box_gridvisible="settingsChkBox3"];\r
     graph[check_box_drawnodes="settingsChkBox5-1"];\r
     graph[check_box_drawedges="settingsChkBox5-2"];\r
+    graph[check_box_edgesselectable="chkboxEdgeSelect"];\r
+    graph[check_box_nodesselectable="chkboxNodeSelect"];\r
     graph[combobox_labelglutfont="labelfont"];\r
     graph[combobox_defaultnodeshape="settingscombobox1"];\r
     graph[combobox_colortheme="colorthemecb"];\r
index e3e53961b545251db5d163f9e56d71df4acf0d60..fd4a3f8bdbf2dc47e4d999bc859fe8a438c67ca5 100644 (file)
@@ -61,8 +61,8 @@ strict digraph template {
                defaultedgecolor="pink"
                edgecolorattribute=""
                nodesize="50"
-
-
+               nodesselectable="1"
+               edgesselectable="1"
 
        ];