[GRASS-SVN] r29491 - grass/trunk/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 20 22:52:18 EST 2007


Author: cmbarton
Date: 2007-12-20 22:52:18 -0500 (Thu, 20 Dec 2007)
New Revision: 29491

Modified:
   grass/trunk/gui/tcltk/gis.m/mapprint.tcl
Log:
More code cleanup and commit test 3

Modified: grass/trunk/gui/tcltk/gis.m/mapprint.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/mapprint.tcl	2007-12-21 03:42:32 UTC (rev 29490)
+++ grass/trunk/gui/tcltk/gis.m/mapprint.tcl	2007-12-21 03:52:18 UTC (rev 29491)
@@ -38,10 +38,10 @@
 	variable tmpppmfile
 	variable tmppsfile 
 	variable tmpscript 
-    variable PPap 
-    variable PVar 
-    variable PView
-    variable PWid 
+	variable PPap 
+	variable PVar 
+	variable PView
+	variable PWid 
 	global array can # mon
 }
 
@@ -69,16 +69,16 @@
 	global mon
 	global mingw
 
-    set psprint::pgwd 8.5
-    set psprint::pght 11
-    set psprint::docwd 7.5
-    set psprint::docht 10
-    set psprint::paper "preset"
-    set psprint::paper_preset "letter"
-    set psprint::printer ""
-    set psprint::gsexists 1
-    set psprint::orient "landscape"
-    set psprint::res 300
+	set psprint::pgwd 8.5
+	set psprint::pght 11
+	set psprint::docwd 7.5
+	set psprint::docht 10
+	set psprint::paper "preset"
+	set psprint::paper_preset "letter"
+	set psprint::printer ""
+	set psprint::gsexists 1
+	set psprint::orient "landscape"
+	set psprint::res 300
 	set psprint::mleft 1
 	set psprint::mright 1
 	set psprint::mtop 1
@@ -188,19 +188,19 @@
 	variable tmppsfile
 	variable tmppngfile
 
-    # get temporary file for postscript printing
-    set pid [ pid ]
+	# get temporary file for postscript printing
+	set pid [ pid ]
 	if {[catch {set tmppsfile [ exec g.tempfile pid=$pid ]} error]} {
 		Gm::errmsg $error [G_msg "Error creating tempfile"]
 	}
 
-    append tmppsfile ".ps"
-    set pid [ pid ]
+	append tmppsfile ".ps"
+	set pid [ pid ]
     
 	if {[catch {set tmppngfile [ exec g.tempfile pid=$pid ]} error]} {
 		Gm::errmsg $error [G_msg "Error creating tempfile"]
 	}
-    append tmppngfile ".png"
+	    append tmppngfile ".png"
 }
 
 # show gs printer devices in output window
@@ -241,9 +241,9 @@
 	    
 	# check if opened
 	if { [winfo exists .printwin] } {
-	    wm deiconify .printwin
-	    raise .printwin
-	    return
+		wm deiconify .printwin
+		raise .printwin
+		return
 	}
 	
 	set PW [toplevel .printwin]
@@ -260,18 +260,18 @@
 	    # preset paper sizes (from ghostscript)
 	set row [ frame $PWid(paper).row1 ]
 	radiobutton $row.a -variable psprint::paper -value "preset" \
-		    -highlightthickness 0 
+		-highlightthickness 0 
 	Label $row.b -anchor w -text [G_msg "Preset paper type"]
 	ComboBox $row.c -label "" -width 20  -textvariable psprint::paper_preset \
-		    -values {"letter" "a4" "legal" "11x17" "a3" "ledger" "a0" "a1" "a2" } \
-		    -modifycmd psprint::paper
+		-values {"letter" "a4" "legal" "11x17" "a3" "ledger" "a0" "a1" "a2" } \
+		-modifycmd psprint::paper
 	pack $row.a $row.b $row.c -side left;
 	pack $row -side top -fill x -expand no -anchor n
 	
-	    # custom paper sizes
+	# custom paper sizes
 	set row [ frame $PWid(paper).row2 ]
 	radiobutton $row.a -variable psprint::paper -value "custom" \
-		    -highlightthickness 0
+		-highlightthickness 0
 	Label $row.b -anchor w -text [G_msg "Custom paper size"]
 	Label $row.c -anchor w -text [G_msg "width:"]
 	Entry $row.d -width 10 -textvariable psprint::pgwd
@@ -296,7 +296,7 @@
 	
 	# portrait or landscape
 	set row [ frame $PWid(paper).row4 ]
-	    LabelEntry $row.a -label [G_msg "Resolution (dpi) for printing and PDF "] \
+		LabelEntry $row.a -label [G_msg "Resolution (dpi) for printing and PDF "] \
 		-textvariable psprint::res -width 4
 	Label $row.b -anchor w -text "  "
 	radiobutton $row.c -variable psprint::orient -value "landscape" \
@@ -345,7 +345,7 @@
 	# EPS file
 	set row [ frame $PWid(output).epsfile ]
 	radiobutton $row.a -variable psprint::printmode -value "eps" \
-	    -highlightthickness 0 
+		-highlightthickness 0 
 	Label $row.b -anchor w -text [G_msg "Save to EPS file               "] 
 	Entry $row.c -width 30 -textvariable psprint::epsfile 
 	Button $row.d -text [G_msg "Browse"] -command { set psprint::epsfile \
@@ -393,14 +393,14 @@
 	global mon
 	global mingw
     
-    psprint::init_tmpfiles
+	psprint::init_tmpfiles
    	psprint::paper
    	update
-    set landscape $gmpath/landscap.ps
+	set landscape $gmpath/landscap.ps
     
-    #change doc size to points
-    set cdocwd [expr $docwd * 72]
-    set cdocht [expr $docht * 72]
+	#change doc size to points
+	set cdocwd [expr $docwd * 72]
+	set cdocht [expr $docht * 72]
     
  	# set paper size for postscript printer and pdf files
 	set w [expr round($pgwd * $res)]
@@ -465,22 +465,22 @@
 
 
 proc psprint::set_option { key value } {
-    variable PWid 
-    variable PVar 
-    variable PPap 
-    variable PView
+	variable PWid 
+	variable PVar 
+	variable PPap 
+	variable PView
+    
+	set PVar($key) $value
 
-    set PVar($key) $value
-
 }
 
 # Delete temporary files
 proc psprint::clean {  } {
-    variable tmppsfile
-    variable tmppngfile
+	variable tmppsfile
+	variable tmppngfile
+    
+	catch {file delete $tmppsfile}
+	catch {file delete $tmppngfile}
 
-    catch {file delete $tmppsfile}
-    catch {file delete $tmppngfile}
-
 }
 



More information about the grass-commit mailing list