[GRASS-SVN] r44587 - grass/branches/develbranch_6/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 12 11:49:36 EST 2010


Author: marisn
Date: 2010-12-12 08:49:36 -0800 (Sun, 12 Dec 2010)
New Revision: 44587

Modified:
   grass/branches/develbranch_6/gui/tcltk/gis.m/histogram.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/legend.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/maplabels.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/maptext.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/raster.tcl
   grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
Log:
gis.m Use translatable labels in dropdown lists

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/histogram.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/histogram.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/histogram.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -64,7 +64,8 @@
     set opt($count,1,color) #000000
     set opt($count,1,bgcolor) #ffffff
     set opt($count,1,bgcolor_none) 0
-    set opt($count,1,style) "bar" 
+    set opt($count,1,style) "bar"
+    set opt($count,1,stylelv) ""
     set opt($count,1,font) "" 
     set opt($count,1,nsteps) 255 
     set opt($count,1,nulls) 0 
@@ -169,8 +170,9 @@
     # graph style
     set row [ frame $frm.style ]
     Label $row.a -text [G_msg "Graph style"]
-    ComboBox $row.b -padx 2 -width 4 -textvariable GmHist::opt($id,1,style) \
-		-values {"bar" "pie"} 
+    ComboBox $row.b -padx 2 -width 6 -textvariable GmHist::opt($id,1,style) \
+		-values {"bar" "pie"} \
+		-labels [list [G_msg "bar"] [G_msg "pie"]] -labelsvariable GmHist::opt($id,1,stylelv)
     Label $row.c -text [G_msg "\ttext font "]
     Button $row.d -image [image create photo -file "$iconpath/gui-font.gif"] \
         -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/legend.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/legend.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/legend.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -63,7 +63,8 @@
 
     set opt($count,1,map) "" 
 	set opt($count,1,opacity) 1.0
-    set opt($count,1,color) "black" 
+    set opt($count,1,color) "black"
+    set opt($count,1,colorlv) ""
     set opt($count,1,lines) 0 
     set opt($count,1,thin) 1 
     set opt($count,1,font) "" 
@@ -257,7 +258,8 @@
     Label $row.a -text [G_msg "Legend appearance: text color"] 
     ComboBox $row.b -padx 0 -width 10 -textvariable GmLegend::opt($id,1,color) \
 		-values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"}
+		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"} \
+		-labels [list [G_msg "white"] [G_msg "grey"] [G_msg "gray"] [G_msg "black"] [G_msg "brown"] [G_msg "red"] [G_msg "orange"] [G_msg "yellow"] [G_msg "green"] [G_msg "aqua"] [G_msg "cyan"] [G_msg "indigo"] [G_msg "blue"] [G_msg "purple"] [G_msg "violet"] [G_msg "magenta"]] -labelsvariable GmLegend::opt($id,1,colorlv)
     Label $row.c -text [G_msg "  legend text font "]
     Button $row.d -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
         -helptext [G_msg "select font for text"] \

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/maplabels.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/maplabels.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/maplabels.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -85,8 +85,10 @@
     set opt($count,1,lfontoverstrike) 0
     set opt($count,1,lfill) \#000000 
     set opt($count,1,lwidth)  100
-    set opt($count,1,lanchor) "center_left" 
+    set opt($count,1,lanchor) "center left"
+    set opt($count,1,lanchorlv) ""
     set opt($count,1,ljust) "left" 
+    set opt($count,1,ljustlv) ""
     set opt($count,1,ltxt) ""
     set opt($count,1,lhoffset) 2 ;# space between label and enclosing box
     set opt($count,1,lvoffset) 2 ;# space between label and enclosing box
@@ -194,7 +196,8 @@
     Label $row.a -text [G_msg "Align label with vector object: "] 
     ComboBox $row.b -padx 2 -width 12 -textvariable GmCLabels::opt($id,1,lanchor) \
                     -values {"lower left" "lower center" "lower right" "center left" "center" 
-                    "center right" "upper left" "upper center" "upper right" }
+                    "center right" "upper left" "upper center" "upper right" } \
+                    -labels [list [G_msg "lower left"] [G_msg "lower center"] [G_msg "lower right"] [G_msg "center left"] [G_msg "center"] [G_msg "center right"] [G_msg "upper left"] [G_msg "upper center"] [G_msg "upper right"]] -labelsvariable GmCLabels::opt($id,1,lanchorlv)
     pack $row.a $row.b -side left
     pack $row -side top -fill both -expand yes
 
@@ -214,7 +217,8 @@
     set row [ frame $frm.lbltopt2 ]
     Label $row.a -text [G_msg "Justification: "] 
     ComboBox $row.b -padx 2 -width 7 -textvariable GmCLabels::opt($id,1,ljust) \
-                    -values {"left" "center" "right"}
+                    -values {"left" "center" "right"} \
+                    -labels [list [G_msg "left"] [G_msg "center"] [G_msg "right"]] -labelsvariable GmCLabels::opt($id,1,ljustlv)
     Label $row.c -text [G_msg " Label line max length: "]
     LabelEntry $row.d -textvariable GmCLabels::opt($id,1,lwidth) -width 5 
     pack $row.a $row.b $row.c $row.d -side left

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/maptext.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/maptext.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/maptext.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -58,8 +58,11 @@
     set opt($count,1,fill) \#000000 
     set opt($count,1,width)  100
     set opt($count,1,anchor) "center_left" 
-    set opt($count,1,justify) "left" 
-    set opt($count,1,coordinates) "pixels" 
+    set opt($count,1,anchorlv) ""
+    set opt($count,1,justify) "left"
+    set opt($count,1,justifylv) ""
+    set opt($count,1,coordinates) "pixels"
+    set opt($count,1,coordinateslv) ""
     set opt($count,1,mouseset) 0
     
     set optlist { _check opacity text at font fill width anchor justify coordinates mouseset}
@@ -146,7 +149,8 @@
     set row [ frame $frm.textcoord2 ]
     Label $row.a -text [G_msg "     coordinate type for text placement "] 
     ComboBox $row.b -padx 2 -width 10 -textvariable GmCtext::opt($id,1,coordinates) \
-    	-values {"pixels" "percent" "geographic" } -modifycmd "GmCtext::mouseset $id"
+    	-values {"pixels" "percent" "geographic" } -modifycmd "GmCtext::mouseset $id" \
+    	-labels [list [G_msg "pixels"] [G_msg "percent"] [G_msg "geographic"]] -labelsvariable GmCtext::opt($id,1,coordinateslv)
     checkbutton $row.c -text [G_msg "place with mouse"] \
     	-variable GmCtext::opt($id,1,mouseset) \
     	-command "GmCtext::mouseset $id"
@@ -156,17 +160,19 @@
     # text options1
     set row [ frame $frm.textopt1 ]
     Label $row.a -text [G_msg "     align text with coordinate point  "] 
-    ComboBox $row.b -padx 2 -width 12 -textvariable GmCtext::opt($id,1,anchor) \
+    ComboBox $row.b -padx 2 -width 16 -textvariable GmCtext::opt($id,1,anchor) \
 		-values {"lower_left" "bottom_center" "lower_right" "center_left" "center" 
-		"center_right" "upper_left" "top_center" "upper_right" } 
+		"center_right" "upper_left" "top_center" "upper_right" } \
+		-labels [list [G_msg "lower left"] [G_msg "bottom center"] [G_msg "lower right"] [G_msg "center left"] [G_msg "center"] [G_msg "center right"] [G_msg "upper left"] [G_msg "top center"] [G_msg "upper right"]] -labelsvariable GmCtext::opt($id,1,anchorlv)
     pack $row.a $row.b -side left
     pack $row -side top -fill both -expand yes
 
     # text options2
     set row [ frame $frm.textopt2 ]
     Label $row.a -text [G_msg "     justification"] 
-    ComboBox $row.b -padx 2 -width 7 -textvariable GmCtext::opt($id,1,justify) \
-		-values {"left" "center" "right"} 
+    ComboBox $row.b -padx 2 -width 10 -textvariable GmCtext::opt($id,1,justify) \
+		-values {"left" "center" "right"} \
+		-labels [list [G_msg "left"] [G_msg "center"] [G_msg "right"]] -labelsvariable GmCtext::opt($id,1,justifylv)
     Label $row.c -text [G_msg "  line width"]
     LabelEntry $row.d -textvariable GmCtext::opt($id,1,width) -width 5 
     pack $row.a $row.b $row.c $row.d -side left

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/raster.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/raster.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/raster.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -70,6 +70,7 @@
     set opt($count,1,rastquery) ""
     set opt($count,1,rasttype) ""
     set opt($count,1,bkcolor) ""
+    set opt($count,1,bkcolorlv) ""
     set opt($count,1,overlay) 1
     set opt($count,1,mod) 1
 
@@ -268,8 +269,8 @@
     set row [ frame $frm.bg ]
     Label $row.a -text [G_msg " Set background color (colored null value cells)"]
     ComboBox $row.b -padx 2 -width 10 -textvariable GmRaster::opt($id,1,bkcolor) \
-                    -values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-                    "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"}
+                    -values {"white" "grey" "gray" "black" "brown" "red" "orange" "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"} \
+                    -labels [list [G_msg "white"] [G_msg "grey"] [G_msg "gray"] [G_msg "black"] [G_msg "brown"] [G_msg "red"] [G_msg "orange"] [G_msg "yellow"] [G_msg "green"] [G_msg "aqua"] [G_msg "cyan"] [G_msg "indigo"] [G_msg "blue"] [G_msg "purple"] [G_msg "violet"] [G_msg "magenta"]] -labelsvariable GmRaster::opt($id,1,bkcolorlv)
     pack $row.a $row.b -side left
     pack $row -side top -fill both -expand yes
 }

Modified: grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl
===================================================================
--- grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl	2010-12-12 16:41:54 UTC (rev 44586)
+++ grass/branches/develbranch_6/gui/tcltk/gis.m/vector.tcl	2010-12-12 16:49:36 UTC (rev 44587)
@@ -167,7 +167,9 @@
 
     set opt($count,1,attribute) "" 
     set opt($count,1,xref) "left"
+    set opt($count,1,xreflv) ""
     set opt($count,1,yref) "center"
+    set opt($count,1,yreflv) ""
     set opt($count,1,lsize) 8
 
     set opt($count,1,minreg) "" 
@@ -475,16 +477,17 @@
 
     # label alignment
     set row [ frame $frm.label2 ]
-    Label $row.a -text "     " 
-    ComboBox $row.b -label [G_msg "Label part to align with vector point"] \
-		-width 6  -textvariable GmVector::opt($id,1,xref) \
+    ComboBox $row.b -label [G_msg "Label part to align with vector point "] \
+		-width 10  -textvariable GmVector::opt($id,1,xref) \
 		-values {"left" "center" "right"} \
-		-modifycmd "GmVector::legend $id"
+		-labels [list [G_msg "left"] [G_msg "center"] [G_msg "right"]] -labelsvariable GmVector::opt($id,1,xreflv) \
+		-modifycmd "GmVector::legend $id" -editable 0
     ComboBox $row.c -label [G_msg "   Justification"] \
-    	-width 6  -textvariable GmVector::opt($id,1,yref) \
+    	-width 10  -textvariable GmVector::opt($id,1,yref) \
 		-values {"top" "center" "bottom"} \
-		-modifycmd "GmVector::legend $id"
-    pack $row.a $row.b $row.c -side left
+		-labels [list [G_msg "top"] [G_msg "center"] [G_msg "bottom"]] -labelsvariable GmVector::opt($id,1,yreflv) \
+		-modifycmd "GmVector::legend $id" -editable 0
+    pack $row.b $row.c -side left
     pack $row -side top -fill both -expand yes
 
     # labels layer and attribute column



More information about the grass-commit mailing list