[GRASS-dev] d.m: use d.legend -ns

Maciek Sieczka werchowyna at epf.pl
Sun May 7 15:06:08 EDT 2006


Hi

A small patch for d.m's barscale.tcl to enable drawing arrow and scale
alone. Can I kindly ask for applying it? Attached.

Maciek


--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/
-------------- next part --------------
Index: barscale.tcl
===================================================================
RCS file: /home/grass/grassrepository/grass6/gui/tcltk/d.m/barscale.tcl,v
retrieving revision 1.1
diff -u -r1.1 barscale.tcl
--- barscale.tcl	18 Feb 2006 11:55:34 -0000	1.1
+++ barscale.tcl	7 May 2006 18:51:42 -0000
@@ -41,6 +41,8 @@
     set opt($count,feet) 0 
     set opt($count,top) 0 
     set opt($count,mouse) 0 
+    set opt($count,arrow) 0 
+    set opt($count,scale) 0 
     
     incr count
     return $node
@@ -90,7 +92,7 @@
     checkbutton $row.a -text [G_msg "display N. arrow only "] \
     	-variable DmBarscale::opt($id,arrow) 
     checkbutton $row.b -text [G_msg "display scale only"] \
-    	-variable DmBarscale::opt($id,arrow) 
+    	-variable DmBarscale::opt($id,scale) 
     pack $row.a $row.b -side left
     pack $row -side top -fill both -expand yes
 
@@ -126,7 +128,7 @@
     
     set id [Dm::node_id $node]
 
-    foreach key { _check bcolor bcolor_none tcolor at feet line top mouse } {
+    foreach key { _check bcolor bcolor_none tcolor at feet line top mouse arrow scale } {
         Dm::rc_write $depth "$key $opt($id,$key)"
     } 
 }
@@ -170,6 +172,16 @@
     if { $opt($id,feet) != 0} { 
         append cmd " -f"
     }
+    
+    # arrow only
+    if { $opt($id,arrow) != 0 } { 
+        append cmd " -n"
+    }
+    
+    # scale only
+    if { $opt($id,scale) != 0 } { 
+        append cmd " -s"
+    }
 
     # place with coordinates
     if { $opt($id,at) != "" && $opt($id,mouse) == 0 } { 
@@ -183,7 +195,6 @@
         term_panel $cmd
     }
     
-    
 }
 
 proc DmBarscale::print { file node } {
@@ -230,6 +241,8 @@
     set opt($count,feet) "$opt($id,feet)"
     set opt($count,top) "$opt($id,top)"
     set opt($count,mouse) "$opt($id,mouse)" 
+    set opt($count,arrow) "$opt($id,arrow)"
+    set opt($count,scale) "$opt($id,scale)" 
 
     incr count
     return $node


More information about the grass-dev mailing list