浏览代码

so long, and thanks for all the fish

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@33941 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 年之前
父节点
当前提交
7900218dc4
共有 63 个文件被更改,包括 1 次插入20476 次删除
  1. 1 1
      gui/Makefile
  2. 0 9
      gui/tcltk/Makefile
  3. 0 23
      gui/tcltk/gis.m/Makefile
  4. 0 1071
      gui/tcltk/gis.m/animate.tcl
  5. 0 409
      gui/tcltk/gis.m/barscale.tcl
  6. 0 449
      gui/tcltk/gis.m/chart.tcl
  7. 0 214
      gui/tcltk/gis.m/cmd.tcl
  8. 0 119
      gui/tcltk/gis.m/commonlayer.tcl
  9. 0 399
      gui/tcltk/gis.m/dnviz.tcl
  10. 0 143
      gui/tcltk/gis.m/docs/gm_animate.html
  11. 二进制
      gui/tcltk/gis.m/docs/gm_animate1.png
  12. 二进制
      gui/tcltk/gis.m/docs/gm_animate2.jpg
  13. 二进制
      gui/tcltk/gis.m/docs/gm_animatetool.png
  14. 二进制
      gui/tcltk/gis.m/docs/gm_gcpmgr.jpg
  15. 0 219
      gui/tcltk/gis.m/docs/gm_georect.html
  16. 二进制
      gui/tcltk/gis.m/docs/gm_georectdisp.jpg
  17. 二进制
      gui/tcltk/gis.m/docs/gm_georectstart.jpg
  18. 二进制
      gui/tcltk/gis.m/docs/gm_gismgr.jpg
  19. 二进制
      gui/tcltk/gis.m/docs/gm_gismgrtools.png
  20. 二进制
      gui/tcltk/gis.m/docs/gm_gronsole.png
  21. 二进制
      gui/tcltk/gis.m/docs/gm_mapdisp.jpg
  22. 二进制
      gui/tcltk/gis.m/docs/gm_mapdisptools.png
  23. 0 97
      gui/tcltk/gis.m/docs/gm_profile.html
  24. 二进制
      gui/tcltk/gis.m/docs/gm_profile1.png
  25. 二进制
      gui/tcltk/gis.m/docs/gm_profile2.jpg
  26. 二进制
      gui/tcltk/gis.m/docs/gm_profile3.png
  27. 0 409
      gui/tcltk/gis.m/dtext.tcl
  28. 0 283
      gui/tcltk/gis.m/frames.tcl
  29. 0 2458
      gui/tcltk/gis.m/georect.tcl
  30. 0 162
      gui/tcltk/gis.m/georecttool.tcl
  31. 0 26
      gui/tcltk/gis.m/gis.m
  32. 0 1
      gui/tcltk/gis.m/gis.m.bat
  33. 0 431
      gui/tcltk/gis.m/gis.m.html
  34. 0 543
      gui/tcltk/gis.m/gm.tcl
  35. 0 82
      gui/tcltk/gis.m/gm_profile.html
  36. 0 143
      gui/tcltk/gis.m/gmlib.tcl
  37. 0 655
      gui/tcltk/gis.m/gmmenu.tcl
  38. 0 147
      gui/tcltk/gis.m/gmtool1.tcl
  39. 0 134
      gui/tcltk/gis.m/gmtool2.tcl
  40. 0 1218
      gui/tcltk/gis.m/gmtree.tcl
  41. 0 96
      gui/tcltk/gis.m/grassabout.tcl
  42. 0 414
      gui/tcltk/gis.m/gridline.tcl
  43. 0 304
      gui/tcltk/gis.m/group.tcl
  44. 0 376
      gui/tcltk/gis.m/histogram.tcl
  45. 二进制
      gui/tcltk/gis.m/intro.gif
  46. 0 287
      gui/tcltk/gis.m/labels.tcl
  47. 0 514
      gui/tcltk/gis.m/legend.tcl
  48. 0 2027
      gui/tcltk/gis.m/mapcanvas.tcl
  49. 0 608
      gui/tcltk/gis.m/maplabels.tcl
  50. 0 486
      gui/tcltk/gis.m/mapprint.tcl
  51. 0 315
      gui/tcltk/gis.m/maptext.tcl
  52. 0 433
      gui/tcltk/gis.m/maptool.tcl
  53. 0 34
      gui/tcltk/gis.m/pkgIndex.tcl
  54. 0 704
      gui/tcltk/gis.m/profile.tcl
  55. 0 366
      gui/tcltk/gis.m/rastarrows.tcl
  56. 0 471
      gui/tcltk/gis.m/raster.tcl
  57. 0 368
      gui/tcltk/gis.m/rastnums.tcl
  58. 0 390
      gui/tcltk/gis.m/rgbhis.tcl
  59. 0 259
      gui/tcltk/gis.m/rules.tcl
  60. 0 287
      gui/tcltk/gis.m/runandoutput.tcl
  61. 0 827
      gui/tcltk/gis.m/thematic.tcl
  62. 0 238
      gui/tcltk/gis.m/tksys.tcl
  63. 0 827
      gui/tcltk/gis.m/vector.tcl

+ 1 - 1
gui/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ..
 
-SUBDIRS = icons images scripts xml tcltk wxpython
+SUBDIRS = icons images scripts xml wxpython
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make
 

+ 0 - 9
gui/tcltk/Makefile

@@ -1,9 +0,0 @@
-MODULE_TOPDIR = ../..
-
-SUBDIRS = gis.m
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-default: parsubdirs
-
-

+ 0 - 23
gui/tcltk/gis.m/Makefile

@@ -1,23 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-PGM=gis.m
-
-include $(MODULE_TOPDIR)/include/Make/Script.make
-
-default: script install_scripts
-
-TCLFILES = $(patsubst %,$(ETC)/gm/%,$(wildcard *.tcl))
-GIFFILES = $(patsubst %,$(ETC)/gm/%,$(wildcard *.gif))
-DOCFILES = $(patsubst docs/%,$(HTMLDIR)/%,$(wildcard docs/gm_*.*))
-
-$(HTMLDIR)/%: docs/%
-	$(INSTALL_DATA) $< $@
-
-$(ETC)/gm/%: %
-	-test -d $(ETC)/gm || $(MKDIR) $(ETC)/gm
-	$(INSTALL_DATA) $< $@
-
-install_scripts: $(TCLFILES) $(GIFFILES) $(DOCFILES)
-
-$(BIN)/$(PGM).bat: $(PGM).bat
-	$(INSTALL_DATA) $< $@

文件差异内容过多而无法显示
+ 0 - 1071
gui/tcltk/gis.m/animate.tcl


+ 0 - 409
gui/tcltk/gis.m/barscale.tcl

@@ -1,409 +0,0 @@
-##########################################################################
-# barscale.tcl - barscale layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmBarscale {
-    variable array opt # barscale current options
-    variable count 1
-    variable array lfile # scale
-    variable array lfilemask # scale
-    variable optlist
-    variable first
-    variable array dup # layer
-    variable placement #LabelEntry widget for scale bar placment coordinates
-};
-
-
-###############################################################################
-# create new barscale layer
-proc GmBarscale::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-	variable can
-    global mon
-    global iconpath
-
-    set node "barscale:$count"
-
-    set frm [ frame .barscaleicon$count]
-    set check [checkbutton $frm.check \
-                           -variable GmBarscale::opt($count,1,_check) \
-                           -height 1 -padx 0 -width 0]
-
-    image create photo scaleico -file "$iconpath/module-d.barscale.gif"
-    set ico [label $frm.ico -image scaleico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "scale $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,tcolor) \#000000 
-    set opt($count,1,bcolor) \#FFFFFF 
-    set opt($count,1,bcolor_none) 0
-    set opt($count,1,font) ""
-    set opt($count,1,line) 0 
-    set opt($count,1,at) "2,2" 
-    set opt($count,1,feet) 0 
-    set opt($count,1,top) 0 
-    set opt($count,1,arrow) 0 
-    set opt($count,1,scale) 0 
-    set opt($count,1,mod) 1
-    set opt($count,1,mouseset) 0
-    set first 1
-        
-    set optlist { _check opacity bcolor bcolor_none font tcolor at feet line top arrow scale mouseset}
-    
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-		
-    incr count
-
-    return $node
-};
-
-###############################################################################
-proc GmBarscale::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-
-};
-
-
-###############################################################################
-
-proc GmBarscale::mouseset { id } {
-	# use mouse to set scalebar placement coordinates
-	global mon pctentry
-	variable placement
-
-	if { $GmBarscale::opt($id,1,mouseset) == 1 } {
-		set pctentry $GmBarscale::placement
-	} else {
-		set pctentry ""
-	}
-
-};
-
-##########################################################################
-proc GmBarscale::set_font { id } {
-	variable opt
-
-	if {$GmBarscale::opt($id,1,font) != "" } {
-		set Gm::dfont $GmBarscale::opt($id,1,font)
-	}
-	Gm::defaultfont dbarscale
-	tkwait variable Gm::dfont
-	set GmBarscale::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-
-};
-
-
-###############################################################################
-# barscale options
-proc GmBarscale::options { id frm } {
-    variable opt    
-    variable placement
-    global bgcolor
-    global iconpath
-    global mon
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display scale and north arrow"] \
-    	-fg MediumBlue    
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmBarscale::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # at1
-    set row [ frame $frm.at1 ]
-    Label $row.a -text [G_msg "Scale placement: 0-100% from top left of display"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-        
-    # at2
-    set row [ frame $frm.at2 ]
-    Label $row.a -text [G_msg "\t enter x,y of scale/arrow upper left corner"]
-    set placement [LabelEntry $row.b -width 8 \
-    	-textvariable GmBarscale::opt($id,1,at)]
-    Label $row.c -text [G_msg "    "]
-    Button $row.d -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.barscale" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # at3
-    set row [ frame $frm.at3 ]
-    Label $row.a -text [G_msg "\t "]
-    checkbutton $row.b -text [G_msg "place with mouse"] \
-    	-variable GmBarscale::opt($id,1,mouseset) \
-    	-command "GmBarscale::mouseset $id"
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # color
-    set row [ frame $frm.color ]
-    Label $row.a -text [G_msg "Scale appearance:  text color"] 
-    SelectColor $row.b -type menubutton -variable GmBarscale::opt($id,1,tcolor)
-    Label $row.c -text [G_msg "  font "]
-    Button $row.d -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmBarscale::set_font $id"
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # background
-    set row [ frame $frm.background ]
-    Label $row.a -text [G_msg "\tbackground color "] 
-    SelectColor $row.b -type menubutton -variable GmBarscale::opt($id,1,bcolor)
-    Label $row.c -text "   " 
-    checkbutton $row.d -text [G_msg "transparent background"] \
-    	-variable GmBarscale::opt($id,1,bcolor_none) 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # arrow or scale only
-    set row [ frame $frm.arrow ]
-    Label $row.a -text "\t "
-    checkbutton $row.b -text [G_msg "display N. arrow only"] \
-    	-variable GmBarscale::opt($id,1,arrow) 
-    checkbutton $row.c -text [G_msg "display scale only"] \
-    	-variable GmBarscale::opt($id,1,scale) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # text on top
-    set row [ frame $frm.textontop ]
-    Label $row.a -text "\t " 
-    checkbutton $row.b -text [G_msg "text on top of scale, instead of to right"] \
-    	-variable GmBarscale::opt($id,1,top) 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # scale options
-    set row [ frame $frm.opts ]
-    Label $row.a -text "\t " 
-    checkbutton $row.b -text [G_msg "line scale instead of bar"] \
-    	-variable GmBarscale::opt($id,1,line) 
-    checkbutton $row.c -text [G_msg "use feet/miles instead of meters"] \
-    	-variable GmBarscale::opt($id,1,feet) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-};
-
-###############################################################################
-# save barscale layer node to grc file
-proc GmBarscale::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-};
-
-
-###############################################################################
-# render and composite barscale layer
-
-proc GmBarscale::display { node mod } {
-    global mon
-    global env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    variable first
-
- 	set line ""
-    set input ""
-    set cmd ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    # set hex colors to rgb         
-    set tcolor [GmLib::color $opt($id,1,tcolor)]
-    set bcolor [GmLib::color $opt($id,1,bcolor)]
-
-    # no background color
-    if { $opt($id,1,bcolor_none) == 1 } { 
-        set bcolor "none"
-    }
-    
-    set cmd "d.barscale tcolor=$tcolor bcolor=$bcolor at=$opt($id,1,at)"
-
-    # line scale
-    if { $opt($id,1,line) != 0 } { 
-        append cmd " -l"
-    }
-
-    # text on top
-    if { $opt($id,1,top) != 0 } { 
-        append cmd " -t"
-    }
-
-    # english units
-    if { $opt($id,1,feet) != 0} { 
-        append cmd " -f"
-    }
-
-	# arrow only
-	if { $opt($id,1,arrow) != 0 } {
-		append cmd " -n"
-	}
-	
-	# scale only
-	if { $opt($id,1,scale) != 0 } {
-		append cmd " -s"
-	}
-
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-	
-    # set grass font environmental variable to user selection"
-	if { $GmBarscale::opt($id,1,font) != ""} { 
-		set env(GRASS_FONT) $GmBarscale::opt($id,1,font) 
-	}
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-	
-};
-
-###############################################################################
-#duplicate barscale layer
-
-proc GmBarscale::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	variable first
-	global iconpath
-
-    set node "barscale:$count"
-	set dup($count) 1
-
-    set frm [ frame .barscaleicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmBarscale::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo scaleico -file "$iconpath/module-d.barscale.gif"
-    set ico [label $frm.ico -image scaleico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-		-text      "scale $count" \
-		-window    $frm \
-		-drawcross auto
-		
-	set opt($count,1,opacity) $opt($id,1,opacity)
-    set first 1
-    
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 449
gui/tcltk/gis.m/chart.tcl

@@ -1,449 +0,0 @@
-##########################################################################
-# chart.tcl - vector chart layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmChart {
-    variable array opt # chart options
-    variable count 1
-    variable array lfile # vector
-    variable array lfilemask # vector
-    variable optlist
-    variable array dup # vector
-}
-
-
-###############################################################################
-
-proc GmChart::create { tree parent } {
-    variable opt
-    variable count
-    variable dup
-    variable lfile
-    variable lfilemask
-    variable optlist
-    global iconpath
-
-    set node "chart:$count"
-
-    set frm [ frame .charticon$count]
-    set check [checkbutton $frm.check \
-		-variable GmChart::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo chartico -file "$iconpath/module-d.vect.chart.gif"
-    set ico [label $frm.ico -image chartico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "chart $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-    
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,type_point) 1 
-    set opt($count,1,type_line) 1
-    set opt($count,1,type_boundary) 1
-    set opt($count,1,type_centroid) 1
-    set opt($count,1,type_area) 0
-    set opt($count,1,layer) 1 
-    set opt($count,1,ctype) "pie" 
-    set opt($count,1,columns) "" 
-    set opt($count,1,sizecol) "" 
-    set opt($count,1,csize) 40 
-    set opt($count,1,cscale) 1 
-    set opt($count,1,ocolor) "black" 
-    set opt($count,1,fcolors) "" 
-    set opt($count,1,mod) 1
-    
-	set optlist { _check map opacity layer ctype columns sizecol csize cscale ocolor fcolors \
-             type_point type_line type_boundary type_centroid type_area} 
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-	incr count
-    return $node
-}
-
-###############################################################################
-
-proc GmChart::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmChart::select_map { id } {
-    variable tree
-    variable node
-    set m [GSelect vector title [G_msg "Vector map for chart"] parent "."]
-    if { $m != "" } { 
-        set GmChart::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "chart for %s"] $m ]
-    }
-}
-
-###############################################################################
-
-proc GmChart::show_columns { id } {
-	variable opt
-	global bgcolor
-	set mapname $opt($id,1,map)
-	set layernum $opt($id,1,layer)
-	set cmd "v.info -c map=$mapname layer=$layernum"
-	run_panel $cmd
-}
-
-proc GmChart::show_data { id } {
-	variable opt
-	global bgcolor
-	set mapname $opt($id,1,map)
-	set layer $opt($id,1,layer)
-	if ![catch {open "|v.db.connect map=$mapname layer=$layer -g" r} vdb] {
-		set vectdb [read $vdb]
-		if {[catch {close $vdb} error]} {
-            GmLib::errmsg $error
-		}
-		set vdblist [split $vectdb " "]
-		set tbl [lindex $vdblist 1]
-		set db [lindex $vdblist 3]
-		set drv [lindex $vdblist 4]
-		set cmd "db.select table=$tbl database=$db driver=$drv"
-		run_panel $cmd
-	}
-}
-
-###############################################################################
-
-# chart options
-proc GmChart::options { id frm } {
-    variable opt
-    
-    global bgcolor
-	global iconpath
-	
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display pie and bar charts of attribute values at vector object locations"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmChart::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # vector name
-    set row [ frame $frm.map ]
-    Label $row.a -text [G_msg "Vector map to chart:"]
-    Button $row.b -image [image create photo -file "$iconpath/element-vector.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "vector map to chart"] \
-		-command "GmChart::select_map $id"
-    Entry $row.c -width 30 -text " $opt($id,1,map)" \
-          -textvariable GmChart::opt($id,1,map)
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.vect.chart" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # vector type
-    set row [ frame $frm.type ]
-    Label $row.a -text [G_msg "Vector type:"]
-    checkbutton $row.b -text [G_msg "points"] -variable GmChart::opt($id,1,type_point)
-    checkbutton $row.c -text [G_msg "lines"] -variable GmChart::opt($id,1,type_line)
-    checkbutton $row.d -text [G_msg "boundaries"] -variable GmChart::opt($id,1,type_boundary)
-    checkbutton $row.e -text [G_msg "centroids"] -variable GmChart::opt($id,1,type_centroid)
-    checkbutton $row.f -text [G_msg "areas"] -variable GmChart::opt($id,1,type_area)
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-
-    # attributes1 and data
-    set row [ frame $frm.attr1 ]
-    Label $row.a -text [G_msg "Attributes to chart: attribute layer"]
-    LabelEntry $row.b -textvariable GmChart::opt($id,1,layer) -width 5
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # show data and columns
-    set row [ frame $frm.showcolumns ]
-    Label $row.a -text [G_msg "     show attribute columns"] 
-    Button $row.b -text [G_msg "columns"] \
-		-image [image create photo -file "$iconpath/db-columns.gif"] \
-		-command "GmChart::show_columns $id" \
-		-background $bgcolor \
-		-helptext [G_msg "Show columns"]
-    Label $row.c -text [G_msg "   show attribute data"] 
-    Button $row.d -text [G_msg "data"] \
-		-image [image create photo -file "$iconpath/db-values.gif"] \
-		-command "GmChart::show_data $id" \
-		-background $bgcolor \
-		-helptext [G_msg "Show data"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # attributes2
-    set row [ frame $frm.attr2 ]
-    Label $row.a -text [G_msg "\tcolumns to chart (col1,col2,...)  "]
-    LabelEntry $row.b -textvariable GmChart::opt($id,1,columns) -width 30 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # attributes3
-    set row [ frame $frm.attr3 ]
-    Label $row.a -text [G_msg "\tcolors for columns (clr1,clr2,...)"]
-    LabelEntry $row.b -textvariable GmChart::opt($id,1,fcolors) -width 30 -padx 2
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # attributes4
-    set row [ frame $frm.attr4 ]
-    Label $row.a -text [G_msg "\tcolumn for variable chart size"]
-    LabelEntry $row.b -textvariable GmChart::opt($id,1,sizecol) -width 12 -padx 8
-    Label $row.c -text [G_msg "  scale factor"]
-    LabelEntry $row.d -textvariable GmChart::opt($id,1,cscale) -width 4
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # chart options1
-    set row [ frame $frm.chopt1 ]
-    Label $row.a -text [G_msg "Chart type:"] 
-    ComboBox $row.b -padx 2 -width 4 -textvariable GmChart::opt($id,1,ctype) \
-                    -values {"pie" "bar"} 
-    Label $row.c -text [G_msg "\tfixed chart size (if size column not used)"]
-    LabelEntry $row.d -textvariable GmChart::opt($id,1,csize) -width 4 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # chart options2
-    set row [ frame $frm.chopt2 ]
-    Label $row.a -text [G_msg "\tchart outline color:"] 
-    ComboBox $row.b -padx 0 -width 10 -textvariable GmChart::opt($id,1,ocolor) \
-                    -values {"none" "white" "grey" "gray" "black" "brown" "red" "orange" \
-                    "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"} 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-
-proc GmChart::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-
-###############################################################################
-
-# get selected vector map 
-proc GmChart::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map) == "" } { return ""} 
-
-
-    set mapname $opt($id,1,map)
-	return $mapname
-}
-
-###############################################################################
-
-proc GmChart::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-
-    set line ""
-    set input ""
-    
-    set cmd ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return } 
-    if { $opt($id,1,columns) == "" } { return }
-    if { !$opt($id,1,type_point) && !$opt($id,1,type_line) &&
-         !$opt($id,1,type_boundary)  && !$opt($id,1,type_centroid) && 
-         !$opt($id,1,type_area) } { return } 
-
-    # combine vector types         
-    set type ""
-    if { $opt($id,1,type_point) } { append type "point" }
-    if { $opt($id,1,type_line) && "$type" != "" } { 
-        append type ",line"
-    } elseif { $opt($id,1,type_line) && "$type" == "" } {
-        append type "line"}
-    if { $opt($id,1,type_boundary) && "$type" != "" } { 
-        append type ",boundary" 
-    } elseif { $opt($id,1,type_boundary) && "$type" == "" } {
-        append type "boundary"}
-    if { $opt($id,1,type_centroid) && "$type" != "" } { 
-        append type ",centroid" 
-    } elseif { $opt($id,1,type_centroid) && "$type" == "" } {
-        append type "centroid"}
-    if { $opt($id,1,type_area) && "$type" != "" } { 
-        append type ",area" 
-    } elseif { $opt($id,1,type_area) && "$type" == "" } {
-        append type "area"}
-
-    #create d.vect.chart command
-    set cmd "d.vect.chart map=$opt($id,1,map) type=$type \
-            layer=$opt($id,1,layer) columns=$opt($id,1,columns) \
-            ctype=$opt($id,1,ctype) ocolor=$opt($id,1,ocolor) "
-            
-    # sizecol
-    if { $opt($id,1,sizecol) != "" } { 
-        append cmd " sizecol=$opt($id,1,sizecol)"
-    }
-
-    # csize
-    if { $opt($id,1,csize) != "" } { 
-        append cmd " size=$opt($id,1,csize)"
-    }
-
-    # cscale
-    if { $opt($id,1,cscale) != "" } { 
-        append cmd " scale=$opt($id,1,cscale)"
-    }
-
-    # fcolors
-    if { $opt($id,1,fcolors) != "" } { 
-        append cmd " colors=$opt($id,1,fcolors)"
-    }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-###############################################################################
-
-proc GmChart::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-
-    set node "chart:$count"
-	set dup($count) 1
-
-    set frm [ frame .charticon$count]
-    set check [checkbutton $frm.check \
-		-variable GmChart::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo chartico -file "$iconpath/module-d.vect.chart.gif"
-    set ico [label $frm.ico -image chartico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "chart $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "chart for $opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	} 
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check map layer ctype columns sizecol csize cscale ocolor fcolors \
-             type_point type_line type_boundary type_centroid type_area} 
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 214
gui/tcltk/gis.m/cmd.tcl

@@ -1,214 +0,0 @@
-##########################################################################
-# cmd.tcl - command layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmCmd {
-    variable array opt # cmd current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # command
-    variable array lfilemask # command
-    variable optlist
-    variable array dup # layer
-}
-
-
-proc GmCmd::create { tree parent } {
-   variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-	variable dup
-    global mon
-    global iconpath
-
-    set node "cmd:$count"
-
-    set frm [ frame .cmdicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCmd::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo cico -file "$iconpath/gui-cmd.gif"
-    set ico [label $frm.ico -image cico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text      "cmd $count" \
-	-window    $frm \
-	-drawcross auto 
-
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,cmd) ""
-    set opt($count,1,mod) 1
-
-	set optlist { _check opacity cmd}
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-proc GmCmd::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-# display cmd options
-proc GmCmd::options { id frm } {
-    variable opt
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text "Enter any GRASS command" \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmCmd::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # cmd name
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Command:"] 
-    Entry $row.b -width 50 -text "$opt($id,1,cmd)" \
-          -textvariable GmCmd::opt($id,1,cmd) 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-}
-
-proc GmCmd::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-proc GmCmd::display { node mod} {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable rasttype
-    variable tree
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,cmd) == "" } { return } 
-
-    set cmd $opt($id,1,cmd)
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-proc GmCmd::duplicate { tree parent node id} {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-
-    set node "cmd:$count"
-	set dup($count) 1
-
-    set frm [ frame .cmdicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCmd::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo cico -file "$iconpath/gui-cmd.gif"
-    set ico [label $frm.ico -image cico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
- 
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-		-text      "cmd $count" \
-		-window    $frm \
-		-drawcross auto
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check cmd}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}

+ 0 - 119
gui/tcltk/gis.m/commonlayer.tcl

@@ -1,119 +0,0 @@
-##########################################################################
-#
-# commonlayer.tcl
-#
-# Common layer code for GIS Manager: GUI for GRASS 6 
-# Authors: Cedric Shock
-# Based in part on histogram.tcl of GIS Manager
-#
-# April 2006
-#
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-# Common layer code for gis.m
-# This is code that happens in the namespace of the layer that,
-# except for namespace, is the same for many types of layers.
-# It could also be code that is just shared in common.
-
-namespace eval GmCommonLayer {
-	#pass
-}
-
-# Import variables from a namespace into the current stack frame:
-proc namespace_import_variables {namespace args} {
-	foreach arg $args {
-		uplevel "upvar 0 ${namespace}::$arg $arg"
-	}
-}
-
-# Display some things on the canvas
-# (actually just run the command, copy its result to the temporary
-# directory and add it to the compositing list)
-proc GmCommonLayer::display_commands {namespace id cmds} {
-	global mon
-	global commandlist
-	
-	namespace_import_variables $namespace lfile lfilemask opt optlist dup first
-	
-	set mapfile($mon) $MapCanvas::mapfile($mon)
-	set maskfile($mon) $MapCanvas::maskfile($mon)
-
-	if {[info exists $mapfile($mon)] == ""} {return}
-	if {![info exists first]} {set first 0}
-
-	# There's no point in doing any of this unless the layer is actually on
-	if {! $opt($id,1,_check) } {
-		return 0
-	}
-
-	if {![info exists opt($id,1,mod)]} {
-		set opt($id,1,mod) 0
-	}
-	
-	# check to see if options have changed
-	foreach key $optlist {
-		if {$opt($id,0,$key) != $opt($id,1,$key)} {
-			set opt($id,1,mod) 1
-			set opt($id,0,$key) $opt($id,1,$key)
-		}
-	} 
-
-	# if options have changed (or mod flag set by other procedures) re-render map
-	if {$opt($id,1,mod) == 1 || $dup($id) == 1 || $first == 1} {
-		foreach cmd $cmds {
-			if {$cmd != ""} {
-				run_panel $cmd
-			}
-		}
-		# work around MS-Windows TclTk bug:
-		# file rename -force returns bad code.
-		catch {file delete $lfile($id)}
-		catch {file delete $lfilemask($id)}
-		catch {file rename -force $mapfile($mon) $lfile($id)}
-		catch {file rename -force $maskfile($mon) $lfilemask($id)}
-		# reset options changed flag
-		set opt($id,1,mod) 0
-		set dup($id) 0
-		set first 0
-	}
-	
-	if {![file exists $lfile($id)]} {return}
-	
-	#add lfile, maskfile, and opacity to compositing lists
-	if {$MapCanvas::complist($mon) != "" } {
-		append MapCanvas::complist($mon) ","
-		append MapCanvas::complist($mon) [file tail $lfile($id)]
-	} else {
-		append MapCanvas::complist($mon) [file tail $lfile($id)]
-	}	
-
-	if {$MapCanvas::masklist($mon) != "" } {
-		append MapCanvas::masklist($mon) ","
-		append MapCanvas::masklist($mon) [file tail $lfilemask($id)]
-	} else {
-		append MapCanvas::masklist($mon) [file tail $lfilemask($id)]
-	}	
-	
-	if {$MapCanvas::opclist($mon) != "" } {
-		append MapCanvas::opclist($mon) ","
-		append MapCanvas::opclist($mon) $opt($id,1,opacity)
-	} else {
-		append MapCanvas::opclist($mon) $opt($id,1,opacity)
-	}
-	
-	# create list of commands for current display
-	# used for v.digit background, but could be used for other things
-	append commandlist " $cmds"
-	
-}
-
-# Display something on the canvas
-proc GmCommonLayer::display_command {namespace id cmd} {
-	GmCommonLayer::display_commands $namespace $id [list $cmd]
-}

+ 0 - 399
gui/tcltk/gis.m/dnviz.tcl

@@ -1,399 +0,0 @@
-################################################################################
-#   
-#       FILE:       dnviz.tcl
-#   
-#       PURPOSE:    Permits interactive creation of flythrough path for nviz
-#                   using nviz
-#  
-#       AUTHOR:     Michael Barton, Arizona State University
-#       COPYRIGHT:  (C) 2007 by the GRASS Development Team
-#                   This program is free software under the GNU General Public
-#                   License (>=v2). Read the file COPYING that comes with GRASS
-#                   for details.
-#
-#
-################################################################################
-
-
-
-
-namespace eval GmDnviz {
-    variable inmap
-    variable outfile
-    variable pathcoords
-    variable prefix
-    variable route
-    variable layback
-    variable height
-    variable frames
-    variable startframe
-    variable usemouse
-    variable coord_entry
-    variable vrender
-    variable fullrender
-    variable offscreen
-    variable ht_elev
-    variable keyframe
-    variable overwrite
-	global env
-
-}
-# G_msg.tcl should be sourced first for internationalized strings.
-
-
-###############################################################################
-
-# select input map
-proc GmDnviz::select_map { seltype var } {
-
-    set m [GSelect $seltype title [G_msg "Select input map"] parent "."]
-    if { $m != "" } {
-        set $var $m
-    }
-}
-
-###############################################################################
-
-#Create main panel for d.nviz parameter entry
-proc GmDnviz::main { mapcan mon } {
-    variable inmap
-    variable outfile
-    variable pathcoords
-    variable prefix
-    variable route
-    variable layback
-    variable height
-    variable frames
-    variable startframe
-    variable usemouse
-    variable coord_entry
-    variable vrender
-    variable fullrender
-    variable offscreen
-    variable ht_elev
-    variable keyframe
-    variable overwrite
-	global env
-	global iconpath
-	global bgcolor
-		
-	#initialize variables
-	set inmap ""
-	set outfile ""
-	set pathcoords ""
-	set overwrite 0
-	set prefix "NVIZ"
-	set route ""
-	set layback 2000
-	set height 1000
-	set frames 50
-	set startframe 0
-	set usemouse 0
-    set vrender 0
-    set fullrender 0
-    set offscreen 0
-    set ht_elev 0
-    set keyframe 0
-    set overwrite
-
-	set overwrite 0
-	set selclr #88aa88
-        
-	# create nviz path input window
-    if { [winfo exists .dnvizPopup] } {return}
-
-	set dnviz_win [toplevel .dnvizPopup]
-	wm title $dnviz_win [ G_msg "NVIZ flythrough path" ]
-	# put it in the middle of the screen
-	update idletasks
-	set winWidth [winfo reqwidth $dnviz_win]
-	set winHeight [winfo reqheight $dnviz_win]
-	set scrnWidth [winfo screenwidth $dnviz_win]
-	set scrnHeight [winfo screenheight $dnviz_win]
-	set x [expr ($scrnWidth - $winWidth) / 2-250]
-	set y [expr ($scrnHeight  - $winHeight) / 2]
-	wm geometry $dnviz_win +$x+$y
-	wm deiconify $dnviz_win
-                
-	#create the form and buttons
-
-    # Title
-    set row [ frame $dnviz_win.heading ]
-    Label $row.a -text [G_msg "Create flythough path for NVIZ display"] \
-        -fg MediumBlue
-    pack $row.a -side top -padx 5 -pady 3
-    pack $row -side top -fill x -expand yes
-
-    # input map
-    set row [ frame $dnviz_win.input ]
-    Label $row.a -text [G_msg "Raster surface map "]
-    Button $row.b -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -command "GmDnviz::select_map cell GmDnviz::inmap"
-    Entry $row.c -width 50 -text "$inmap" \
-          -textvariable GmDnviz::inmap
-    pack $row.c $row.b $row.a -side right -padx 3 -anchor e
-    pack $row -side top -fill x -expand no -padx 5
-	
-    # set output script file
-    set row [ frame $dnviz_win.output ]
-    Label $row.a -text [G_msg "Output script file "]
-    Button $row.b -image [image create photo -file "$iconpath/file-open.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -command "GmDnviz::select_map file GmDnviz::outfile"
-    Entry $row.c -width 50 -text "$outfile" \
-          -textvariable GmDnviz::outfile
-    pack $row.c $row.b $row.a -side right -anchor e -padx 3
-    pack $row -side top -fill x -expand no -padx 5
-    
-    # flythrough path coordinates
-    set row [ frame $dnviz_win.coords ]
-    Label $row.a -text [G_msg "Flythrough path "]
-    set ck_path [checkbutton $row.b -image [image create photo -file "$iconpath/gui-mouse.gif"] \
-        -variable "GmDnviz::usemouse" -command "GmDnviz::setmouse $mapcan $mon"\
-        -indicatoron false -selectcolor $selclr -bg $bgcolor \
-        -highlightthickness 0 -borderwidth 1  \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]
-    	DynamicHelp::register $ck_path balloon [G_msg "Create path with mouse in map display"]
-    set coord_entry [Entry $row.c -width 50 -text "$outfile" \
-        -textvariable GmDnviz::pathcoords  -width 50 -xscrollcommand "$row.d set" \
-        -helptext [G_msg "Coordinate pairs for flythrough path (x1,y1,x2,y2,...)"]]
-	scrollbar $row.d -relief sunken -command "$coord_entry xview" -orient horizontal
-    pack $row.d -side bottom -fill x -expand no -anchor e
-    pack $row.c $row.b $row.a -side right -anchor e -padx 3
-    pack $row -side top -fill x -expand no -padx 5
-    
-    # set output images prefix
-    set row [ frame $dnviz_win.prefix ]
-    LabelEntry $row.a -textvariable GmDnviz::prefix -width 50 \
-        -label [G_msg "Flythrough images prefix "] \
-        -helptext [G_msg "Prefix for image series created by flythough"]
-    pack $row.a -side right -anchor e -padx 3
-    pack $row -side top -fill x -expand no -padx 5
-    
-    # Camera position
-    set row [ frame $dnviz_win.camera ]
-    LabelEntry $row.a -textvariable GmDnviz::layback -width 10 \
-        -label [G_msg "Camera layback "] \
-        -helptext [G_msg "Camera layback distance (in map units)"]
-    LabelEntry $row.b -textvariable GmDnviz::height -width 10 \
-        -label [G_msg "Camera height "] \
-        -helptext [G_msg "Camera height above terrain"]
-    pack $row.a $row.b -side right -anchor e -padx 3
-    pack $row -side top -fill x -expand no -padx 5
-   
-    # Frame settings
-    set row [ frame $dnviz_win.frames ]
-    LabelEntry $row.a -textvariable GmDnviz::frames -width 10 \
-        -label [G_msg "Number of frames "] \
-        -helptext [G_msg "Number of frames to create for flythrough"]
-    LabelEntry $row.b -textvariable GmDnviz::startframe -width 10 \
-        -label [G_msg "Start frame "] \
-        -helptext [G_msg "Starting frame number..."]
-    pack $row.a $row.b -side right -anchor e -padx 3
-    pack $row -side top -fill x -expand no -padx 5
-    
-    
-    set row [ frame $dnviz_win.options1 ]
-    checkbutton $row.a -variable GmDnviz::vrender \
-                -text [G_msg "Enable vector rendering"]
-    checkbutton $row.b -variable GmDnviz::fullrender \
-                -text [G_msg "Full render (save images)"]
-    checkbutton $row.c -variable GmDnviz::offscreen \
-                -text [G_msg "Render images offscreen"]
-    pack $row.a $row.b $row.c -side left -anchor w -padx 5
-    pack $row -side top -fill x -expand no
-    
-    set row [ frame $dnviz_win.options2 ]
-    Button $row.a -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.nviz" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a -side right -anchor e -padx 5
-    checkbutton $row.b -variable GmDnviz::ht_elev \
-                -text [G_msg "Height value is elevation"]
-    checkbutton $row.c -variable GmDnviz::keyframe \
-                -text [G_msg "Output keyframe file"]
-    checkbutton $row.d -variable GmDnviz::overwrite \
-                -text [G_msg "Overwrite existing file"]
-    pack $row.b $row.c $row.d -side left -anchor w -padx 5
-    pack $row -side top -fill x -expand no
-    
-    set row [ frame $dnviz_win.buttons ]
-    Button $row.d -text [G_msg "Reset"] -width 8 -bd 1 \
-    	-command "GmDnviz::reset_points $mon %W" \
-    	-helptext [G_msg "Clear all path coordinates"]
-    pack $row.d -side left -padx 5 -fill none -expand no -anchor w
-    Button $row.a -text [G_msg "OK"] -width 8 -bd 1 \
-    	-command "GmDnviz::makescript %W 1" -default active
-    Button $row.b -text [G_msg "Cancel"] -width 8 -bd 1 \
-    	-command "destroy .dnvizPopup"
-    Button $row.c -text [G_msg "Apply"] -width 8 -bd 1 \
-    	-command "GmDnviz::makescript %W 0"
-    pack $row.a $row.b $row.c -side right -padx 5 -expand no -anchor e
-    pack $row -side bottom -pady 3 -padx 5 -expand yes -fill none
-
-	bind .dnvizPopup <Destroy> "GmDnviz::cleanup $mon %W"    
-
-}
-
-###############################################################################
-# interactive mouse input of path coordinates
-proc GmDnviz::setmouse {mapcan mon} {
-    variable usemouse
-    
-    if {$usemouse == 0} {
-        MapCanvas::pointer $mon
-        return
-    }
-    
-    MapCanvas::setcursor $mon "crosshair"
-
-    bind $mapcan <ButtonPress-1> "GmDnviz::getcoords $mapcan $mon %x %y"
-    
-}
-
-###############################################################################
-# set coordinate point from mouse click
-proc GmDnviz::getcoords {mapcan mon x y} {
-    
-    variable coord_entry
-    
-    set eastcoord [eval MapCanvas::scrx2mape $mon $x]
-    set northcoord [eval MapCanvas::scry2mapn $mon $y]
-    set grcoords "$eastcoord,$northcoord,"
-    GmDnviz::markpoint $mapcan $x $y
-    $coord_entry insert end $grcoords
-   # focus -force [tk_focusNext $coord_entry]
-
-}
-
-
-###############################################################################
-# mark ground control point
-proc GmDnviz::markpoint { mapcan x y } {
-
-    # create point for flythrough path on map display canvas for each mouse click
-
-    $mapcan create line $x [expr $y-5] $x [expr $y+5] -tag gcpv \
-            -fill DarkGreen -width 2 -tag "ptvert"
-    $mapcan create line [expr $x-5] $y [expr $x+5] $y -tag gcph \
-            -fill red -width 2 -tag "pthoriz"
-}
-
-###############################################################################
-
-# cleanup procedure when window closed
-proc GmDnviz::cleanup { mon w } {
-    variable inmap
-    variable outfile
-    variable pathcoords
-    variable prefix
-    variable route
-    variable layback
-    variable height
-    variable frames
-    variable startframe
-    variable usemouse
-    variable coord_entry
-    variable overwrite
-
-	set inmap ""
-	set outfile ""
-	set pathcoords ""
-	set overwrite 0
-	set prefix "NVIZ"
-	set route ""
-	set layback 2000
-	set height 1000
-	set frames 50
-	set startframe 0
-	set usemouse 0
-	set overwrite 0
-
-    MapCanvas::pointer $mon
-    MapCanvas::request_redraw $mon 0
-
-}
-
-###############################################################################
-
-# cleanup procedure when window closed
-proc GmDnviz::reset_points { mon w } {
-    variable pathcoords
-    variable coord_entry
-
-	set pathcoords ""
-    $coord_entry delete 0 end
-
-    MapCanvas::request_redraw $mon 0
-
-}
-
-###############################################################################
-
-# Run d.nviz to create flythrough path script
-proc GmDnviz::makescript { w quit } {
-    variable inmap
-    variable outfile
-    variable pathcoords
-    variable prefix
-    variable route
-    variable layback
-    variable height
-    variable frames
-    variable startframe
-    variable usemouse
-    variable coord_entry
-    variable vrender
-    variable fullrender
-    variable offscreen
-    variable ht_elev
-    variable keyframe
-    variable overwrite
-    global devnull
-
-    if { $inmap == ""} {
-        tk_messageBox -type ok -icon warning -parent $w \
-		    -message [G_msg "You must select an input map"] \
-		    -title [G_msg "No input map selected"]
-        return
-    }
-    if { $outfile == ""} {
-        tk_messageBox -type ok -icon warning -parent $w \
-		    -message [G_msg "You must specify an output file"] \
-		    -title [G_msg "No output file specified"]
-        return
-    }    
-    
-    set pathcoords [string trimright $pathcoords ","]
-    set coords_list [split $pathcoords ","] 
-    if { [llength $coords_list] < 8 } {
-        tk_messageBox -type ok -icon warning -parent $w \
-		    -message [G_msg "You must specify at least 4 points (x,y coordinate pairs)"] \
-		    -title [G_msg "Insufficient coordinates specified"]
-        return
-    }    
-        
-    
-    set cmd "d.nviz input=$inmap output=$outfile name=$prefix route=$pathcoords \
-         dist=$layback ht=$height frames=$frames start=$startframe"   
-
-
-    if { $vrender == 1 } { lappend cmd " -e" }
-    if { $fullrender == 1 } { lappend cmd " -f" }
-    if { $offscreen == 1 } { lappend cmd " -o" }
-    if { $ht_elev == 1 } { lappend cmd " -c" }
-    if { $keyframe == 1 } { lappend cmd " -k" }
-    if { $overwrite == 1 } { lappend cmd " --o" }
-	
-    run_panel $cmd
-    
-    # delete rules file and close popup window if OK pressed
-    if { $quit == 1 } {
-        destroy .dnvizPopup
-    }
-
-}
-

+ 0 - 143
gui/tcltk/gis.m/docs/gm_animate.html

@@ -1,143 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>gis.m: ANIMATION TOOL</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="grassdocs.css" type="text/css">
-</head>
-
-<body bgcolor="white">
-
-<h2>ANIMATION TOOL (gis.m)</h2>
-
-The Animation Tool is an interactive interface to display a series of
-raster maps as an animation. Rasters can be added individually or as a
-prefix followed by a sequential number suffix.
-<br>
-
-<h3>Using the Animation Tool</h3>
-
-The Animation Tool is started from the <i>File</i> menu or
-from the animation button (<img src="icons/grass/module-xganim.gif" alt="icon">)
-on the GIS Manager toolbar.
-
-<P>
-The main animation window has a toolbar for selecting maps to display
-and controling the animation, and a display area. The display area can
-show a single, full-screen animation, or two to four simultaneous
-quarter-screen animations.
-<br><br><br>
-
-<center>
-<img src="gm_animate2.jpg" alt="Animation display window">
-</center>
-
-<br><br>
-
-<h3>Selecting Maps to Animate</h3>
-
-Click the maps button (<img src="icons/grass/element-cell.gif" alt="icon">)
-on the main animation window toolbar to open a map selection window.
-<br><br>
-
-<div align="center">
-<img src="gm_animate1.png" alt="Animation map selection window" height="206" width="446">
-</div>
-
-<br>
-A map or map series must be entered in the entry for frame 1. If a map
-series is only entered for frame 1, a single, full-frame animation will be
-displayed. If map series are entered for other frames, two to four
-quarter-frame animations will be displayed (see example image above).
-Raster maps can be added individually or as a prefix followed by a sequential
-number suffix. <br><ul><li>To enter maps individually, enter
-each map name separated by a comma (no space) from the previous map
-name (see the entry for frame 3 in the example image above).</li>
-<li>For a map series entered in the prefix/suffix format, the suffix can be
-specified as a range of numbers in side parentheses. In the example image
-above, "map(1-4)" will specified raster maps map1 through map4. </li>
-
-<li>
-The suffix for a map series also can be specified using Unix-style wildcard
-matching. In the examle above "rdbuffer[0-1][1-9]" specifies raster
-maps rdbuffer01 through rdbuffer19.</li><li>Multiple specification
-forms can be mixed on a single entry line. For example, you could specify
-"rast-a,rast-b,rast-(1-50),rast[0-9][0-9]". This will specify rast-a,
-rast-b, rast-1 through rast-50, and rast00 through rast99.
-<br>
-</li>
-</ul>
-
-<h3>Controlling the Animation</h3>
-
-The animation can be controlled in various ways by using the buttons on the
-main animation window toobar.
-<P>
-<img src="gm_animatetool.png" alt="Animation Toolbar">
-<P>
-<img src="icons/grass/gui-rewind.gif">
-The rewind button will set the display to the first animation frame.
-<P>
-<img src="icons/grass/gui-rplay.gif">
-The reverse button will play the animation in reverse order.
-<P>
-<img src="icons/grass/gui-stepb.gif"> The reverse step button will step
-through the animation frame by frame in reverse order.
-<P>
-<img src="icons/grass/gui-stop.gif"> The pause button will stop the
-animation at whatever frame is visible when the animation is stopped.
-The animation will be continued from this frame when a forward or reverse
-button is pressed.
-<P>
-<img src="icons/grass/gui-stepf.gif"> The forward step button will step
-through the animation frame by frame.
-<P>
-<img src="icons/grass/gui-play.gif"> The play button will display the maps
-of the animation in the order they are listed in the map selection window.
-<P>
-<img src="icons/grass/gui-snail.gif"> The slow button will increase the
-time between the display of each consecutive frame in the animation,
-causing it to to slow down.
-<P>
-<img src="icons/grass/gui-rabbit.gif"> The fast button will decrease the
-time between the display of each consecutive frame in the animation,
-causing it to to speed up.
-<P>
-<img src="icons/grass/gui-loop.gif"> The repeat switch will cause the
-animation to repeatedly cycle from first to last frame if the play button
-is pressed, or cycle from last to first if the reverse button is pressed.
-<P>
-<img src="icons/grass/gui-swing.gif"> The alternating switch will cause the
-animation to alternately play from first frame to last frame, and from last
-to first.
-<P>
-<tt>[Names]</tt> The names switch will cause the file names of the maps used for the
-animation to display in the lower left corner of each animation frame.
-<P>
-<img src="icons/grass/gui-exit.gif"> The Exit button will quit the Animation Tool.
-<br>
-
-
-<h2>SEE ALSO</h2>
-<em>
-<a href="gis.m.html">gis.m</a> manual<br>
-<a href="gm_georect.html">gis.m: GEORECTIFY TOOL</a><br>
-<a href="gm_profile.html">gis.m: PROFILE TOOL</a><BR>
-<BR>
-<a href="xganim.html">xganim</a><br>
-<a href="r.out.mpeg.html">r.out.mpeg</a><br>
-</em>
-
-<h2>AUTHORS</h2>
-
-Michael Barton, Arizona State University, Tempe, Arizona, USA<br>
-Glynn Clements
-
-<p>
-<i>Last changed: $Date$</i></p>
-
-<hr>
-<p><a href="index.html">Main index</a> - <a href="full_index.html">Full index</a></p>
-
-</body>
-</html>

二进制
gui/tcltk/gis.m/docs/gm_animate1.png


二进制
gui/tcltk/gis.m/docs/gm_animate2.jpg


二进制
gui/tcltk/gis.m/docs/gm_animatetool.png


二进制
gui/tcltk/gis.m/docs/gm_gcpmgr.jpg


+ 0 - 219
gui/tcltk/gis.m/docs/gm_georect.html

@@ -1,219 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>gis.m: GEORECTIFY TOOL</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="grassdocs.css" type="text/css">
-</head>
-<body bgcolor="white">
-
-<h2>GEORECTIFY TOOL (gis.m)</h2>
-
-In order to use and overlay different forms of geospatial data in a
-GIS, they must use the same coordinate systems and be projected
-identically. The Georectify Tool uses multiple GRASS modules to
-<i>georectify</i> spatial data (map or image) that is not originally
-coded in an earth-based coordinate system (e.g., latitude/longitude
-or UTM). The Georectify Tool can transform the simple x/y coordinates
-of the original data by shifting, rotating, and warping them as needed
-for the original data to match other georectified data from the same
-location on earth.
-<br>
-<br>
-The basic procedure is to identify a set of <i>ground control points</i>
-(GCPs) in the ungeorectified data. The georectified coordinates for the
-points are identified. A mathematical transformation is calculated by
-regressing the original x/y coordinates against the georectified
-coordinates for the same points. This transformation is then applied to
-all the data.
-<br>
-<br>
-The Georectify Tool can georectify both raster and vector maps. Raster
-maps can be transformed using 1st, 2nd, and 3rd order polynomial
-transformations; vector maps are transformed only with a 1st order
-polynomial transformation. The georectified coordinates of GCPs can be
-entered by typing or can be extracted by clicking the equivalent
-locations with a mouse in a displayed georectified map.
-<br>
-
-
-<h3>Using the Georectify Tool</h3>
-
-<h4>Map Preparation</h4>
-
-The unrectified map or image (e.g., scanned image or CAD drawing) must
-be imported into a GRASS XY location. <br>
-<br>
-In order to be georectified, the unrectified map or image must be added
-to a <i>imagery group</i>.
-An <i>imagery group</i> holds a single map/image or a set of maps/images
-that represent different views of exactly the same locale.
-All maps or images in a single <i>imagery group</i>
-must be exactly aligned (e.g., as in the different spectral bands of a
-multi-channel satellite image or layers of a single CAD drawing). You
-can create an <i>imagery group</i> from within the Georectify Tool if
-desired.
-<br>
-<br>
-
-<h4>Setup</h4>
-
-Restart GRASS, selecting the location/mapset where you want the map you
-will georectify to END UP (i.e., the projected TARGET location).
-Open any map display (or displays) that you want to use for extracting
-geographic coordinates by clicking with a mouse. Make sure that the
-computational region extents and resolution are set to the values you
-want for the newly georectified map.
-<p>
-Select <i><b>Georectify</b></i> from the <i><b>File</b></i> menu.
-</p>
-<p>
-The Georectify Tool startup lets you select the type of map to
-georectify, the location/mapset of the map to georectify, the
-<i>image group</i> of the map to georectify, and a map to use for marking
-GCPs.</p>
-<BR>
-<center>
-<img src="gm_georectstart.jpg" alt="Georectify workflow menu" height="214" width="350">
-</center>
-<BR>
-<ol>
-<li> click the radio button to georectify either raster or
-vector maps (you can only georectify raster <b>OR</b> vector
-maps in a single georectification session),
-</li>
-<li> select the source (XY) location/mapset of the map to be
-georectified,
-</li>
-<li>if needed, create an <i>imagery group</i> for
-the map to georectify. (the <i>imagery group</i> <i><b>target</b></i>
-is automatically set
-to the current location and mapset),
-</li>
-<li> select the <i>imagery group</i> containing
-the map to georectify,
-</li>
-<li> select the map/image to display for marking GCPs
-interactively (a raster or vector in the group you want to
-georectify),
-</li>
-<li> click the "<b>Start Georectifying</b>" button
-to begin marking GCPs.</li>
-</ol>
-
-
-<h4>GCP Marking</h4>
-
-This opens a special map display with an ungeorectified map to use for
-marking GCPs, and a GCP manager window.
-The GCP map display can be zoomed and panned like a normal map display.
-<br>
-<center>
-<img src="gm_georectdisp.jpg" alt="Georectifier Display window" height="439" width="500">
-</center>
-<br>
-<br>
-The GCP manager window holds the x/y coordinates and geographic
-coordinates of each GCP, and displays the <i>error</i> for each
-GCP (i.e., the distance that the actual GCP marked deviates from
-its expected placement using a transformation equation).
-<br>
-<br>
-<center>
-<img src="gm_gcpmgr.jpg" alt="Georectify GCP window" height="253" width="650">
-</center>
-<BR>
-<ol>
-<li> Click in an empty x/y entry box in the GCP manager to begin marking a
-new GCP,
-</li>
-<li> Click on the ungeorectified map to mark a GCP and automatically enter
-its x/y coordinates in the entry box. (Your cursor will automatically jump
-to the corresponding geographic coordinate entry box for the same GCP),
-</li>
-
-<li>Enter the corresponding geographic coordinates for the GCP
-<b>OR</b> click on the same place in a georectified map (in a normal map
-display) to automatically extract the geographic coordinates and enter them
-into the geographic coordinate entry box in the GCP manager window
-(Note: use the <b>pointer tool</b> in the map display window)
-</li>
-</ol>
-
-<h4><b>GCP Management</b></h4>Continue marking GCPs until you
-have enough for an accurate georectification. At least 3 GCPs are
-needed for a simple 1st order (affine) transformation that can shift
-and rotate a map; at least 6 GCPs are needed for a 2nd order
-(polynomial) transformation that will do simple warping in addition to
-shifting and rotating; at least 10 GCPs are needed for a 3rd order
-(polynomial) transformation that will do complex warping.<br><br>Any
-GCP can be edited by typing new values or by selecting the appropriate
-entry box and clicking on the GCP-marking display or georectified map
-display.<br><br>GCPs can be excluded and not used for calculating the
-transformation equation or the total RMS error by unchecking the box in
-the "use" column at the left of each GCP entry line. Only active GCPs
-(i.e., with the "use" box checked) will be used for computing the
-georectification and total error.<br><br>You can delete all inactive GCPs
-(i.e., with unchecked "use" boxes) by clicking the <b>eraser tool</b> in
-the GCP manager tool bar.<br><br>Total <i>RMS (</i>root mean square) error
-is calculated from all active GCPs. Click the <b>RMS tool</b>
-in the GCP manager tool bar to update the total RMS error after
-changing or including/excluding a GCP. Excluding a GCP with an
-especially high individual error can reduce overall RMS error, but will
-also change the individual errors of all other GCPs. The lower the RMS
-error, the more accurate the final georectification will be.
-<br>
-<br>
-All active GCPs can be saved to a <i>POINTS</i> file, associated with the
-<i>imagery group</i> for the map(s) to be georectified. If a saved
-<i>POINTS</i> file exists, prior to a georectification session the GCP
-values in the <i>POINTS</i> file will automatically be entered into the
-GCP manager window when a georectification session is started.
-<br>
-
-
-<h4>Georectification</h4>
-
-When you are satisfied with your selection of GCPs and RMS error...
-<br>
-<ol>
-<li>Select the type of georectification you want to perform (1st, 2nd, or 3rd
-order for rasters; 1st order only for vectors). Remember, at least 3
-points are needed for 1st order georectification, 6 points for 2nd
-order, and 10 points for 3rd order.</li>
-<li>Press the <b>Georectification button</b> on the GCP manager tool bar.
-Depending on the number of cells in a raster map or nodes in a vector map,
-georectification may take some time.</li>
-</ol>
-
-
-<h2>SEE ALSO</h2>
-
-<em>
-<a href="gis.m.html">gis.m</a> manual<br>
-<a href="gm_animate.html">gis.m: ANIMATION TOOL</a><br>
-<a href="gm_profile.html">gis.m: PROFILE TOOL</a><BR>
-<BR>
-<a href="i.points.html">i.points</a><br>
-<a href="i.vpoints.html">i.vpoints</a><br>
-<a href="i.rectify.html">i.rectify</a><br>
-<a href="g.proj.html">g.proj</a><br>
-<a href="g.setproj.html">g.setproj</a><br>
-<a href="m.proj.html">m.proj</a><br>
-<a href="r.proj.html">r.proj</a><br>
-<a href="v.proj.html">v.proj</a>
-</em>
-
-
-<h2>AUTHORS</h2>
-Michael Barton, Arizona State University, Tempe, Arizona, USA
-
-<p>
-<i>Last changed: $Date$</i></p>
-
-<hr>
-<p>
-<a href="index.html">Main index</a> - <a href="full_index.html">Full index</a></p>
-
-</body>
-</html>

二进制
gui/tcltk/gis.m/docs/gm_georectdisp.jpg


二进制
gui/tcltk/gis.m/docs/gm_georectstart.jpg


二进制
gui/tcltk/gis.m/docs/gm_gismgr.jpg


二进制
gui/tcltk/gis.m/docs/gm_gismgrtools.png


二进制
gui/tcltk/gis.m/docs/gm_gronsole.png


二进制
gui/tcltk/gis.m/docs/gm_mapdisp.jpg


二进制
gui/tcltk/gis.m/docs/gm_mapdisptools.png


+ 0 - 97
gui/tcltk/gis.m/docs/gm_profile.html

@@ -1,97 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>gis.m: PROFILE TOOL</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="grassdocs.css" type="text/css">
-</head>
-<body bgcolor="white">
-
-<h2>PROFILE TOOL (gis.m)</h2>
-
-The Profile Tool will draw a 2-dimensional profile of the surface of
-any raster map. The profile will be calculated along a transect line, drawn
-with  a mouse on a map display. The transect line can be a
-simple line (i.e., with only a beginning and ending node) or a complex
-polyline (i.e., with multiple segments, delineated by multiple nodes).
-<br>
-
-<h3>Using the Profile Tool</h3>
-
-The Profile Tool is started by clicking on the profile button
-(<img src="icons/gui-profile.gif" alt="Profile icon">) on the toolbar of
-a map display window.
-<br>
-<br>
-<div align="center"><img src="gm_profile1.png" alt="Profile controls" align="top" height="264" width="400">
-<BR><BR>
-<img src="gm_profile2.jpg" alt="Profile route on map" height="422" width="480">
-</div>
-
-<ol>
-<li>Click the map button on the Profile Tool toolbar to select a raster map
-to profile. The map to profile can be different from the one displayed.
-</li>
-<li>
-Click the transect button to begin drawing a transect to profile with a mouse
-the current map display (i.e., the map display from which you launched the
-Profile Tool). Draw by holding down the left button to make a
-"rubber-band" line for each segment of the transect. A transect can
-have a single, straight segment or multiple segment. There is no need
-to "end" the drawing. The Profile Tool will profile the drawn transect
-at any time. You can also  extend an existing transect and
-draw a profile of the new transect.
-</li>
-<li>Click the profile button to create the profile.
-</li>
-</ol>
-
-<div align="center">
-<img src="gm_profile3.png" alt="Profile plot" height="264" width="400">
-</div>
-<br><br>
-
-The profile extends from left to right in the profile display. The
-horizontal (x-axis) scale represents the total distance along the
-transect to be profiled. Vertical lines mark each node on a
-multi-segment transect and show the total distance along the transect
-to the node. The vertical (y-axis) scale is in units of the map that is
-being profiled. All scaling and axis labels are created automatically,
-and cannot be changed by the user.
-<br><br>
-
-&bull; The erase button will erase the current transect and profile.
-<br><br>
-
-&bull; The save button will save the profile to an Encapsulated PostScript
-(.eps) file.
-<br><br>
-
-
-<h2>SEE ALSO</h2>
-<em>
-<a href="gis.m.html">gis.m</a> manual<br>
-<a href="gm_animate.html">gis.m: ANIMATION TOOL</a><br>
-<a href="gm_georect.html">gis.m: GEORECTIFY TOOL</a><br>
-<BR>
-<a href="d.profile.html">d.profile</a><br>
-<a href="d.geodesic.html">d.geodesic</a><br>
-<a href="d.rhumbline.html">d.rhumbline</a><br>
-<a href="m.cogo.html">m.cogo</a><br>
-<a href="r.profile.html">r.profile</a><br>
-<a href="r.transect.html">r.transect</a><br>
-</em>
-
-<h2>AUTHORS</h2>
-Michael Barton, Arizona State University, Tempe, Arizona, USA<br>
-Hamish Bowman, University of Otago, Dunedin, New Zealand
-
-<p>
-<i>Last changed: $Date$</i></p>
-
-<hr>
-<p>
-<a href="index.html">Main index</a> - <a href="full_index.html">Full index</a></p>
-
-</body>
-</html>

二进制
gui/tcltk/gis.m/docs/gm_profile1.png


二进制
gui/tcltk/gis.m/docs/gm_profile2.jpg


二进制
gui/tcltk/gis.m/docs/gm_profile3.png


+ 0 - 409
gui/tcltk/gis.m/dtext.tcl

@@ -1,409 +0,0 @@
-##########################################################################
-# dtext.tcl new version - standard text layer options file for GRASS GIS Manager
-# November 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmDtext {
-    variable array opt # d.text options
-    variable count 1
-    variable array lfile 
-    variable array lfilemask
-    variable optlist
-    variable first
-    variable array dup 
-    variable placement 
-    variable optlist
-    global env
-	
-}
-
-proc GmDtext::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-	variable optlist
-    global iconpath env
-    
-    set node "dtext:$count"
-
-    set frm [ frame .texticon$count]
-    set check [checkbutton $frm.check \
-    	-variable GmDtext::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo textico -file "$iconpath/module-d.text.gif"
-    set ico [label $frm.ico -image textico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "text layer $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,_check) 1 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,text) "" 
-    set opt($count,1,at) "10,10" 
-    set opt($count,1,coordinates) "percent" 
-    set opt($count,1,mouseset) 0
-    set opt($count,1,align) "lower_left" 
-    set opt($count,1,line)  10
-    set opt($count,1,rotate) 0
-	set opt($count,1,font) "" 
-    set opt($count,1,bold) 0 
-	set opt($count,1,size) 10
-    set opt($count,1,color) \#000000 
-    set opt($count,1,linespace) 1.25
-    set first 1
-        
-    set optlist { _check text at coordinates mouseset\
-    	align line rotate font bold size color linespace}
-    
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-		
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmDtext::set_option { node key value } {
-    variable opt
-
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-##########################################################################
-proc GmDtext::set_font { id } {
-	variable opt
-
-	if {$GmDtext::opt($id,1,font) != "" } {
-		set Gm::dfont $GmDtext::opt($id,1,font)
-	}
-	Gm::defaultfont dtext
-	tkwait variable Gm::dfont
-	set GmDtext::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-
-}
-
-###############################################################################
-
-proc GmDtext::mouseset { id } {
-	# use mouse to set text placement coordinates
-	global mon pctentry pixelentry geogentry
-	variable placement
-	if { $GmDtext::opt($id,1,mouseset) == 1} {
-		if {$GmDtext::opt($id,1,coordinates) == "pixels"} {
-			set pixelentry $GmDtext::placement
-		} else {
-			set pixelentry ""
-		}
-		if {$GmDtext::opt($id,1,coordinates) == "percent"} {
-			set pctentry $GmDtext::placement
-		} else {
-			set pctentry ""
-		}
-		if {$GmDtext::opt($id,1,coordinates) == "geographic"} {
-			set geogentry $GmDtext::placement
-		} else {
-			set geogentry ""
-		}
-	}
-}
-
-###############################################################################
-# dtext options
-proc GmDtext::options { id frm } {
-    variable opt
-	variable placement
-	variable first
-    global iconpath bgcolor
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Display text"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmDtext::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # text
-    set row [ frame $frm.text ]
-    LabelEntry $row.a -label [G_msg "Text to display: "] -textvariable GmDtext::opt($id,1,text) -width 51
-    Button $row.b -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.text" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-    
-    # coordinates1
-    set row [ frame $frm.east_north ]
-    set placement [LabelEntry $row.a -textvariable GmDtext::opt($id,1,at) -width 25 \
-    	-label [G_msg "Text placement: x,y coordinates (from upper left) "]]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-        
-    # coordinates2
-    set row [ frame $frm.textcoord2 ]
-    Label $row.a -text [G_msg "     coordinate type for text placement "] 
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmDtext::opt($id,1,coordinates) \
-    	-values {"pixels" "percent" "geographic" } -modifycmd "GmDtext::mouseset $id"
-    checkbutton $row.c -text [G_msg "place with mouse"] \
-    	-variable GmDtext::opt($id,1,mouseset) \
-    	-command "GmDtext::mouseset $id"
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-    
-    # alignment
-    set row [ frame $frm.textalign ]
-    Label $row.a -text [G_msg "     align text with coordinate point  "] 
-    ComboBox $row.b -padx 2 -width 12 -textvariable GmDtext::opt($id,1,align) \
-		-values {"lower_left" "bottom_center" "lower_right" "center_left" "center" 
-		"center_right" "upper_left" "top_center" "upper_right" } 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-	# rotation
-    set row [ frame $frm.textrotate ]
-    Label $row.a -text [G_msg "     text rotation (degrees)"] 
-    set rotation [SpinBox $row.b -range {-360 360 1} -textvariable GmDtext::opt($id,1,rotate) \
-		-entrybg white -width 6]
-	if {$first==1} {$rotation setvalue @360}
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes	
-
-    # font options1
-    set row [ frame $frm.fontopt1 ]
-    Label $row.a -text [G_msg "Text options: font "] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmDtext::set_font $id"
-    Label $row.c -text [G_msg "  color"] 
-    SelectColor $row.d -type menubutton -variable GmDtext::opt($id,1,color)
-    checkbutton $row.e -padx 10 -text [G_msg "bold text"] -variable \
-        GmDtext::opt($id,1,bold) 
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # font options3
-    set row [ frame $frm.fontopt3 ]
-    LabelEntry $row.a -label [G_msg "     text height in pixels "]\
-    	-textvariable GmDtext::opt($id,1,size) -width 6
-    LabelEntry $row.b -label [G_msg "  line spacing"]\
-    	-textvariable GmDtext::opt($id,1,linespace) -width 6
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-}
-
-###############################################################################
-proc GmDtext::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-		GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    }
-}
-
-###############################################################################
-proc GmDtext::display { node mod } {
-    global mon env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    variable first
-    
- 	set line ""
-    set input ""
-    set cmd ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    # set hex colors to rgb         
-    set color [GmLib::color $opt($id,1,color)]
-    
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-
-    if { $opt($id,1,text) == "" } { return } 
-
-    switch $opt($id,1,align) {
-    	"lower_left" 	{ set align "ll"}
-    	"bottom_center" { set align "lc" }
-    	"lower_right" 	{ set align "lr"}
-    	"center_left" 	{ set align "cl" }
-    	"center" 		{ set align "cc" }
-    	"center_right" 	{ set align "cr" }
-    	"upper_left" 	{ set align "ul"}
-    	"top_center" 	{ set align "uc" }
-    	"upper_right" 	{ set align "ur"}
-    }
-    
-    if {$opt($id,1,coordinates) == "percent"} {
-		set atlist [split $opt($id,1,at) ","]
-		set xcoord [lindex $atlist 0]
-		set ycoord [expr 100 - [lindex $atlist 1]]
-		set at "$xcoord,$ycoord"
-    } else {
-    	set at $opt($id,1,at)
-    }
-  
-    set cmd "d.text -s size=$opt($id,1,size) color=$color \
-    	at=$at align=$align  rotation=$opt($id,1,rotate) \
-    	linespacing=$opt($id,1,linespace) --q {text=$opt($id,1,text)}"
-  
-    # bold text
-    if { $opt($id,1,bold) != 0 } { 
-        append cmd " -b"
-    }
-    
-    # coordinates in pixels or geographic coordinates
-    if {$opt($id,1,coordinates) == "pixels"} {
-    	append cmd " -p"    
-    } elseif {$opt($id,1,coordinates) == "geographic"} {
-    	append cmd " -g"
-    }
-    
-
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-
-    # set grass font environmental variable to user selection"
-	if { $GmDtext::opt($id,1,font) != ""} { set env(GRASS_FONT) $GmDtext::opt($id,1,font) }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-
-}
-
-###############################################################################
-# text duplicate layer
-
-proc GmDtext::duplicate { tree parent node id } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-    global iconpath
-
-    set node "dtext:$count"
-    set dup($count) 1
-
-    set frm [ frame .texticon$count]
-    set check [checkbutton $frm.check \
-    	-variable GmDtext::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo textico -file "$iconpath/module-d.text.gif"
-    set ico [label $frm.ico -image textico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
- 
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-		-text  "text layer $count"\
-		-window    $frm \
-		-drawcross auto  
-        
-	set opt($count,1,opacity) $opt($id,1,opacity)
-    set first 1
-        
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 283
gui/tcltk/gis.m/frames.tcl

@@ -1,283 +0,0 @@
-##########################################################################
-# frames.tcl - display frames layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmDframe {
-    variable array opt # frame current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # frame
-    variable array lfilemask # frame
-    variable optlist
-    variable first
-    variable array dup # layer
-}
-
-proc GmDframe::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-    global mon
-    global iconpath
-
-    set node "dframe:$count"
-
-    set frm [ frame .dframeicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmDframe::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo dfrmico -file "$iconpath/module-d.frame.gif"
-    set ico [label $frm.ico -image dfrmico -bd 1 -relief raised]
-    
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "frame $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,frame) "" 
-    set opt($count,1,erase) 0 
-    set opt($count,1,create) 1 
-    set opt($count,1,select) 0 
-    set opt($count,1,at) "50,100,0,50" 
-    set opt($count,1,mod) 1
-    set first 1
-
-	set optlist { _check frame erase create select at }
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-proc GmDframe::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-
-# frame options
-proc GmDframe::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Divide map display into frames for displaying multiple maps"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # create, select, or erase frames
-    set row [ frame $frm.cats ]
-    checkbutton $row.a -text [G_msg "create and select frame"] -variable \
-        GmDframe::opt($id,1,create) 
-    checkbutton $row.b -text [G_msg "select frame"] -variable \
-        GmDframe::opt($id,1,select) 
-    checkbutton $row.c -text [G_msg "remove all frames   "] -variable \
-        GmDframe::opt($id,1,erase) 
-    Button $row.d -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.frame" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # frame name
-    set row [ frame $frm.frame ]
-    Label $row.a -text [G_msg "Frame name (optional): "]
-    LabelEntry $row.b -textvariable GmDframe::opt($id,1,frame) -width 40
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # place frame1
-    set row [ frame $frm.at1 ]
-    Label $row.a -text [G_msg "Set frame borders at 0-100% from lower left corner of display "]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-    
-    # place frame2
-    set row [ frame $frm.at2 ]
-    Label $row.a -text [G_msg "     set borders (bottom,top,left,right): "]
-    LabelEntry $row.b -textvariable GmDframe::opt($id,1,at) -width 25
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-            
-}
-
-proc GmDframe::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-
-proc GmDframe::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    variable first
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,create) == 0 && $opt($id,1,select) == 0 && $opt($id,1,erase) == 0 } { return } 
-    if { $opt($id,1,at) == "" } { return }
-    set cmd "d.frame"
-
-
-    # create
-    if { $opt($id,1,create) == 1 } { 
-        append cmd " -c"
-    }
-
-    # select
-    if { $opt($id,1,select) == 1 } { 
-        append cmd " -s"
-    }
-
-    # erase and remove
-    if { $opt($id,1,erase) == 1 } { 
-        append cmd " -e"
-    }
-
-    # frame name
-    if { $opt($id,1,frame) != "" } { 
-        append cmd " frame=$opt($id,1,frame)"
-    }
-
-    # frame placement
-    if { $opt($id,1,at) != "" } { 
-        append cmd " at=$opt($id,1,at)"
-    }
-
-    # check to see if options have changed
-    foreach key $optlist {
-        if {$opt($id,0,$key) != $opt($id,1,$key)} {
-        	set opt($id,1,mod) 1
-        	set opt($id,0,$key) $opt($id,1,$key)
-        }
-    }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-
-proc GmDframe::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-	global first
-
-    set node "dframe:$count"
-	set dup($count) 1
-
-    set frm [ frame .dframeicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmDframe::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo dfrmico -file "$iconpath/module-d.frame.gif"
-    set ico [label $frm.ico -image dfrmico -bd 1 -relief raised]
-    
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,frame) == ""} {
-    	$tree insert $sellayer $parent $node \
-		-text      "frame $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-    	$tree insert $sellayer $parent $node \
-		-text      "$opt($id,1,frame)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-	set optlist { _check frame erase create select at }
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

文件差异内容过多而无法显示
+ 0 - 2458
gui/tcltk/gis.m/georect.tcl


+ 0 - 162
gui/tcltk/gis.m/georecttool.tcl

@@ -1,162 +0,0 @@
-###############################################################
-# georecttool.tcl - toolbar file for georectify canvas, GRASS GIS Manager
-# June 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-###############################################################
-
-
-namespace eval GRToolBar {
-    variable toolbar
-    variable grmaptools
-}
-
-
-###############################################################################
-
-proc GRToolBar::create { tb } {
-    variable grmaptools
-    variable toolbar
-    global gmpath
-    global bgcolor
-    global tk_version
-    global iconpath
-    
-    set selcolor #88aa88
-    set grmaptools "selector"
-    set toolbar $tb
-
-    # DISPLAY AND MONITOR SELECTION
-    set bbox1 [ButtonBox $toolbar.bbox1 -spacing 0 ]
-    
-    # display
-    $bbox1 add -image [image create photo -file "$iconpath/gui-display.gif"] \
-        -command "GRMap::request_redraw 1" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Display active layers"]
-
-    # erase
-    $bbox1 add -image [image create photo -file "$iconpath/gui-erase.gif"] \
-        -command "GRMap::erase" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Erase to white"]
-
-    pack $bbox1 -side left -anchor w
-
-    set sep1 [Separator $toolbar.sep1 -orient vertical -background $bgcolor ]
-    pack $sep1 -side left -fill y -padx 5 -anchor w
-    
-    # DISPLAY TOOLS
-
-    # selector
-    if {$tk_version < 8.4 } {
-	set selector [radiobutton $tb.selector \
-		-image [image create photo -file "$iconpath/gui-gcpset.gif"] \
-		-command "GRMap::stoptool; GRMap::selector" \
-		-variable grmaptools -value selector -relief flat \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor  ]
-    } else {
-	set selector [radiobutton $tb.selector \
-		-image [image create photo -file "$iconpath/gui-gcpset.gif"] \
-		-command "GRMap::stoptool; GRMap::selector" \
-		-variable grmaptools -value selector \
-		-relief flat -offrelief flat -overrelief raised \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor  ]
-    }
-    DynamicHelp::register $selector balloon [G_msg "Set ground control points"]
-
-    # zoom in
-    if {$tk_version < 8.4 } {
-	set zoomin [radiobutton $tb.zoomin \
-		-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
-		-command "GRMap::stoptool; GRMap::zoombind 1" \
-		-variable grmaptools -value zoomin -relief flat \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]   
-    } else {
-	set zoomin [radiobutton $tb.zoomin \
-		-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
-		-command "GRMap::stoptool; GRMap::zoombind 1" \
-		-variable grmaptools -value zoomin \
-		-relief flat -offrelief flat -overrelief raised \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]   
-    }
-    DynamicHelp::register $zoomin balloon [G_msg "Zoom In"]
-    
-    #zoom out
-    if {$tk_version < 8.4 } {
-	set zoomout [radiobutton $tb.zoomout \
-		-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
-		-command "GRMap::stoptool; GRMap::zoombind -1" \
-		-variable grmaptools -value zoomout -relief flat \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]    
-    } else {
-	set zoomout [radiobutton $tb.zoomout \
-		-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
-		-command "GRMap::stoptool; GRMap::zoombind -1" \
-		-variable grmaptools -value zoomout \
-		-relief flat -offrelief flat -overrelief raised \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]    
-    }
-    DynamicHelp::register $zoomout balloon [G_msg "Zoom Out"]
-
-    # pan
-    if {$tk_version < 8.4 } {
-	set pan [radiobutton $tb.pan \
-		-image [image create photo -file "$iconpath/gui-pan.gif"] \
-		-command "GRMap::stoptool; GRMap::panbind" \
-		-variable grmaptools -value pan -relief flat \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]    
-    } else {
-	set pan [radiobutton $tb.pan \
-		-image [image create photo -file "$iconpath/gui-pan.gif"] \
-		-command "GRMap::stoptool; GRMap::panbind" \
-		-variable grmaptools -value pan \
-		-relief flat -offrelief flat -overrelief raised \
-		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selcolor \
-		-activebackground $bgcolor -highlightbackground $bgcolor ]    
-    }
-    DynamicHelp::register $pan balloon [G_msg "Pan"]
-
-    pack $selector $zoomin $zoomout $pan -side left -anchor w
-
-    set sep2 [Separator $toolbar.sep2 -orient vertical -background $bgcolor ]
-    pack $sep2 -side left -fill y -padx 5 -anchor w
-
-    set bbox2 [ButtonBox $toolbar.bbox2 -spacing 0  ]
-
-    # zoom.back
-    $bbox2 add -image [image create photo -file "$iconpath/gui-zoom_back.gif"] \
-        -command "GRMap::zoom_back" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1\
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Return to previous zoom"]
-
-    # zoom to map
-    $bbox2 add -image [image create photo -file "$iconpath/gui-zoom_map.gif"] \
-        -command {GRMap::zoom_map} \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1\
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Zoom to map"]
-
-    pack $bbox2 -side left -anchor w
-}
-
-###############################################################################
-# changes button on keypress
-proc GRToolBar::changebutton { rbname } {
-	variable grmaptools
-	
-	set grmaptools $rbname
-}

+ 0 - 26
gui/tcltk/gis.m/gis.m

@@ -1,26 +0,0 @@
-#!/bin/sh
-
-#% Module
-#%  description: GIS manager for GRASS
-#% End
-#%option
-#% key: dmrc
-#% type: string
-#% description: Name of GIS manager settings file (.grc)
-#% required : no
-#%End
-
-if [ $# -eq 0 ] ; then
-#	if [ "$HOSTTYPE" = "macintosh" -o "$HOSTTYPE" = "powermac" -o "$HOSTTYPE" = "powerpc" -o "$HOSTTYPE" = "intel-pc" ] ; then
-#		exec "$GRASS_WISH" "$GISBASE/etc/gm/gm.tcl" -name gm_tcl
-#	else
-   		exec "$GRASS_WISH" "$GISBASE/etc/gm/gm.tcl" -name gm_tcl &
-#   	fi
-	exit
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-exec "$GRASS_WISH" "$GISBASE/etc/gm/gm.tcl" -name gm_tcl "$GIS_OPT_DMRC" sh &

+ 0 - 1
gui/tcltk/gis.m/gis.m.bat

@@ -1 +0,0 @@
-@start "%GRASS_WISH%" "%GISBASE%/etc/gm/gm.tcl

+ 0 - 431
gui/tcltk/gis.m/gis.m.html

@@ -1,431 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-The <b>GRASS GIS Manager</b>
-provides an interactive graphical interface to GRASS commands. By
-default, it is started automatically with each GRASS session. The GIS
-Manager can be quit by selecting the <em>'File-&gt;Exit</em><em>'</em>
-menu item. The GIS Manager can be restarted from the GRASS command line
-shell by typing "<i>gis.m</i>".<br>
-<br>
-The GIS Manager includes a set of pull-down menus for all GRASS GIS
-functions (analysis, file I/O, GIS configuration and management), two
-rows of buttons that manage display layers, an upper window in
-which layers to display are organized, and a lower
-window which contains options panels for layers in the layer tree.
-<br><br>
-
-<center>
-<img src="gm_gismgr.jpg" alt="GIS Manager window" height="551" width="480">
-</center>
-<br>
-
-<br>
-The top left button opens a new map display window. Each map display
-has a unique set of layers to display and region setting (zoom). Other
-buttons add layers of different types for display in the selected map
-display window. There are additional buttons for saving or opening
-group display file, starting XGANIM (display animator) display
-interfaces (requires motif), and digitizing.
-<i>Mouse-over help</i> is available for all buttons.
-
-<P>
-Map layers are listed in the window below the
-buttons. Layers can include raster and vector maps, text, map
-enhancements (scale and north arrow, and grids), and commands
-(where any GRASS command be written). Layers are displayed in as
-arranged in the layer tree: the bottom layer
-is displayed first and the top is displayed last, as if
-layers are a series of stacked overlays. Any layer can be
-renamed by double clicking on its name and typing a new name.
-
-<P>
-The check box to the left of each layer makes it active or inactive for
-display.
-Only active layers are displayed/redisplayed when the display button is
-pressed. Layers can be organized into groups; entire groups can be
-activated or deactivated for display. Groups can be saved to a file and
-opened in subsequent sessions, restoring all layers and their display
-options.
-
-<P>
-When a layer is selected with the mouse, its options are shown in the
-panel below the layer tree window. Help for each layer type can be
-accessed by pressing the GRASS button in the option panel.<br>
-
-<P>
-Each map display has a unique layer tree and region setting (zoom).
-Buttons on each map display manage the map in the display (zoom and
-pan), provide tools for query and distance measurement, and exporting
-or printing the display. The geographic coordinates under the cursor
-are displayed in the indicator window (lower right window frame). It is
-important to note that zooming in any display will have NO effect on
-the 'computational region' setting (set with g.region). Only by selecting
-the "Set current region to match display" item in the zoom menu (in the
-map display tool bar) will the current display extents be copied to
-the computational region extents.
-<br><br>
-
-<center>
-<img src="gm_mapdisp.jpg" alt="Map Display window" height="422" width="480">
-</center>
-<br><br>
-
-A separate console window shows all commands issued and all command
-output (upper window). GRASS commands (and any other unix/linux
-commands) can be run from the console (lower window).<br>
-
-<br>
-<center>
-<img src="gm_gronsole.png" alt="Output and command console window" height="231" width="480">
-</center>
-<br>
-
-
-<h2>GIS MANAGER BUTTON FUNCTIONS</h2>
-
-<img src="gm_gismgrtools.png" alt="GIS Manager Toolbar">
-
-
-<H3><u>Top Row</u></H3>
-
-<DL>
-
-<DT><img src="icons/grass/gui-startmon.gif"> Open new map display</DT>
-<DD>Opens a new map display and resets layer tree.</DD>
-
-<DT><img src="icons/grass/element-cell.gif"> Add raster layer</DT>
-<DD>Adds a raster map to the layer tree. Raster display options include:
-displaying a selected subset of raster cells, defined by their cat
-values; draping (or "fusing") a second map over the base map;
-and displaying legends for the base map and draped map.
-<i>See <a href="d.rast.html">d.rast</a> and <a href="d.his.html">d.his</a>
- (for draping/fusing).</i>
-</DD>
-
-<DT><img src="icons/grass/channel-rgb.gif"> Add RGB or HIS raster layer</DT>
-<DD>Combines and displays three raster maps defined as red, green, and blue
-channels; or combines and displays two or three raster maps defined as
-hue, intensity, and (optionally) saturation channels.
-<i>See <a href="d.rgb.html">d.rgb</a> and <a href="d.his.html">d.his</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.histogram.gif"> Add histogram layer</DT>
-<DD>Adds a layer to display histogram of a raster map or image.
-<i>See <a href="d.histogram.html">d.histogram</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.rast.num.gif"> Add cell values layer</DT>
-<DD>Adds map of raster cells with cell values printed inside.
-Only works when &lt;10,000 cells are displayed.
-<i>See <a href="d.rast.num.html">d.rast.num</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.rast.arrow.gif"> Add raster arrows layer</DT>
-<DD>Adds map of raster cells with directional arrows drawn.
-Arrow direction and length are determined by separate aspect/directional map
-and (optional) slope/intensity map.
-<i>See <a href="d.rast.arrow.html">d.rast.arrow</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.legend.gif"> Add raster legend</DT>
-<DD>Adds a legend for a single raster map to the layer tree.
-Multiple options for formatting the legend are available.
-<i>See <a href="d.legend.html">d.legend</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/element-vector.gif"> Add vector layer</DT>
-<DD>Adds a vector map to the layer tree. A large number of options are
-available for displaying the vector map, including: outline and fill
-color, icon type and size for points, line widths for all vector types,
-automatic labeling using an attribute column, querying cats or
-attributes to limit vectors displayed, and restricting vector display
-depending on region size.
-<i>See <a href="d.vect.html">d.vect</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.vect.thematic.gif"> Add thematic map layer
-(for all vector types)</DT>
-<DD>Adds layer for thematic display values from a numeric attribute column
-associated with a vector map. Options include: thematic display type
-(graduated colors or point sizes), methods for creating display
-intervals, SQL query of attribute column to limit vector objects to
-display, control of point icon types and sizes, control of thematic
-color schemes, creation of legend for thematic map, and saving the
-results of thematic mapping to a ps.map instructions file for later
-printing.
-<i>See <a href="d.vect.thematic.html">d.vect.thematic</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.vect.chart.gif"> Add thematic charts layer
-(for vector points)</DT>
-<DD>Adds layer in which pie or bar charts can be automatically created at
-vector point locations. Charts display values from selected columns in the
-associated attribute table. Options include: chart type, layer and
-attributes to chart, chart colors, and chart size (fixed or based on
-attribute column).
-<i>See <a href="d.vect.chart.html">d.vect.chart</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.labels.gif"> Add raster labels layer for vector
-objects (from existing labels file)</DT>
-<DD>Add raster text layer from a labels file for vector objects created with
-the <em><a href="v.label.html">v.label</a></em> module (accessed from button
-in options panel). A labels file can also be created with a text editor.
-<i>See <a href="d.labels.html">d.labels</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.text.gif"> Add text layer</DT>
-<DD>Adds layer to display a line of text using default GRASS font
-(selected with <em><a href="d.font.html">d.font</a></em>).
-Options include: text placement (screen coordinates); and text size,
-bolding, and color.
-<i>See <a href="d.text.html">d.text</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/gui-maptext.gif"> Add PostScript labels layer for vector
-objects (from existing labels file)</DT>
-<DD>Add PostScript text layer from a labels file for vector objects created
-with the <em><a href="v.label.html">v.label</a></em> module (accessed from
-button in options panel). A labels file can also be created with a text editor.
-<i>See <a href="d.labels.html">d.labels</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/gui-maplabels.gif"> Add PostScript text layer</DT>
-<DD>Adds layer to display a line of PostScript text. Options include: text
-placement by coordinates (geographic or screen); text
-alignment, font and line spacing; and text size, bolding, and color.
-</DL>
-
-<BR><BR>
-
-
-<H3><u>Bottom Row</u></H3>
-
-<DL>
-
-<DT><img src="icons/grass/module-d.barscale.gif"> Add scalebar and north arrow layer</DT>
-<DD>Adds layer to display a combined scalebar and north arrow. Options
-include scalebar placement (using screen coordinates or a mouse),
-scalebar format, and scalebar colors.
-<i>See <a href="d.barscale.html">d.barscale</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/module-d.grid.gif"> Overlay grids and lines</DT>
-<DD>Adds layer to display regular grid (for all locations), or geodesic and
-rhumblines (for latitude/longitude locations only). Grid options
-include: grid and border colors, grid origin, and grid line spacing.
-Geodesic and rhumbline options include: line color, and xy coordinates
-(geographic) of line endpoints.
-<i>See <a href="d.grid.html">d.grid</a>, <a href="d.geodesic.html">d.geodesic</a>,
- and <a href="d.rhumbline.html">d.rhumbline</a>.</i>
-</DD>
-
-<DT><img src="icons/grass/gui-cmd.gif"> Add command layer</DT>
-<DD>Adds a layer in which a GRASS GIS command or command list can be entered.
-For a command list use the pipe symbol as "|" as separator.
-For example:
-
-<div class="code"><pre>
-  d.rast soils | d.rast -o roads | d.vect streams col=blue
-</pre></div>
-
-Note that when an option of the command contains spaces, you need to
-escape them with the backslash ('\') character, for example:<BR>
-<tt>d.text text=Population\ density</tt>
-</DD>
-
-<DT><img src="icons/grass/gui-group.gif"> Add group</DT>
-<DD>Adds an empty layer group. Layers can then be added to the group.</DD>
-
-<DT><img src="icons/grass/edit-copy.gif"> Duplicate selected layer or group</DT>
-<DD>Adds a new layer that duplicates the selected layer.</DD>
-
-<DT><img src="icons/grass/edit-cut.gif"> Cut selected layer or group</DT>
-<DD>Deletes the selected group or layer.</DD>
-
-<DT><img src="icons/grass/file-new.gif"> Erase all layers and create a new group</DT>
-<DD>Removes all layers in the layer tree and creates a new, empty group to
-which new layers can be added.<br></DD>
-
-<DT><img src="icons/grass/file-open.gif"> Open an existing group file</DT>
-<DD>Opens an previously saved group file, containing a set of display
-layers and their option settings.</DD>
-
-<DT><img src="icons/grass/file-save.gif"> Save layers to group file</DT>
-<DD>Saves current set of layers and their options to a group file.</DD>
-
-<DT><img src="icons/grass/module-xganim.gif"> Animate raster map series</DT>
-<DD>Starts the interactive Animation Tool interface to display a series
-of raster maps as an animation.
-<i>See the <a href="gm_animate.html">Animation Tool help page</a></i>.
-</DD>
-
-<DT><img src="icons/grass/module-v.digit.gif"> Digitize raster or vector maps</DT>
-<DD>Starts the raster digitizing or vector digitizing module, depending on
-whether a raster or vector map is selected. Raster digitizing always
-creates a new map. Vector digitizing will either edit an existing map
-(if an existing vector map is selected in the layer tree) or create a
-new vector map (if the name of the new vector to be created is entered
-in the 'vector name' field of the options panel for a vector map
-layer).
-<i>See <a href="r.digit.html">r.digit</a> and <a href="v.digit.html">v.digit</a></i>.
-</DD>
-
-</DL>
-<BR><BR>
-
-
-
-<h2>MAP DISPLAY BUTTON FUNCTIONS</h2>
-
-<img src="gm_mapdisptools.png" alt="Map display toolbar">
-
-<DL>
-
-<DT><img src="icons/grass/gui-display.gif"> Display active layers (current region)</DT>
-<DD>Displays all active layers at current resolution and region extents for
-that map display window.</DD>
-
-<DT><img src="icons/grass/gui-zoom_current.gif"> Re-render and display all active
-layers and zoom to current region</DT>
-<DD>Resets the region to the resolution and extents to the values set with
-<em>g.region</em>; forces re-display and re-rendering all active layers.
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/module-nviz.gif"> NVIZ</DT>
-<DD>Starts NVIZ, the <i>n</i>-dimensional visualization module and interactive
-graphical interface. All active raster and vector layers in the layer
-tree will be displayed in NVIZ.
-<i>See the <a href="nviz.html">nviz</a> manual.</i></DD>
-
-<DT><img src="icons/grass/module-d.nviz.gif"> Create fly through path for NVIZ</DT>
-<DD>Starts a GRASS module for interactive creation of a fly-through path to
-be animated in NVIZ.
-<i>See <a href="d.nviz.html">d.nviz</a></i>.</DD>
-
-<DT><img src="icons/grass/gui-erase.gif"> Erase to white</DT>
-<DD>Erases the currently selected monitor to a white background; also
-removes all frames.
-<i>See <a href="d.erase.html">d.erase</a> and
-<a href="d.frame.html">d.frame -e</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-pointer.gif"> Arrow cursor</DT>
-<DD>Select arrow cursor for map display.</DD>
-
-<DT><img src="icons/grass/gui-zoom_in.gif"> Zoom in</DT>
-<DD>Interactive zooming with the mouse in the active display monitor.
-Drawing a box with the mouse (left button) and zoom-in cursor causes
-the display to zoom in so that the area defined by the box fills the
-display. The map resolution is not changed. Clicking with the zoom-in
-cursor causes the display to zoom in by 30%, centered on the point
-where the mouse is clicked. Zooming resets the display region extents
-(both size and location of area displayed). It does NOT affect the
-computational region for other GIS processes.
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-zoom_out.gif"> Zoom out</DT>
-<DD>Interactive zooming with the mouse in the active display monitor.
-Drawing a box with the mouse (left button) and zoom-out cursor causes
-the display to zoom in so that the area displayed shrinks to fill the
-area defined by the box. The map resolution is not changed. Clicking
-with the zoom-out cursor causes the display to zoom out by 30%, centered
-on the point where the mouse is clicked. Zooming resets the display
-region extents (both size and location of area displayed). It does NOT
-affect the computational region for other GIS processes.
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-pan.gif"> Pan</DT>
-<DD>Interactive selection of a new center of view in the active display
-monitor. Drag the pan cursor while pressing the left mouse button to pan.
-Panning changes the location of the region displayed but not the size of
-the area displayed or the resolution. Panning does NOT affect the
-computational region for other GIS processes.
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-zoom_back.gif"> Revert zoom</DT>
-<DD>Returns to the previous zoom. Up to 5 levels of zoom back are maintained.
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-mapzoom.gif"> Zoom menu</DT>
-<DD>Automatic zoom settings menu. Zoom to match the extents of a selected
-map or to match the extents of a saved region; save the current extents
-to a named region file; zoom to match the computational region (set with
-<em>g.region</em>) or to match the default region; set computational region
-(the mapset's <tt>WIND</tt> file) to match the current display extents
-(does not change the resolution).
-<i>See <a href="g.region.html">g.region</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-query.gif"> Query tool (select a map first)</DT>
-<DD>Query selected raster (only the base map of a draped map will be
-queried), RGB raster map (all three map channels will be queried), or
-vector map using the mouse. A map must be selected before query.
-Vector charts and thematic vector maps cannot be queried. The
-results of the query will be displayed in the console window.
-<i>See <a href="r.what.html">r.what</a> and <a href="v.what.html">v.what</a></i>.
-</DD>
-
-<DT><img src="icons/grass/gui-measure.gif"> Distance measurement tool</DT>
-<DD>Interactive measurement of lengths defined with the mouse. The length
-of each segment and the cumulative length of all segments measuered is
-displayed in the console window. Lengths are measured in the current
-measurement unit.
-<i>See also <a href="d.measure.html">d.measure</a>.</i></DD>
-
-<DT><img src="icons/grass/gui-profile.gif"> Profile tool</DT>
-<DD>Interactively create profile of a raster map. Profile transect
-is drawn with the mouse in map display. The profile may be of the
-displayed map or a different map.<i>
-See the <a href="gm_profile.html">Profile Tool help page</a>.</i></DD>
-
-<DT><img src="icons/grass/file-print.gif"> Print map</DT>
-<DD>Prints map on the UNIX <i>lpr</i> printer or PostScript device;
-saves visible map display (including PostScript text and labels) to PDF
-or EPS file. Requires <tt>ghostscript</tt> for all output except EPS.</DD>
-
-<DT><img src="icons/grass/file-save.gif"> Export map display</DT>
-<DD>Exports visible map display to different raster graphic formats.
-Exported map does not include PostScript text or PostScript labels.</DD>
-
-<DT><img src="icons/grass/drawmode-strict.gif"> Strict draw mode</DT>
-<DD>Selects strict draw mode. In strict mode the aspect ratio and resolution
-from the last zoom are used when drawing the maps. The map will show only
-the area and resolution selected. It will not usually fill the screen.
-Strict mode only shows what is asked for.</DD>
-
-<DT><img src="icons/grass/drawmode-explore.gif"> Explore draw mode</DT>
-<DD>Selects explore draw mode. In explore mode the region from the last zoom
-is expanded to fill the entire screen. The resolution is adjusted to match
-the screen resolution. Explore mode shows as much as possible.</DD>
-
-</DL>
-
-
-<h2>CONFIGURATION</h2>
-
-<h3>Changing fonts</h3>
-
-Fonts used in <em>gis.m</em> can be changed as follows:
-<ul>
- <li>Runtime: edit file '<tt>$GISBASE/etc/gtcltk/options.tcl</tt>'</li>
- <li>Source code: edit file '<tt>lib/gtcltk/options.tcl</tt>' and recompile gtcltk</li>
-</ul>
-
-
-<h2>SEE ALSO</h2>
-
-The <em>gis.m</em> <a href="gm_animate.html">ANIMATION TOOL</a><br>
-The <em>gis.m</em> <a href="gm_georect.html">GEORECTIFY TOOL</a><br>
-The <em>gis.m</em> <a href="gm_profile.html">PROFILE TOOL</a><br>
-<P>
-<em><a href="g.gui.html">g.gui</a></em>: Starts the default GUI<BR>
-<a href="d.m.html"><em>d.m</em> GUI</a>: The old display manager GUI<BR>
-<a href="wxGUI.html">wxPython GUI</a>:
-  The next generation GUI, currently under development<BR>
-
-
-<h2>AUTHORS</h2>
-Michael Barton, Arizona State University, Tempe, Arizona, USA<br>
-Cedric Shock, USA
-
-<p>
-<i>Last changed: $Date$</i>

+ 0 - 543
gui/tcltk/gis.m/gm.tcl

@@ -1,543 +0,0 @@
-##########################################################################
-#
-# gm.tcl
-#
-# Primary tcltk script for GIS Manager: GUI for GRASS 6
-# Author: Michael Barton (Arizona State University)
-# Based in part on Display Manager for GRASS 5.7 by Radim Blazek (ITC-IRST)
-# and tcltkgrass for GRASS 5.7 by Michael Barton (Arizona State University)--
-# with contributions by Glynn Clements, Markus Neteler, Lorenzo Moretti,
-# Florian Goessmann, and others
-#
-# March 2006
-#
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-lappend auto_path $env(GISBASE)/bwidget
-
-package require -exact BWidget 1.2.1
-
-# Load up all the gis.m layers and things.
-# pkgIndex.tcl only loads the files when they are first called.
-lappend auto_path $env(GISBASE)/etc/gm
-package require -exact GisM 1.0
-
-# path to GIS Manager files
-set gmpath $env(GISBASE)/etc/gm
-
-# Load common procedure library
-source $gmpath/gmlib.tcl
-
-if {[catch {set env(GISDBASE) [exec g.gisenv get=GISDBASE]} error]} {
-	Gm::errmsg $error
-}
-if {[catch {set env(LOCATION_NAME) [exec g.gisenv get=LOCATION_NAME]} error]} {
-	Gm::errmsg $error
-}
-if {[catch {set env(MAPSET) [exec g.gisenv get=MAPSET]} error]} {
-	Gm::errmsg $error
-}
-
-if {[catch {set gisdbase [exec g.gisenv get=GISDBASE]} error]} {
-	Gm::errmsg $error
-}
-if {[catch {set location_name [exec g.gisenv get=LOCATION_NAME]} error]} {
-	Gm::errmsg $error
-}
-if {[catch {set mapset [exec g.gisenv get=MAPSET]} error]} {
-	Gm::errmsg $error
-}
-
-
-# path to icons for GIS Manager
-set iconpath $env(GISBASE)/etc/gui/icons/grass
-
-global iconpath
-global gmpath
-
-set keycontrol "Control"
-set tmenu "1"
-set keyctrl "Ctrl"
-set execom "execute"
-set msg 0
-set mon 1
-
-
-
-if {![catch {set env(HOSTTYPE)}]} {
-	set HOSTTYPE $env(HOSTTYPE)
-} else {
-	set HOSTTYPE ""
-}
-
-# add for OSX aqua
-if {[tk windowingsystem] == "aqua"} {
-    set osxaqua "1"
-} else {
-    set osxaqua "0"
-}
-
-if { $osxaqua == "1"} {
-    set keycontrol "Command"
-    set tmenu "0"
-    set keyctrl "Command"
-    set execom "spawn"
-}
-
-if {![catch {set env(OS)}] && $env(OS) == "Windows_NT"} {
-	set mingw "1"
-	set devnull "NUL:"
-} else {
-	set mingw "0"
-	set devnull "/dev/null"
-}
-
-
-#fetch GRASS Version number:
-catch {set fp [open $env(GISBASE)/etc/VERSIONNUMBER r]}
-set GRASSVERSION [read -nonewline $fp]
-
-if {[catch {close $fp} error]} {
-	Gm::errmsg $error
-}
-
-
-source $env(GISBASE)/etc/gui.tcl
-# gui.tcl also sources these:
-# $env(GISBASE)/etc/gtcltk/gmsg.tcl
-# $env(GISBASE)/etc/gtcltk/options.tcl
-# $env(GISBASE)/etc/gtcltk/select.tcl
-# $env(GISBASE)/etc/gtcltk/gronsole.tcl
-
-# Load a console user interface
-source $gmpath/runandoutput.tcl
-
-namespace eval Gm {
-	variable gm_mainframe
-	variable status
-	variable array tree ;# mon
-	variable rcfile
-	variable moncount
-	variable prgtext
-	variable mainwindow
-	variable dfont 
-	variable selectedfont
-	variable encoding
-	global array filename ;# mon
-
-}
-
-
-set Gm::prgtext ""
-global prgindic
-global max_prgindic
-
-set max_prgindic 20
-
-if { $tcl_platform(platform) == "windows" } {
-	append regexp .* $env(GISBASE) {[^;]*}
-	regsub -- $regexp $env(PATH) "&;$env(GISBASE)/etc/gui/scripts" env(PATH)
-} else {
-	append regexp .* $env(GISBASE) {[^:]*}
-	regsub -- $regexp $env(PATH) "&:$env(GISBASE)/etc/gui/scripts" env(PATH)
-}
-
-###############################################################################
-# Deprecated
-# Use guarantee_xmon and any run command instead.
-
-proc Gm::xmon { type cmd } {
-	guarantee_xmon
-
-	if { $type == "term" } {
-		term_panel $cmd
-	} else {
-		run_panel $cmd
-	}
-
-	return
-}
-
-###############################################################################
-
-
-proc Gm::create { } {
-	variable mainwindow
-	variable prgtext
-	variable gm_mainframe
-	variable tree
-	variable moncount
-	variable dfont
-	variable ecoding
-	global gmpath
-	global mon
-	global tree_pane
-	global options
-	global pgs
-	global prgindic
-	global keycontrol
-	global env
-	
-	# set display rendering environment for PNG/PPM output
-	set env(GRASS_RENDER_IMMEDIATE) "TRUE"
-	
-	# set default font
-	if {[catch {set env(GRASS_FONT)}]} {set env(GRASS_FONT) "romans"}
-	set Gm::dfont ""
-	set Gm::encoding "ISO-8859-1"
-
-	set moncount 1
-
-	set Gm::prgtext [G_msg "Loading GIS Manager"]
-	set prgindic -1
-	_create_intro
-	update
-
-	source $gmpath/gmmenu.tcl
-
-	set Gm::prgtext [G_msg "Creating MainFrame..."]
-    
-	set gm_mainframe [MainFrame .mainframe \
-		       -menu $descmenu \
-		       -textvariable Gm::status \
-		       -progressvar  Gm::prgindic ]
-
-	set mainwindow [$gm_mainframe getframe]
-    
-	# toolbar 1 & 2 creation
-	set tb1  [$gm_mainframe addtoolbar]
-	GmToolBar1::create $tb1
-	set tb2  [$gm_mainframe addtoolbar]
-	GmToolBar2::create $tb2
-	set pw1 [PanedWindow $mainwindow.pw1 -side left -pad 0 -width 10 ]
-    
-	# tree
-	set treemon [expr {$mon + 1}]
-	set tree_pane  [$pw1 add  -minsize 50 -weight 1]
-	    set pgs [PagesManager $tree_pane.pgs]
-    
-    
-	    pack $pgs -expand yes -fill both
-    
-    
-	# options
-	set options_pane  [$pw1 add -minsize 50 -weight 1]
-	set options_sw [ScrolledWindow $options_pane.sw -relief flat -borderwidth 1]
-	set options_sf [ScrollableFrame $options_sw.sf]
-	$options_sf configure -height 145 -width 460
-	$options_sw setwidget $options_sf
-	set options [$options_sf getframe]
-	pack $options_sw -fill both -expand yes
-    
-	# Scroll the options window with the mouse
-	bind_scroll $options_sf
-    
-	pack $pw1 -side top -expand yes -fill both -anchor n
-    
-	    # finish up
-	set Gm::prgtext [G_msg "Done"]
-    
-	set Gm::status [G_msg "Welcome to GRASS GIS"]
-	$gm_mainframe showstatusbar status
-    
-	pack $gm_mainframe -fill both -expand yes
-
-	Gm::startmon
-
-	bind .mainframe <Destroy> {
-		if {"%W" == ".mainframe"} {
-			Gm::cleanup}
-	}
-
-
-
-}
-
-
-###############################################################################
-
-# start new display monitor and increment canvas monitor number
-proc Gm::startmon { } {
-	variable mainwindow
-	variable moncount
-	variable tree
-	global mon
-
-	set mon $moncount
-	incr moncount 1
-
-	#create initial display canvas and layer tree
-	MapCanvas::create
-	GmTree::create $mon
-
-	wm title .mapcan($mon) [format [G_msg "Map Display %d"] $mon]
-	wm withdraw .mapcan($mon)
-	wm deiconify .mapcan($mon)
-}
-
-
-###############################################################################
-
-proc Gm::_create_intro { } {
-	variable prgtext
-    global gmpath
-    global GRASSVERSION
-    global location_name
-    global max_prgindic
-    global prg
-
-    set top [toplevel .intro -relief raised -borderwidth 2]
-
-    wm withdraw $top
-    wm overrideredirect $top 1
-
-    set ximg  [label $top.x -image [image create photo -file "$gmpath/intro.gif"] ]
-
-    set frame [frame $ximg.f -background white]
-    set lab1  [label $frame.lab1 \
-		-text [format [G_msg "GRASS%s GIS Manager - %s"] $GRASSVERSION $location_name] \
-		-background white -foreground black -font introfont]
-    set lab2  [label $frame.lab2 -textvariable Gm::prgtext -background white]
-    set prg   [ProgressBar $frame.prg -width 50 -height 15 -background white \
-		   -variable Gm::prgindic -maximum $max_prgindic]
-    pack $lab1 $prg -side left -fill both -expand yes
-    pack $lab2 -side right -expand yes
-    place $frame -x 0 -y 0 -anchor nw
-    pack $ximg
-    BWidget::place $top 0 0 center
-    wm deiconify $top
-}
-
-###############################################################################
-
-# nviz
-proc Gm::nviz { } {
-global osxaqua
-global HOSTTYPE
-
-    set cmd "nviz"
-	if { $HOSTTYPE == "macintosh" || $HOSTTYPE == "powermac" || $HOSTTYPE == "powerpc" || $HOSTTYPE == "intel-pc"} {
-		if { $osxaqua == "1"} {
-			spawn $cmd
-		} else {
-			term $cmd
-		}
-	} else {
-		spawn $cmd
-	}
-
-}
-
-###############################################################################
-
-# d.nviz: set up NVIZ flight path (not much use without a backdrop?)
-proc Gm::fly { } {
-
-    guarantee_xmon
-    exec d.nviz -i --ui &
-
-}
-
-###############################################################################
-
-# xganim
-proc Gm::xganim { } {
-
-    exec xganim --ui &
-
-}
-
-###############################################################################
-
-# help
-proc Gm::help { } {
-
-    set cmd [list g.manual --ui]
-    term $cmd
-
-}
-
-###############################################################################
-# sets default display font
-proc Gm::defaultfont { source } {
-	global env iconpath
-	variable dfont
-	variable selectedfont
-	variable encoding
-
-	# create a dialog with selector for stroke font and true type font, and
-	# text entry for character encoding
-
-    toplevel .dispfont
-    wm title .dispfont [G_msg "Select GRASS display font"]
-    
-    if {[catch {set fontlist [exec d.font --q -l]} error]} {
-	    Gm::errmsg $error "d.font error"
-    }
-    set fontlist [string trim $fontlist]
-    set fontlist [split $fontlist "\n"]
-    set fontlist [lsort -unique $fontlist]
-   
-    set row [ frame .dispfont.fontlb ]
-    Label $row.a -text [G_msg "Font: "] 
-    set fontlb [ listbox $row.b -bg white -width 30 \
-    	-yscrollcommand "$row.vscrollbar set"]
-
-    scrollbar $row.vscrollbar -width 12 \
-    	-command "$row.b yview" \
-    	-relief {sunken}
-
-    foreach item $fontlist {
-    	$fontlb insert end $item
-    }
-    # If $Gm::dfont is empty then it hasn't been set by a layer module
-    # before calling this procedure, so we should read the current
-    # default font from the GRASS_FONT environment variable
-    if {$Gm::dfont == ""} {    
-        if {![catch {set env(GRASS_FONT)}] && $env(GRASS_FONT) != ""} {
-    	    set Gm::dfont $env(GRASS_FONT)
-	    }
-    }
-    set selectedfont $Gm::dfont
-     
-    if {$Gm::dfont != ""} {
-    	set fontindex [lsearch $fontlist $Gm::dfont]
-    	if {$fontindex > -1} {
-    		$fontlb selection set $fontindex
-    		$fontlb see $fontindex
-    	}
-    }
-
-    pack $row.vscrollbar -side right -fill y
-    pack $row.b -side right
-    pack $row.a -side right -anchor n
-    pack $row -side top -fill both -expand yes -pady 3 -padx 5
-    
- 	set row [ frame .dispfont.fontopt3 ]
-    Label $row.a -text [G_msg "Character encoding: "] 
-    Entry $row.b -width 20 -text "$Gm::encoding" \
-	    -textvariable Gm::encoding
-    pack $row.b $row.a -side right -anchor e
-    pack $row -side top -fill both -expand yes -pady 3 -padx 5
-    
-	set row [ frame .dispfont.buttons ]
-	Button $row.ok -text [G_msg "OK"] -width 8 -bd 1 \
-			-command "Gm::setfont $source; destroy .dispfont"
-    pack $row.ok -side left -fill x -expand 0
-    button $row.cancel -text [G_msg "Cancel"] -width 8 -bd 1 \
-    	-command "destroy .dispfont"
-    pack $row.cancel -side right -fill x -expand 0
-    pack $row -side bottom -pady 3  -padx 5 -expand 0 -fill x 
-    
-    bind $fontlb <<ListboxSelect>> {
-    	set Gm::selectedfont [%W get [%W curselection]]
-    }   
-    
-};
-
-
-proc Gm::setfont { source } {
-	global env
-	variable dfont
-	variable selectedfont
-	variable encoding
-
-	# Set GRASS environmental variables for default display font and
-	# character encoding
-	
-	if { $encoding != "" && $encoding != "ISO-8859-1"} {
-		set env(GRASS_ENCODING) $encoding
-	}
-
-	set dfont $selectedfont
-    
-	if { $source == "menu" && $dfont != "" } {
-		set env(GRASS_FONT) $dfont
-		set dfont ""
-	}
-
-};
-
-###############################################################################
-
-proc Gm::cleanup { } {
-	global mon
-	global tmpdir
-	global legfile
-	variable moncount
-	
-	set mappid $MapCanvas::mappid
-	
-	# delete all map display ppm files
-	cd $tmpdir
-	set deletefile $mappid
-	append deletefile ".*"
-	foreach file [glob -nocomplain $deletefile] {
-		catch {file delete $file}
-	}
-
-	if {[info exists legfile] && [file exists $legfile]} {catch {file delete -force $legfile}}
-
-	unset mon
-
-};
-
-###############################################################################
-
-proc main {argc argv} {
-    variable gm_mainframe
-    global auto_path
-    global GRASSVERSION
-    global location_name
-    global mapset
-    global keycontrol
-    global filename
-    global mon
-
-    wm withdraw .
-    wm title . [format [G_msg "GRASS%s GIS Manager - %s %s"] $GRASSVERSION $location_name $mapset]
-
-    bind . <$keycontrol-Key-o> {
-		Gm::OpenFileBox
-    }
-    bind . <$keycontrol-Key-n> {
-		GmTree::new
-    }
-    bind . <$keycontrol-Key-s> {
-		Gm::SaveFileBox
-    }
-    bind . <$keycontrol-Key-q> {
-		exit
-	}
-    bind . <$keycontrol-Key-w> {
-		GmTree::FileClose {}
-    }
-
-    Gm::create
-    BWidget::place . 0 0 at 400 100
-
-    wm deiconify .
-    raise .mainframe
-    focus -force .
-    destroy .intro
-    
-    if { $argc > 1 } {
-    	foreach i $argv {
-    		if { [regexp -- {\.grc$} $i] || [regexp -- {\.dmrc$} $i] || [regexp -- {\.dm$} $i] } { 
-			set filename($mon) [lindex $argv 0]
-			GmTree::load $filename($mon)
-    		}
-    	}
-    }
-}
-
-
-main $argc $argv
-wm geom . [wm geom .]
-

+ 0 - 82
gui/tcltk/gis.m/gm_profile.html

@@ -1,82 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>gis.m: PROFILE TOOL</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<link rel="stylesheet" href="grassdocs.css" type="text/css">
-</head>
-<body bgcolor="white">
-
-<h2>PROFILE TOOL (gis.m)</h2>
-
-The Profile Tool will draw a 2-dimensional profile of the surface of
-any raster map. The profile will be calculated along a transect line, drawn
-with  a mouse on a map display. The transect line can be a
-simple line (i.e., with only a beginning and ending node) or a complex
-polyline (i.e., with multiple segments, delineated by multiple nodes).
-<br>
-
-<h3>Using the Profile Tool</h3>
-
-The Profile Tool is started from profile button
- <img alt="" src="icons/grass/gui-profile.gif"> on the toolbar of an active
-map display.
-<br>
-<br>
-<div align="center"><img src="gm_profile1.png" alt="" align="top" height="264" width="400">
-<BR><BR>
-<img src="gm_profile2.png" alt="" height="422" width="480">
-</div>
-
-<ol>
-<li>Click the map button on the Profile Tool toolbar to select a raster map
-to profile. The map to profile can be different from the one displayed.
-</li>
-<li>
-Click the transect button to begin drawing a transect to profile with a mouse
-the current map display (i.e., the map display from which you launched the
-Profile Tool). Draw by holding down the left button to make a
-"rubber-band" line for each segment of the transect. A transect can
-have a single, straight segment or multiple segment. There is no need
-to "end" the drawing. The Profile Tool will profile the drawn transect
-at any time. You can also  extend an existing transect and
-draw a profile of the new transect.
-</li>
-<li>Click the profile button to create the profile.
-</li>
-</ol>
-
-<div align="center"><img src="gm_profile3.png" alt="" height="264" width="400">
-<br>
-</div>
-<br>
-The profile extends from left to right in the profile display. The
-horizontal (x-axis) scale represents the total distance along the
-transect to be profiled. Vertical lines mark each node on a
-multi-segment transect and show the total distance along the transect
-to the node. The vertical (y-axis) scale is in units of the map that is
-being profiled. All scaling and axis labels are created automatically,
-and cannot be changed by the user.<br><br>The erase button will erase the
-current transect and profile.
-<br>
-<br>
-The save button will save the profile to an EPS format file
-<br>
-
-
-<h2>SEE ALSO</h2>
-<em>
-<a href="gis.m.html">gis.m</a><br>
-<a href="r.transect.html">r.transect</a><br>
-<a href="i.rectify.html"><br></a><a href="v.proj.html"></a>
-</em>
-
-<h2>AUTHORS</h2>
-Michael Barton, Arizona State University, Tempe, Arizona, USA<br>
-Hamish Bowman, University of Otago, Dunedin, New Zealand
-
-<p><i>Last changed: $Date$</i></p>
-<hr>
-<p><a href="index.html">Main index</a> - <a href="full_index.html">Full index</a></p>
-</body>
-</html>

+ 0 - 143
gui/tcltk/gis.m/gmlib.tcl

@@ -1,143 +0,0 @@
-##########################################################################
-#
-# gmlib.tcl
-#
-# Procedures library for GIS Manager: GUI for GRASS 6
-# Author: Michael Barton (Arizona State University)
-# with contributions by Glynn Clements, Markus Neteler, Lorenzo Moretti,
-# Florian Goessmann, and others
-#
-# January 2008
-#
-# COPYRIGHT:	(C) 1999 - 2008 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-
-namespace eval GmLib {
-	global array filename ;# mon
-
-}
-
-
-###############################################################################
-#read_moncap
-
-proc GmLib::color { color } {
-        
-        if {$color == "white"} {
-                set r 255
-                set g 255
-                set b 255
-        } else {
-                regexp -- {#(..)(..)(..)} $color x r g b
-                        
-                set r [expr 0x$r ]
-                set g [expr 0x$g ]
-                set b [expr 0x$b ]
-        }
-        
-        return "$r:$g:$b"
-}
-
-
-###############################################################################
-# Deprecated
-# Use guarantee_xmon and any run command instead.
-
-proc GmLib::xmon { type cmd } {
-	guarantee_xmon
-
-	if { $type == "term" } {
-		term_panel $cmd
-	} else {
-		run_panel $cmd
-	}
-
-	return
-}
-
-###############################################################################
-# Determine if an element already exists
-
-proc GmLib::element_exists {elem name} {
-	global devnull
-	set exists 1
-	
-	set failure [catch {exec g.findfile element=$elem file=$name >& $devnull}]
-
-	return [expr {! $failure}]
-}
-
-###############################################################################
-
-#open dialog box
-proc GmLib::OpenFileBox { } {
-	global filename
-	global mon
-
-	# thanks for brace tip to suchenwi from #tcl@freenode
-	set types [list \
-		[list [G_msg "Map Resource File"] [list ".dm" ".dmrc" ".grc"]] \
-		[list [G_msg "All Files"] "*"] \
-	]
-
-	set filename_new [tk_getOpenFile -parent $Gm::mainwindow -filetypes $types \
-		-title [G_msg "Open File"] ]
-	if { $filename_new == "" } { return}
-	set filename($mon) $filename_new
-	GmTree::load $filename($mon)
-
-};
-
-###############################################################################
-
-#save dialog box
-proc GmLib::SaveFileBox { } {
-	global filename
-	global mon
-    
-	catch {
-		if {[ regexp -- {^Untitled_} $filename($mon) r]} {
-		    set filename($mon) ""
-		}
-	}
-    
-	if { $filename($mon) != "" } {
-	    GmTree::save $filename($mon)
-	} else {
-		set types [list \
-		    [list [G_msg "Map Resource File"] {.grc}] \
-		    [list [G_msg "DM Resource File"] [list {.dm} {.dmrc}]] \
-		    [list [G_msg "All Files"] "*"] \
-		]
-		set filename($mon) [tk_getSaveFile -parent $Gm::mainwindow -filetypes $types \
-		    -title [G_msg "Save File"] -defaultextension .grc]
-		    if { $filename($mon) == "" } { return}
-		    GmTree::save $filename($mon)
-	}
-};
-
-###############################################################################
-
-proc GmLib::errmsg { error args } {
-	# send error report and optional message (args) to tk_messageBox
-	
-	set message ""
-	
-	if { $args != ""} { 
-	    set message [join $args]
-	    append message ": " 
-	 }
-    
-	tk_messageBox -type ok -icon error -title [G_msg "Error"] \
-	    -message "$message[G_msg $error]"
-	uplevel 1 return
-     
-};
-
-

+ 0 - 655
gui/tcltk/gis.m/gmmenu.tcl

@@ -1,655 +0,0 @@
-###############################################################
-# 	File:		gmmenu.tcl
-#	Purpose:	menu file for GRASS GIS Manager
-#	Author:		Michael Barton, Arizona State University
-#				Based originally on menu for d.m and tcltkgrass
-#				Additions by Cedrick Shock and Benjamin Ducke
-# 	COPYRIGHT:	(C) 2006-2007 by the GRASS Development Team
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-###############################################################
-
-# our job is simply to make a variable called descmenu
-
-#source "$env(GISBASE)/etc/gui/menus/menu.tcl"
-
-
-global execom 
-global mon
-global filename
-global devnull
-
-# Tear off menus (yes / no)
-global tmenu
-# Key to use for control (for menu accelerators)
-global keyctrl
-# The environment
-global env
-
-
-
-set XtnsMenu "False"
-set pathlist {}
-set menulist {}
-set menudatlist {}
-
-# Check for existence of xtnmenu.dat file and parse it
-# into an extensions menu
-
-lappend menudatlist "$env(GISBASE)/etc/xtnmenu.dat"
-if {[info exists env(GRASS_ADDON_ETC)]} {
-    set pathlist [split $env(GRASS_ADDON_ETC) ":"]
-    foreach path $pathlist {
-        lappend menudatlist "$path/xtnmenu.dat"
-    }
-}
-
-foreach menudat $menudatlist {
-    if {[file exists $menudat]} {	
-        if { [lsearch $menudatlist $menudat] > 0} {lappend menulist "separator"}
-        if {![catch {open $menudat r} menudef]} {
-            while {[gets $menudef menuline] >= 0} {
-                set menuline [string trim $menuline]
-                if {[string first # $menuline] == 0 } {
-                    continue}
-                set menuline [split $menuline ":"]
-                set menulevel [lindex $menuline 0]
-                set menuitem [G_msg [lindex $menuline 1]]
-                set menucmd "execute "
-                append menucmd [lindex $menuline 2]
-                set menuhelp [G_msg [lindex $menuline 3]]
-                # add if statement to read comments here
-                if {$menuitem == "separator"} {
-                    lappend menulist "separator"
-                } else { 
-                    set line [list command $menuitem {} \
-                        $menuhelp {} -command $menucmd]
-    
-                    lappend menulist $line
-                }
-            }
-            if {[catch {close $menudef} error]} {
-                GmLib::errmsg $error ["Error reading xtnmenu.dat file"]
-            }
-        }
-        set XtnsMenu "True"
-    }
-    
-}
-		
-
-# This is the menu. 
-
-set descmenu [subst  {
- {[G_msg "&File"]} all file $tmenu {
-	{cascad {[G_msg "Workspace"]} {} "" $tmenu {			
-		{command {[G_msg "Open..."]} {} "Open gis.m workspace file" {} -accelerator $keyctrl-O -command { GmLib::OpenFileBox }}
-		{command {[G_msg "Save"]} {} "Save gis.m workspace file" {} -accelerator $keyctrl-S -command { GmLib::SaveFileBox }}
-		{command {[G_msg "Save as..."]} {} "Save gis.m workspace file as new name" {} -command { set filename($mon) "" ; GmLib::SaveFileBox }}
-		{command {[G_msg "Close"]} {} "Close gis.m workspace" {} -accelerator $keyctrl-W -command { GmTree::FileClose {}}}
-	}}
-	{separator}
-	{cascad {[G_msg "Import raster map"]} {} "" $tmenu {
-		{command {[G_msg "Multiple formats using GDAL"]} {} "r.in.gdal: Import multiple formats using GDAL" {} -command { execute r.in.gdal }}
-		{separator}
-		{command {[G_msg "Aggregate ASCII xyz"]} {} "r.in.xyz: Import aggregate ASCII xyz data into raster grid" {} -command { execute r.in.xyz }}
-		{command {[G_msg "ASCII grid"]} {} "r.in.ascii: Import ASCII grid (includes GRASS ASCII)" {} -command { execute r.in.ascii }}
-		{command {[G_msg "ASCII polygons and lines"]} {} "r.in.poly: Import polygons and lines from ASCII file" {} -command { execute r.in.poly }}
-		{separator}
-		{command {[G_msg "Binary"]} {} "r.in.bin: Import binary file (includes GTOPO30 format)" {} -command { execute r.in.bin }}
-		{command {[G_msg "ESRI grid"]} {} "r.in.arc: Import ESRI Arc/Info ASCII grid" {} -command { execute r.in.arc }}
-		{command {[G_msg "GRIDATB.FOR"]} {} "r.in.gridatbk: Import GRIDATB.FOR map file (TOPMODEL)" {} -command { execute r.in.gridatb }}
-		{command {[G_msg "MAT-File (v.4)"]} {} "r.in.mat: Import MAT-File (v.4) array (Matlab or Octave)" {} -command { execute r.in.mat }}
-		{command {[G_msg "SPOT NDVI"]} {} "i.in.spotvgt: Import SPOT vegetation NDVI data sets" {} -command { execute i.in.spotvgt }}
-		{command {[G_msg "SRTM hgt"]} {} "r.in.srtm: Import SRTM hgt files" {} -command { execute r.in.srtm }}
-		{command {[G_msg "Terra ASTER"]} {} "r.in.aster: Import Terra ASTER HDF files" {} -command { execute r.in.aster }}
-		{separator}
-		{command {[G_msg "Web Mapping Server"]} {} "r.in.wms: Import Web Mapping Server files" {} -command { execute r.in.wms }}
-	}}
-	{cascad {[G_msg "Import vector map"]} {} "" $tmenu {			
-		{command {[G_msg "Multiple formats using OGR"]} {} "v.in.ogr: Import multiple formats using OGR" {} -command { execute v.in.ogr }}
-		{separator}
-		{command {[G_msg "ASCII points or GRASS ASCII vector"]} {} "v.in.ascii: Import ASCII points file or GRASS ASCII vector file" {} -command { execute v.in.ascii }}
-		{command {[G_msg "Old GRASS vector"]} {} "v.convert: Import old GRASS vector format" {} -command { execute v.convert }}
-		{separator}
-		{command {[G_msg "DXF"]} {} "v.in.dxf: Import DXF file" {} -command { execute v.in.dxf }}
-		{command {[G_msg "ESRI e00"]} {} "v.in.e00: Import ESRI e00 format" {} -command { execute v.in.e00 }}
-		{command {[G_msg "Garmin GPS"]} {} "v.in.garmin: Import Garmin GPS waypoints/routes/tracks" {} -command { execute v.in.garmin }}
-		{command {[G_msg "GPSBabel GPS"]} {} "v.in.gpsbabel: Import GPS waypoints/routes/tracks using GPSBabel" {} -command { execute v.in.gpsbabel }}
-		{command {[G_msg "GEOnet"]} {} "v.in.gns: Import GEOnet Name server country files (US-NGA GNS)" {} -command { execute v.in.gns }}
-		{command {[G_msg "Matlab and MapGen"]} {} "v.in.mapgen: Import Matlab and MapGen files" {} -command { execute v.in.mapgen }}
-	}}
-	{cascad {[G_msg "Import grid 3D volume"]} {} "" $tmenu {			
-		{command {[G_msg "ASCII 3D"]} {} "r3.in.ascii: Import ASCII 3D file" {} -command { execute r3.in.ascii }}
-		{command {[G_msg "Vis5D"]} {} "r3.in.v5d: Import Vis5D file" {} -command { execute r3.in.v5d }}
-	}}
-	{separator}
-	{cascad {[G_msg "Export raster map"]} {} "" $tmenu {
-		{command {[G_msg "Multiple formats using GDAL"]} {} "r.out.gdal: Export multiple formats using GDAL" {} -command { execute r.out.gdal }}
-		{separator}
-		{command {[G_msg "ASCII grid"]} {} "r.out.ascii: Export ASCII grid (for GRASS, Surfer, Modflow, etc)" {} -command { execute r.out.ascii }}
-		{command {[G_msg "ASCII x,y,z"]} {} "r.out.xyz: Export ASCII x,y,z values of cell centers" {} -command { execute r.out.xyz }}
-		{separator}
-		{command {[G_msg "ESRI ASCII grid"]} {} "r.out.arc" {} -command { execute r.out.arc }}
-		{command {[G_msg "GRIDATB.FOR"]} {} "r.out.gridatb: Export GRIDATB.FOR map file (TOPMODEL)" {} -command { execute r.out.gridatb }}
-		{command {[G_msg "MAT-File (v.4)"]} {} "r.out.mat: Export MAT-File (v.4) array (Matlab or Octave)" {} -command { execute r.out.mat }}
-		{separator}
-		{command {[G_msg "Binary"]} {} "r.out.bin: Export binary file" {} -command { execute r.out.bin }}
-		{separator}
-		{command {[G_msg "MPEG-1"]} {} "r.out.mpeg: Export MPEG-1 animations" {} -command { execute r.out.mpeg }}
-		{command {[G_msg "PNG"]} {} "r.out.png: Export PNG image (not georeferenced)" {} -command { execute r.out.png }}
-		{command {[G_msg "PPM"]} {} "r.out.ppm: Export PPM image (24bit)" {} -command { execute r.out.ppm }}
-		{command {[G_msg "PPM from RGB"]} {} "r.out.ppm3: Export PPM image from red, green, blue raster maps" {} -command { execute r.out.ppm3 }}
-		{command {[G_msg "POV-Ray"]} {} "r.out.pov: Export POV-Ray height-field" {} -command { execute r.out.pov }}
-		{command {[G_msg "TIFF"]} {} "r.out.tiff: Export TIFF image (8/24bit)" {} -command { execute r.out.tiff }}
-		{command {[G_msg "VRML"]} {} "r.out.vrml: Export VRML file" {} -command { execute r.out.vrml }}
-		{command {[G_msg "VTK"]} {} "r.out.vtk: Export VTK ASCII file" {} -command { execute r.out.vtk }}
-	}}
-	{cascad {[G_msg "Export vector map"]} {} "" $tmenu {			
-		{command {[G_msg "Multiple formats using OGR"]} {} "v.out.ogr: Export multiple formats using OGR (SHAPE, MapInfo etc)" {} -command { execute v.out.ogr }}
-		{separator}
-		{command {[G_msg "ASCII points or GRASS ASCII vector"]} {} "v.out.ascii: Export ASCII vector or point file/old GRASS ASCII vector file" {} -command { execute v.out.ascii }}
-		{command {[G_msg "DXF"]} {} "v.out.dxf: Export DXF file (ASCII)" {} -command { execute v.out.dxf }}
-		{command {[G_msg "POV-Ray"]} {} "v.out.pov: Export POV-Ray format" {} -command { execute v.out.pov }}
-		{command {[G_msg "SVG"]} {} "v.out.svg: Export SVG file" {} -command { execute v.out.svg }}
-		{command {[G_msg "VTK"]} {} "v.out.vtk: Export VTK ASCII file" {} -command { execute v.out.vtk }}
-	}}
-	{cascad {[G_msg "Export grid 3D volume"]} {} "" $tmenu {
-		{command {[G_msg "ASCII 3D"]} {} "r3.out.ascii: Export ASCII 3D file" {} -command { execute r3.out.ascii }}
-		{command {[G_msg "Vis5D"]} {} "r3.out.v5d: Export Vis5D file" {} -command { execute r3.out.v5d }}
-		{command {[G_msg "VTK"]} {} "r3.out.vtk: Export VTK ASCII file" {} -command { execute r3.out.vtk }}
-		}}
-	{separator}
-	{cascad {[G_msg "Manage maps and volumes"]} {} "" $tmenu {
-		{command {[G_msg "Copy"]} {} "g.copy: Copy maps" {} -command {execute g.copy }}
-		{separator}
-		{command {[G_msg "List"]} {} "g.list: List maps" {} -command {execute g.list}}
-		{command {[G_msg "List filtered"]} {} "g.mlist: List maps using expressions and 'wildcards'" {} -command {execute g.mlist }}
-		{separator}
-		{command {[G_msg "Rename"]} {} "g.rename: Rename maps" {} -command {execute g.rename }}
-		{separator}
-		{command {[G_msg "Delete"]} {} "g.remove: Delete maps" {} -command {execute g.remove }}
-		{command {[G_msg "Delete filtered"]} {} "g.mremove: Delete maps using expressions and 'wildcards'" {} -command {execute g.mremove }}
-	}}
-	{cascad {[G_msg "Map type conversions"]} {} "" $tmenu {
-		{command {[G_msg "Raster to vector"]} {} "r.to.vect: Convert aster to vector map" {} -command {execute r.to.vect }}
-		{command {[G_msg "Raster series to volume"]} {} "r.to.rast3: Convert raster map series to volume" {} -command {execute r.to.rast3 }}
-		{command {[G_msg "Raster 2.5D to volume"]} {} "r.to.rast3elev: Convert raster 2.5D map to volume" {} -command {execute r.to.rast3elev }}
-		{separator}
-		{command {[G_msg "Vector to raster"]} {} "v.to.rast: Convert vector to raster map" {} -command {execute v.to.rast }}
-		{command {[G_msg "Vector to volume"]} {} "v.to.rast3: Convert vector 3D points to volume voxels" {} -command {execute v.to.rast3 }}
-		{command {[G_msg "Sites to vector"]} {} "v.in.sites: Convert GRASS 5 sites to vector points" {} -command {execute v.in.sites }}
-		{separator}
-		{command {[G_msg "Volume to raster series"]} {} "r3.to.rast: Convert volume to raster map series" {} -command {execute r3.to.rast }}
-	}}
-	{separator}
-	{command {[G_msg "Georectify"]} {} "Georectify raster map in XY location" {} -command { GRMap::startup }}
-	{separator}
-	{command {[G_msg "Animate raster maps"]} {} "Display a series of raster maps as an animation" {} -command { GmAnim::main }}
-	{separator}
-	{command {[G_msg "Bearing/distance to coordinates"]} {} "m.cogo: Convert between bearing/distance and coordinates" {} -command { execute m.cogo }}
-	{separator}
-	{cascad {[G_msg "3D rendering"]} {} "" $tmenu {
-		{command {[G_msg "NVIZ"]} {} "nviz: Launch N-dimensional visualization" {} -command {execute nviz }}
-		{command {[G_msg "NVIZ fly through path"]} {} "d.nviz: Create a fly-through path for NVIZ (requires xterm for interactive path creation)" {} -command {execute d.nviz }}
-	}}
-	{command {[G_msg "PostScript plot"]} {} "ps.map: Create cartographic PostScript plot" {} -command { execute ps.map }}
-	{separator}
-	{command {[G_msg "E&xit"]} {} "Exit GIS Manager" {} -accelerator $keyctrl-Q -command { exit } }
- }
- {[G_msg "&Config"]} all options $tmenu {
-	{cascad {[G_msg "Region"]} {} "" $tmenu {
-		{command {[G_msg "Display region settings"]} {} "g.region -p: Display region settings" {} -command {run_panel "g.region -p" }}
-		{command {[G_msg "Change region settings"]} {} "g.region: " {} -command {execute g.region }}
-	}}
-	{cascad {[G_msg "GRASS working environment"]} {} "" $tmenu {			
-		{command {[G_msg "Mapset access"]} {} "g.mapsets.tcl: Access other mapsets in current location" {} -command {exec $env(GRASS_WISH) $env(GISBASE)/etc/g.mapsets.tcl --tcltk &}}
-		{command {[G_msg "Change working environment"]} {} "g.mapset: Change current working session to new mapset, location, or GISDBASE" {} -command {execute g.mapset }}
-		{command {[G_msg "User access"]} {} "g.access: Modify access by other users to current mapset" {} -command {execute g.access }}
-		{command {[G_msg "Show settings"]} {} "g.gisenv: Show current GRASS environment settings" {} -command {run_panel g.gisenv }}
-		{command {[G_msg "Change settings"]} {} "g.gisenv: Set GRASS environment settings" {} -command {execute g.gisenv }}
-		{command {[G_msg "Show current GRASS version"]} {} "g.version -c: Show current GRASS version" {} -command {run_panel "g.version -c" }}
-	}}
-	{cascad {[G_msg "Manage projections"]} {} "" $tmenu {
-		{command {[G_msg "Manage projections"]} {} "g.proj: Show projection information and create projection files" {} -command {execute g.proj }}
-		{command {[G_msg "Projection for current location"]} {} "g.setproj: Create/edit projection information for current location" {} -command {term g.setproj }}
-		{separator}
-		{command {[G_msg "Convert coordinates"]} {} "m.proj: Convert coordinates from one projection to another" {} -command {execute m.proj }}
-	}}
-	{command {[G_msg "Display font"]} {} "Set default display font" {} -command {Gm::defaultfont "menu" }}
- } 
- {[G_msg "&Raster"]} all options $tmenu {
-	{cascad {[G_msg "Develop map"]} {} "" $tmenu {			
-		{command {[G_msg "Digitize raster"]} {} "r.digit" {} -command {
-			unset env(GRASS_RENDER_IMMEDIATE)
-			guarantee_xmon
-			term r.digit 
-			set env(GRASS_RENDER_IMMEDIATE) "TRUE"}}
-		{separator}
-		{command {[G_msg "Compress/decompress"]} {} "r.compress: Compress/decompress raster file" {} -command {execute r.compress }}
-		{separator}
-		{command {[G_msg "Boundaries"]} {} "r.region: Manage boundary definitions" {} -command {execute r.region }}
-		{command {[G_msg "Null values"]} {} "r.null:Manage null values" {} -command {execute r.null }}
-		{command {[G_msg "Quantization"]} {} "r.quant: Quantization for floating-point maps" {} -command {execute r.quant }}
-		{command {[G_msg "Timestamps"]} {} "r.timestamp: Manage timestamps for files" {} -command {execute r.timestamp }}
-		{separator}
-		{command {[G_msg "Resample using aggregate statistics"]} {} "r.resamp.stats: Resample (change resolution) using aggregate statistics sing regularized spline tension" {} -command {execute r.resamp.stats }}
-		{command {[G_msg "Resample using multiple methods"]} {} "r.resamp.interp: Resample (change resolution) using nearest neighbor, bilinear, or bicubic interpolation" {} -command {execute r.resamp.interp }}
-		{command {[G_msg "Resample using nearest neighbor"]} {} "r.resample: Resample (change resolution) using nearest neighbor interpolation" {} -command {execute r.resample }}
-		{command {[G_msg "Resample using spline tension"]} {} "r.resamp.rst: Resample (change resolution)" {} -command {execute r.resamp.rst }}
-		{separator}
-		{command {[G_msg "Support file maintenance"]} {} "r.support: Support file maintenance" {} -command {term r.support }}
-		{command {[G_msg "Update map statistics"]} {} "r.support.stats: Update map statistics" {} -command {execute r.support.stats }}
-		{separator}
-		{command {[G_msg "Reproject"]} {} "r.proj: Reproject raster from other location" {} -command {execute r.proj }}
-		{command {[G_msg "Tiling"]} {} "r.tileset: Generate tiling for other projection" {} -command {execute r.tileset }}
-	}}
-	{cascad {[G_msg "Manage map colors"]} {} "" $tmenu {			
-		{command {[G_msg "Color tables"]} {} "r.colors: Set colors to predefined color tables or from another raster map" {} -command {execute r.colors }}
-		{command {[G_msg "Color rules"]} {} "Set colors interactively by entering color rules" {} -command {GmRules::main "r.colors" }}
-		{separator}
-		{command {[G_msg "Blend"]} {} "r.blend: Blend 2 color maps to produce 3 RGB files" {} -command {execute r.blend }}
-		{command {[G_msg "Create RGB"]} {} "r.composite: Create color image from RGB files" {} -command {execute r.composite }}
-		{command {[G_msg "HIS to RGB"]} {} "r.his: Create 3 RGB (red, green, blue) maps from 3 HIS (hue, intensity, saturation) maps" {} -command {execute r.his }}
-	}}
-	{separator}
-	{command {[G_msg "Query by coordinate(s)"]} {} "r.what: Query by coordinate(s)" {} -command { execute r.what }}
-	{separator}
-	{command {[G_msg "Buffers"]} {} "r.buffer: Create raster buffers" {} -command { execute r.buffer }}
-	{command {[G_msg "Closest points"]} {} "r.distance: Locate closest points between areas in 2 raster maps" {} -command { execute r.distance }}
-	{command {[G_msg "MASK"]} {} "r.mask: Create raster MASK (defines map areas for GIS operations)" {} -command { execute r.mask }}
-	{command {[G_msg "Map calculator"]} {} "r.mapcalculator: Map calculator" {} -command { execute r.mapcalculator }}
-	{cascad  {[G_msg "Neighborhood analysis"]} {} "" $tmenu {			
-		{command {[G_msg "Moving window"]} {} "r.neighbors: Moving window analysis of raster cells" {} -command { execute r.neighbors }}
-		{command {[G_msg "Neighborhood points"]} {} "v.neighbors: Analyze vector points in neighborhood of raster cells" {} -command { execute v.neighbors }}
-	}}
-	{cascad {[G_msg "Overlay maps"]} {} "" $tmenu {			
-		{command {[G_msg "Cross product"]} {} "r.cross: Cross product" {} -command {execute r.cross }}
-		{command {[G_msg "Map series"]} {} "r.series: Function of map series (time series)" {} -command {execute r.series }}
-		{command {[G_msg "Patch maps"]} {} "r.patch: Patch maps" {} -command {execute r.patch }}
-		{separator}
-		{command {[G_msg "Statistical overlay"]} {} "r.statistics: Statistical calculations for cover map over base map" {} -command {execute r.statistics }}
-	}}
-	{cascad {[G_msg "Solar radiance and shadows"]} {} "" $tmenu {			
-		{command {[G_msg "Solar irradiance irradiation"]} {} "r.sun: Solar irradiance and daily irradiation" {} -command {execute r.sun }}
-		{command {[G_msg "Shadows map"]} {} "r.sunmask: Shadows map for sun position or date/time" {} -command {execute r.sunmask }}
-	}}
-	{cascad {[G_msg "Terrain analysis"]} {} "" $tmenu {			
-		{command {[G_msg "Cumulative movement costs"]} {} "r.walk: Calculate cumulative movement costs between locales" {} -command {execute r.walk }}
-		{command {[G_msg "Cost surface"]} {} "r.cost: Cost surface" {} -command {execute r.cost }}
-		{command {[G_msg "Least cost route or flow"]} {} "r.drain: Least cost route or flow" {} -command {execute r.drain }}
-		{separator}
-		{command {[G_msg "Shaded relief"]} {} "r.shaded.relief: Shaded relief map" {} -command {execute r.shaded.relief }}
-		{separator}
-		{command {[G_msg "Slope and aspect"]} {} "r.slope.aspect: Slope and aspect" {} -command {execute r.slope.aspect }}
-		{command {[G_msg "Terrain parameters"]} {} "r.param.scale: Terrain parameters" {} -command {execute r.param.scale }}
-		{command {[G_msg "Textural features"]} {} "r.texture: Textural features" {} -command {execute r.texture }}
-		{separator}
-		{command {[G_msg "Visibility"]} {} "r.los: Visibility/line of sight" {} -command {execute r.los }}
-	}}
-	{cascad {[G_msg "Transform features"]} {} "" $tmenu {			
-		{command {[G_msg "Clump"]} {} "r.clump: Clump small areas (statistics calculated by r.volume)" {} -command {execute r.clump }}
-		{command {[G_msg "Grow"]} {} "r.grow: Grow areas" {} -command {execute r.grow }}
-		{command {[G_msg "Thin"]} {} "r.thin: Thin linear features" {} -command {execute r.thin }}
-	}}
-	{separator}
-	{cascad {[G_msg "Hydrologic modeling"]} {} "" $tmenu {			
-		{command {[G_msg "Carve stream channels"]} {} "r.carve: Carve stream channels into elevation map using vector streams map" {} -command {execute r.carve }}
-		{command {[G_msg "Fill lake"]} {} "r.lake: Fill lake from seed point to specified level" {} -command {execute r.lake }}
-		{separator}
-		{command {[G_msg "Depressionless map and flowlines"]} {} "r.fill.dir: Depressionless elevation map and flowline map" {} -command {execute r.fill.dir }}
-		{command {[G_msg "Flow accumulation"]} {} "r.terraflow: Flow accumulation for massive grids" {} -command {execute r.terraflow }}
-		{command {[G_msg "Flow lines"]} {} "r.flow: " {} -command {execute r.flow }}
-		{separator}
-	    {command {[G_msg "Groundwater flow model"]} {} "r.gwflow: 2D groundwater flow model" {} -command {execute r.gwflow }}
-		{separator}
-		{command {[G_msg "SIMWE overland flow modeling"]} {} "r.sim.water: SIMWE overland flow modeling" {} -command {execute r.sim.water }}
-		{command {[G_msg "SIMWE sediment flux modeling"]} {} "r.sim.sediment: SIMWE sediment erosion, transport, & deposition modeling" {} -command {execute r.sim.sediment }}
-		{separator}
-		{command {[G_msg "Topographic index map"]} {} "r.topidx: Topographic index map" {} -command {execute r.topidx }}
-		{command {[G_msg "TOPMODEL simulation"]} {} "r.topmodel: TOPMODEL simulation" {} -command {execute r.topmodel }}
-		{separator}
-		{command {[G_msg "USLE K Factor"]} {} "r.uslek: Soil Erodibility" {} -command {execute r.uslek }}
-		{command {[G_msg "USLE R Factor"]} {} "r.usler: Rainfall Erosivity" {} -command {execute r.usler }}
-		{separator}
-		{command {[G_msg "Watershed subbasins"]} {} "r.basins.fill: Watershed subbasins" {} -command {execute r.basins.fill }}
-		{command {[G_msg "Watershed analysis"]} {} "r.watershed: Watershed analysis" {} -command {execute r.watershed }}
-		{command {[G_msg "Watershed basin creation"]} {} "r.water.outlet: Watershed basin creation" {} -command {execute r.water.outlet }}
-	}}
-	{cascad {[G_msg "Landscape structure modeling"]} {} "" $tmenu {			
-		{command {[G_msg "Set up"]} {} "r.le.setup: Set up sampling and analysis framework" {} -command {
-			unset env(GRASS_RENDER_IMMEDIATE)
-			guarantee_xmon
-			term r.le.setup 
-			set env(GRASS_RENDER_IMMEDIATE) "TRUE"}}
-		{separator}
-		{command {[G_msg "Analyze landscape"]} {} "r.le.pixel: Analyze landscape characteristics" {} -command {execute r.le.pixel }}
-		{command {[G_msg "Analyze patches"]} {} " r.le.patch: Analyze landscape patch characteristics" {} -command {execute r.le.patch }}
-		{command {[G_msg "Output"]} {} "r.le.trace: Output landscape patch information" {} -command {execute r.le.trace }}
-	}}
-	{cascad {[G_msg "Landscape patch analysis"]} {} "" $tmenu {			
-		{command {[G_msg "Set up sampling and analysis framework"]} {} "r.li.setup: Configure and create patch map for analysis" {} -command {execute r.li.setup }}
-		{separator}
-		{command {[G_msg "Edge density"]} {} "r.li.edgedensity: Calculate edge density index using a 4 neighbour algorithm" {} -command {execute r.li.edgedensity }}
-		{command {[G_msg "Contrast weighted edge density"]} {} "r.li.cwed: Calculate contrast weighted edge density index" {} -command {execute r.li.cwed }}
-		{separator}
-		{command {[G_msg "Patch size mean"]} {} "r.li.mps: Calculate mean patch size index using a 4 neighbour algorithm" {} -command {execute r.li.mps }}
- 		{command {[G_msg "Patch area range"]} {} "r.li.padrange: Calculate range of patch area size" {} -command {execute r.li.padrange }}
- 		{command {[G_msg "Patch area Std Dev"]} {} "r.li.padsd: Calculate standard deviation of patch area" {} -command {execute r.li.padsd }}
-		{command {[G_msg "Patch area Coeff Var"]} {} "r.li.padcv: Calculate coefficient of variation of patch area" {} -command {execute r.li.padcv }}
- 		{command {[G_msg "Patch density"]} {} "r.li.patchdensity: Calculate patch density index using a 4 neighbour algorithm" {} -command {execute r.li.patchdensity }}
- 		{command {[G_msg "Patch number"]} {} "r.li.patchnum: Calculate patch number index using a 4 neighbour algorithm" {} -command {execute r.li.patchnum }}
-		{separator}
-		{command {[G_msg "Dominance's diversity"]} {} "r.li.dominance: Calculate Dominance's diversity index" {} -command {execute r.li.dominance }}
- 		{command {[G_msg "Shannon's diversity"]} {} "r.li.shannon: Calculate Shannon's diversity index" {} -command {execute r.li.shannon }}
- 		{command {[G_msg "Simpson's diversity"]} {} "r.li.simpson: Calculate Simpson's diversity index" {} -command {execute r.li.simpson }}
-		{separator}
-		{command {[G_msg "Ricness"]} {} "r.li.richness: Calculate ricness index" {} -command {execute r.li.richness }}
- 		{command {[G_msg "Shape index"]} {} "r.li.shape: Calculate shape index" {} -command {execute r.li.shape }}
-	}}
-	{cascad {[G_msg "Wildfire modeling"]} {} "" $tmenu {			
-		{command {[G_msg "Rate of spread"]} {} "r.ros: Generate rate of spread (ROS) maps" {} -command {execute r.ros }}
-		{command {[G_msg "Least-cost spread paths"]} {} "r.spreadpath: Generate least-cost spread paths" {} -command {execute r.spreadpath }}
-		{command {[G_msg "Anisotropic spread simulation"]} {} "r.spread: Simulate anisotropic spread phenomena" {} -command {execute r.spread }}
-	}}
-	{separator}
-	{cascad {[G_msg "Change category values and labels"]} {} "" $tmenu {			
-		{command {[G_msg "Interactively edit category values"]} {} "d.rast.edit: Edit category values of individual cells for displayed raster map" {} -command {execute d.rast.edit }}
-		{separator}
-		{command {[G_msg "Reclassify by size"]} {} "r.reclass.area: Reclassify categories for areas of specified sizes" {} -command {execute r.reclass.area }}
-		{command {[G_msg "Reclassify interactively"]} {} "Reclassify categories interactively by entering reclass rules" {} -command {GmRules::main "r.reclass" }}
-		{command {[G_msg "Reclassify using rules file"]} {} "r.reclass: Reclassify categories by inputting rules from a text file" {} -command {execute r.reclass}}
-		{separator}
-		{command {[G_msg "Recode interactively"]} {} "Recode categories interactively by entering recode rules (create new map)" {} -command {GmRules::main "r.recode" }}
-		{command {[G_msg "Recode using rules file"]} {} "r.recode: Recode categories  by inputting rules from a text file (create new map)" {} -command {execute r.recode }}
-		{separator}
-		{command {[G_msg "Rescale"]} {} "r.rescale: Rescale categories (create new map)" {} -command {execute r.rescale }}
-		{command {[G_msg "Rescale with histogram"]} {} "r.rescale.eq: Rescale categories with equalized histogram (create new map)" {} -command {execute r.rescale.eq }}
-	}}
-	{separator}
-	{command {[G_msg "Concentric circles"]} {} "r.circle: Generate concentric circles around points" {} -command { execute r.circle }}
-	{cascad {[G_msg "Generate random cells"]} {} "" $tmenu {			
-		{command {[G_msg "Random cells"]} {} "r.random.cells: Generate random cells" {} -command {execute r.random.cells }}
-		{command {[G_msg "Random cells and vector points"]} {} "r.random: Generate random cells and vector points from raster map" {} -command {execute r.random }}
-	}}
-	{cascad {[G_msg "Generate surfaces"]} {} "" $tmenu {			
-		{command {[G_msg "Fractal surface"]} {} "r.surf.fractal: Generate fractal surface" {} -command {execute r.surf.fractal }}
-		{separator}
-		{command {[G_msg "Gausian kernal density surface"]} {} "v.kernel: Generate density surface using moving Gausian kernal" {} -command {execute v.kernel }}
-		{command {[G_msg "Gaussian deviates surface"]} {} "r.surf.gauss: Generate gaussian deviates surface" {} -command {execute r.surf.gauss }}
-		{separator}
-		{command {[G_msg "Plane"]} {} "r.plane: Generate plane" {} -command {execute r.plane }}
-		{separator}
-		{command {[G_msg "Random deviates surface"]} {} "r.surf.random: Generate random deviates surface" {} -command {execute r.surf.random }}
-		{command {[G_msg "Random surface with spatial dependence"]} {} "r.random.surface: Generate random surface with spatial dependence" {} -command {execute r.random.surface }}
-	}}
-	{command {[G_msg "Contour lines"]} {} "r.contour: Generate vector contour lines" {} -command { execute r.contour }}
-	{cascad {[G_msg "Interpolate surfaces"]} {} "" $tmenu {			
-		{command {[G_msg "Bilinear from raster points"]} {} "r.bilinear: Bilinear interpolation from raster points" {} -command { execute r.bilinear }}
-		{command {[G_msg "Bilinear and bicubic from vector points"]} {} "v.surf.bspline: Bicubic and bilinear interpolation with Tykhonov regularization from vector points" {} -command { execute v.surf.bspline }}
-		{separator}
-		{command {[G_msg "IDW from raster points"]} {} "r.surf.idw: Inverse distance weighted interpolation from raster points" {} -command { execute r.surf.idw }}
-		{command {[G_msg "IDW from vector points"]} {} "v.surf.idw: Inverse distance weighted interpolation from vector points" {} -command { execute v.surf.idw }}
-		{separator}
-		{command {[G_msg "Raster contours"]} {} "r.surf.contour: Interpolation from raster contours" {} -command { execute r.surf.contour }}
-		{command {[G_msg "Regularized spline tension"]} {} "v.surf.rst: Regularized spline tension interpolation from vector points or contours" {} -command { execute v.surf.rst }}
-		{separator}
-		{command {[G_msg "Fill NULL cells"]} {} " r.fillnulls: Fill NULL cells by interpolation using regularized spline tension" {} -command {execute r.fillnulls }}
-	}}
-	{separator}
-	{cascad {[G_msg "Reports and statistics"]} {} "" $tmenu {			
-		{command {[G_msg "Report basic file information"]} {} "r.info: Report basic file information" {} -command {execute r.info }}
-		{command {[G_msg "Manage category information"]} {} "r.category: Manage category labels and values" {} -command {execute r.category }}
-		{separator}
-		{command {[G_msg "General statistics"]} {} "r.stats: General statistics" {} -command {execute r.stats }}
-		{command {[G_msg "Range of category values"]} {} "r.describe: Range of all category values" {} -command {execute r.describe }}
-		{command {[G_msg "Sum cell category values"]} {} "r.sum: Sum all cell category values" {} -command {execute r.sum }}
-		{command {[G_msg "Sum area by map and category"]} {} "r.report:Sum area by map and category" {} -command {execute r.report }}
-		{command {[G_msg "Statistics for clumped cells (works with r.clump)"]} {} "r.volume: " {} -command {execute r.volume }}
-		{command {[G_msg "Total surface area corrected for topography"]} {} "r.surf.area: Total surface area corrected for topography" {} -command {execute r.surf.area }}
-		{command {[G_msg "Univariate statistics"]} {} "r.univar: Univariate statistics" {} -command {execute r.univar }}
-		{separator}
-		{command {[G_msg "Sample transects"]} {} "r.profile: Sample values along transects" {} -command {execute r.profile }}
-		{command {[G_msg "Sample transects (bearing/distance)"]} {} " r.transect: Sample values along transects (use azimuth, distance)" {} -command {execute r.transect }}
-		{separator}
-		{command {[G_msg "Covariance/correlation"]} {} "r.covar: Covariance/correlation" {} -command {execute r.covar }}
-		{command {[G_msg "Linear regression"]} {} "r.regression.line: Linear regression between 2 maps" {} -command {execute r.regression.line }}
-		{command {[G_msg "Mutual category occurences"]} {} "r.coin: Mutual category occurences (coincidence)" {} -command {execute r.coin }}
-	}}
- } 
- {[G_msg "&Vector"]} all options $tmenu {
-	{cascad {[G_msg "Develop map"]} {} "" $tmenu {			
-		{command {[G_msg "Digitize"]} {} "v.digit: Digitize/edit vector map" {} -command {execute v.digit }}
-		{command {[G_msg "Edit features"]} {} "v.edit: Edit vector features" {} -command {execute v.edit }}
-		{separator}
-		{command {[G_msg "Create/rebuild topology: "]} {} "v.build: Create or rebuild topology of vector objects" {} -command {execute v.build }}
-		{command {[G_msg "Clean vector"]} {} "v.clean: Clean vector objects" {} -command {execute v.clean }}
-		{command {[G_msg "Generalization"]} {} "v.generalize: Smooth, simplify, displace, or generalize a vector map" {} -command {execute v.generalize }}
-		{separator}
-		{command {[G_msg "Convert object types"]} {} "v.type: Convert vector objects from one feature type to another" {} -command {execute $env(GISBASE)/etc/gui/scripts/v.type.py }}
-		{separator}
-		{command {[G_msg "Add centroids"]} {} "v.centroids: Add centroids to closed boundaries to create areas" {} -command {execute v.centroids }}
-		{separator}
-		{command {[G_msg "Build polylines"]} {} "v.build.polylines: Build polylines from adjacent segments" {} -command {execute v.build.polylines }}
-		{command {[G_msg "Split polylines"]} {} "v.segment: Split polylines into points and segments" {} -command {execute v.segment }}
-		{command {[G_msg "Parallel lines"]} {} "v.parallel: Create lines parallel to existing lines" {} -command {execute v.parallel }}
-		{separator}
-		{command {[G_msg "Dissolve boundaries"]} {} "v.dissolve: Dissolve common boundaries of areas" {} -command {execute v.dissolve }}
-		{separator}
-		{command {[G_msg "Create 3D vector over raster"]} {} "v.drape: Create 3D objects by sampling raster with 2D vector" {} -command {execute v.drape }}
-		{command {[G_msg "Extrude 3D vector"]} {} "v.extrude: Extrude 3D objects from 2D vector" {} -command {execute v.extrude }}
-		{separator}
-		{command {[G_msg "Link to OGR"]} {} "v.external: Create new vector as link to external OGR layer" {} -command {execute v.external }}
-		{separator}
-		{command {[G_msg "Create labels"]} {} "v.label: Create text label file for vector objects" {} -command {execute v.label }}
-		{separator}
-		{command {[G_msg "Reposition vector"]} {} "v.transform: Reposition (shift, rotate, skew) vector file in coordinate space" {} -command {execute v.transform }}
-		{command {[G_msg "Reproject vector"]} {} "v.proj: Reproject vector from other location" {} -command {execute v.proj }}
-		{separator}
-		{command {[G_msg "Metadata support"]} {} "v.support: Edit metadata for vector map" {} -command {execute v.support }}
-		{separator}
-	}}
-	{separator}
-	{command {[G_msg "Query with attributes"]} {} "v.extract: Query vector objects by attribute values" {} -command {execute v.extract }}
-	{command {[G_msg "Query with coordinate(s)"]} {} "v.what: Query vector objects by coordinate(s)" {} -command { execute v.what }}
-	{command {[G_msg "Query with another map"]} {} " v.select: Query objects using objects from a second map" {} -command {execute v.select }}
-	{separator}
-	{command {[G_msg "Buffer vectors"]} {} "v.buffer: Create vector buffers around vector objects" {} -command {execute v.buffer }}
-	{cascad {[G_msg "Lidar analysis"]} {} "" $tmenu {			
-		{command {[G_msg "Detect edges"]} {} "v.lidar.edgedetection: Detect object edges in Lidar data" {} -command {execute v.lidar.edgedetection }}
-		{command {[G_msg "Detect interiors"]} {} "v.lidar.growing: Detect interiors of objects in Lidar data" {} -command {execute v.lidar.growing }}
-		{command {[G_msg "Correct and reclassify objects"]} {} "v.lidar.correction: Correct and reclassify objects detected in Lidar data" {} -command {execute v.lidar.correction }}
-	}}
-	{cascad {[G_msg "Linear referencing"]} {} "" $tmenu {			
-		{command {[G_msg "Create LRS"]} {} "v.lrs.create: Create linear reference system" {} -command {execute v.lrs.create }}
-		{command {[G_msg "Create stationing"]} {} "v.lrs.label: Create stationing from input lines and a linear reference system" {} -command {execute v.lrs.label }}
-		{command {[G_msg "Create points/segments"]} {} "v.lrs.segment: Create points and line segments along a linear reference system" {} -command {execute v.lrs.segment }}
-		{command {[G_msg "Find ID and offset"]} {} "v.lrs.where: Find line ID and real km+offset for given points in vector map using linear reference system" {} -command {execute v.lrs.where }}
-	}}			
-	{command {[G_msg "Nearest features"]} {} "v.distance: Locate nearest features to points or centroids" {} -command {execute v.distance }}
-	{cascad {[G_msg "Network analysis"]} {} "" $tmenu {			
-		{command {[G_msg "Allocate subnets"]} {} "v.net.alloc: Allocate subnets for nearest centers" {} -command {execute v.net.alloc }}
-		{command {[G_msg "Network maintenance"]} {} "v.net: Network maintenance" {} -command {execute v.net }}
-		{command {[G_msg "Visibility network"]} {} "v.net.visibility: Create and maintain a visibility network" {} -command {execute v.net.visibility }}
-		{command {[G_msg "Shortest route"]} {} "v.net.path: Calculate shortest route along network between 2 nodes" {} -command {execute v.net.path }}
-		{command {[G_msg "Display shortest route"]} {} "d.path: Display shortest route along network between 2 nodes (visualization only)" {} -command {
-			unset env(GRASS_RENDER_IMMEDIATE)
-			guarantee_xmon
-			spawn d.path.sh -b --ui
-			set env(GRASS_RENDER_IMMEDIATE) "TRUE"}}
-		{command {[G_msg "Split net"]} {} "v.net.iso: Split net into bands between cost isolines" {} -command {execute v.net.iso }}
-		{command {[G_msg "Steiner tree"]} {} "v.net.steiner: Create Steiner tree for network and given terminals" {} -command {execute v.net.steiner }}
-		{command {[G_msg "Traveling salesman analysis"]} {} "v.net.salesman: Calculate shortest route connecting given set of nodes (Traveling salesman analysis)" {} -command {execute v.net.salesman }}
-	}}
-	{cascad {[G_msg "Overlay maps"]} {} "" $tmenu {			
-		{command {[G_msg "Overlay"]} {} "v.overlay: Boolean overlay of 2 vector maps" {} -command {execute v.overlay }}
-		{command {[G_msg "Patch (combine)"]} {} "v.patch: Patch/combine multiple maps (Boolean OR)" {} -command {execute v.patch }}
-	}}
-	{separator}
-	{cascad {[G_msg "Change attributes"]} {} "" $tmenu {			
-		{command {[G_msg "Manage or report categories"]} {} "v.category: Attach, delete, or report categories" {} -command {execute v.category }}
-		{command {[G_msg "Reclassify objects interactively"]} {} "Reclassify objects interactively by entering SQL rules" {} -command {GmRules::main "v.reclass" }}
-		{command {[G_msg "Reclassify using rules file"]} {} "v.reclass: Reclassify objects by inputting rules from a text file" {} -command {execute v.reclass }}
-	}}
-	{separator}
-	{command {[G_msg "Generate area for current region"]} {} "v.in.region: Generate area object for extent of current region" {} -command {execute v.in.region }}
-	{cascad {[G_msg "Generate areas from points"]} {} "" $tmenu {			
-		{command {[G_msg "Convex hull"]} {} "v.hull: Generate convex hull for point set" {} -command {execute v.hull }}
-		{command {[G_msg "Delaunay triangles"]} {} "v.delaunay: Generate Delaunay triangles for point set" {} -command {execute v.delaunay }}
-		{command {[G_msg "Voronoi diagram/Thiessen polygons"]} {} "v.voronoi: Generate Voronoi diagram/Thiessen polygons for point set" {} -command {execute v.voronoi }}
-	}}
-	{command {[G_msg "Generate grid"]} {} "v.mkgrid: Generate rectangular vector grid" {} -command {execute v.mkgrid }}		
-	{cascad {[G_msg "Generate points"]} {} "" $tmenu {			
-		{command {[G_msg "Generate points from database"]} {} "v.in.db: Generate points from database with x/y coordinates" {} -command {execute v.in.db }}
-		{command {[G_msg "Generate points along lines"]} {} "v.to.points: Generate points along vector lines/boundaries" {} -command {execute v.to.points }}
-		{command {[G_msg "Generate random points"]} {} "v.random: Generate random points" {} -command {execute v.random }}
-		{command {[G_msg "Perturb points"]} {} "v.perturb: Random perturbations of point locations" {} -command {execute v.perturb }}
-	}}
-	{separator}
-	{command {[G_msg "Remove outliers in point sets"]} {} "v.outlier: Remove outliers from vector point set" {} -command {execute v.outlier }}
-	{command {[G_msg "Test/training sets"]} {} "v.kcv: Partition points into test/training sets for k-fold cross validatation" {} -command {execute v.kcv }}
-	{separator}
-	{command {[G_msg "Update area attributes from raster"]} {} "v.rast.stats: Update area attribute data from univariate statistics on raster map" {} -command {execute v.rast.stats }}
-	{command {[G_msg "Update point attributes from areas"]} {} "v.what.vect: Update point attribute data from vector area map" {} -command {execute v.what.vect }}
-	{cascad {[G_msg "Update point attributes from raster"]} {} "" $tmenu {			
-		{command {[G_msg "Sample raster map at point locations"]} {} "v.what.rast: " {} -command {execute v.what.rast }}
-		{command {[G_msg "Sample raster neighborhood around points"]} {} "v.sample: " {} -command {execute v.sample }}
-	}}
-	{separator}
-	{cascad {[G_msg "Reports and statistics"]} {} "" $tmenu {			
-		{command {[G_msg "Basic information"]} {} "v.info: Basic information" {} -command {execute v.info }}
- 		{separator}
-		{command {[G_msg "Report topology by category"]} {} "v.report: Report areas for vector attribute categories" {} -command {execute v.report }}
-		{command {[G_msg "Upload or report topology"]} {} "v.to.db: Update database fields or create reports from vector topology" {} -command {execute v.to.db }}
- 		{separator}
-		{command {[G_msg "Univariate attribute statistics"]} {} "v.univar: Calculate univariate statistics for vector attributes" {} -command {execute v.univar }}
- 		{separator}
-		{command {[G_msg "Quadrat indices"]} {} "v.qcount: Indices of point counts in quadrats" {} -command {execute v.qcount }}
-		{command {[G_msg "Test normality"]} {} "v.normal: Test normality of point distribution" {} -command {execute v.normal }}
-	}}
- } 
- {[G_msg "&Imagery"]} all options $tmenu {			
-	{cascad {[G_msg "Develop images and groups"]} {} "" $tmenu {			
-		{command {[G_msg "Create/edit group"]} {} "i.group: Create/edit imagery group" {} -command {execute i.group }}			
-		{command {[G_msg "Target group"]} {} "i.target: Target imagery group" {} -command {execute i.target }}
-		{separator}
-		{command {[G_msg "Mosaic images"]} {} "i.image.mosaic: Mosaic up to 4 adjacent images" {} -command {execute i.image.mosaic }}
-	}}
-	{cascad {[G_msg "Manage image colors"]} {} "" $tmenu {			
-		{command {[G_msg "Color balance for RGB"]} {} "i.landsat.rgb: Color balance and enhance color tables of multiband imagery for rgb display" {} -command {execute i.landsat.rgb }}
-		{command {[G_msg "HIS to RGB"]} {} "i.his.rgb: Transform HIS (Hue/Intensity/Saturation) color image to RGB (Red/Green/Blue)" {} -command {execute i.his.rgb }}
-		{command {[G_msg "RGB to HIS"]} {} "i.rgb.his: Transform RGB (Red/Green/Blue) color image to HIS (Hue/Intensity/Saturation)" {} -command {execute i.rgb.his }}
-	}}
-	{command {[G_msg "Ortho photo rectification"]} {} "i.ortho.photo: Ortho photo rectification" {} -command {
-		unset env(GRASS_RENDER_IMMEDIATE)
-		guarantee_xmon
-		term i.ortho.photo 
-		set env(GRASS_RENDER_IMMEDIATE) "TRUE"}}
-	{separator}
-	{cascad {[G_msg "Basic RS processing"]} {} "" $tmenu {			
-				{command {[G_msg "MODIS Quality flags"]} {} "i.modis.qc: Extracts Modis Quality flags as raster values." {} -command {execute i.modis.qc }}
-				{command {[G_msg "Latitude/longitude maps"]} {} "i.latlong: Latitude or Longitude maps." {} -command {execute i.latlong }}
-				{command {[G_msg "Potential Sunshine Hours"]} {} "i.sunhours: Potential Sunshine hours." {} -command {execute i.sunhours }}
-				{separator}
-				{command {[G_msg "Albedo"]} {} "i.albedo: Calculates Albedo from Modis, Aster, Landsat or AVHRR" {} -command {execute i.albedo }}
-				{command {[G_msg "Vegetation Indices"]} {} "i.vi: Calculates 14 types of Vegetation Indices" {} -command {execute i.vi }}
-				{separator}
-				{command {[G_msg "Emissivity"]} {} "i.emissivity: Calculates emissivity from NDVI" {} -command {execute i.emissivity }}
-	}}
-	{command {[G_msg "Brovey sharpening"]} {} "i.fusion.brovey: Brovey transformation and pan sharpening" {} -command {execute i.fusion.brovey }}
-	{cascad {[G_msg "Classify image"]} {} "" $tmenu {			
-		{command {[G_msg "Clustering input for unsupervised classification"]} {} "i.cluster: Clustering input for unsupervised classification" {} -command {execute i.cluster }}
-		{separator}
-		{command {[G_msg "Maximum likelyhood classification (MLC)"]} {} "i.maxlik: Maximum likelyhood classification" {} -command {execute i.maxlik }}
-		{command {[G_msg "Sequential maximum a posteriory classification (SMAP)"]} {} "i.smap: Sequential maximum a posteriory classification" {} -command {execute i.smap }}
-		{separator}
-		{command {[G_msg "Interactive input for supervised classification"]} {} "i.class: Interactive input for supervised classification" {} -command {term i.class }}
-		{command {[G_msg "Input for supervised MLC"]} {} "i.gensig: Non-interactive input for supervised classification (MLC)" {} -command {execute i.gensig }}
-		{command {[G_msg "Input for supervised SMAP"]} {} "i.gensigset: Non-interactive input for supervised classification (SMAP)" {} -command {execute i.gensigset }}
-	}}
-	{cascad {[G_msg "Filter image"]} {} "" $tmenu {			
-		{command {[G_msg "Edge detection"]} {} "i.zc: Zero edge crossing detection" {} -command {execute i.zc }}
-		{command {[G_msg "Matrix/convolving filter"]} {} "r.mfilter: User defined matrix/convolving filter" {} -command {execute r.mfilter }}
-	}}
-	{command {[G_msg "Spectral response"]} {} "i.spectral: Spectral response" {} -command {execute i.spectral }}
-	{command {[G_msg "Tassled cap vegetation index"]} {} "i.tasscap: Tassled cap vegetation index" {} -command {execute i.tasscap }}
-	{cascad {[G_msg "Transform image"]} {} "" $tmenu {			
-		{command {[G_msg "Canonical correlation"]} {} "i.cca: Canonical correlation (discriminant analysis)" {} -command {execute i.cca }}
-		{command {[G_msg "Principal components"]} {} "i.pca: Principal components analysis" {} -command {execute i.pca }}
-		{command {[G_msg "Fast Fourier"]} {} "i.fft: Fast Fourier transform" {} -command {execute i.fft }}
-		{command {[G_msg "Inverse Fast Fourier"]} {} "i.ifft: Inverse fast Fourier transform" {} -command {execute i.ifft }}
-	}}
-	{separator}
-	{cascad {[G_msg "Reports and statistics"]} {} "" $tmenu {			
-		{command {[G_msg "Bit pattern comparison"]} {} "r.bitpattern: Bit pattern comparison for ID of low quality pixels" {} -command {execute r.bitpattern }}
-		{command {[G_msg "Kappa analysis"]} {} "r.kappa: Kappa classification accuracy assessment" {} -command {execute r.kappa }}
-		{command {[G_msg "OIF for LandSat TM"]} {} "i.oif: Optimum index factor for LandSat TM" {} -command {execute i.oif }}
-	}}
- } 
- {[G_msg "&Volumes"]} all options $tmenu {
-	{cascad {[G_msg "Develop grid3D volumes"]} {} "" $tmenu {			
-		{command {[G_msg "Manage nulls for grid3D volume"]} {} "r3.null: Manage nulls for grid3D volume" {} -command {execute r3.null }}
-		{command {[G_msg "Manage timestamp for grid3D volume"]} {} "r3.timestamp" {} -command {execute r3.timestamp }}
-	}}
-	{command {[G_msg "3D MASK"]} {} "r3.mask: " {} -command {execute r3.mask }}
-	{command {[G_msg "3D Map calculator"]} {} "r3.mapcalculator: Map calculator for grid3D operations" {} -command {execute r3.mapcalculator }}
-	{command {[G_msg "Cross section from volume"]} {} "r3.cross.rast: Create 2D raster cross section from grid3D volume" {} -command { execute r3.cross.rast }}
-	{command {[G_msg "Groundwater flow model"]} {} "r3.gwflow: 3D groundwater flow model" {} -command {execute r3.gwflow }}
-	{command {[G_msg "Interpolate volume from vector points"]} {} "v.vol.rst: Interpolate volume from vector points using splines" {} -command {execute v.vol.rst }}
-	{cascad {[G_msg "Report and Statistics"]} {} "" $tmenu {			
-		{command {[G_msg "Basic information"]} {} "r3.info: Display information about grid3D volume" {} -command {execute r3.info }}
-	}}
- } 
- {[G_msg "&Databases"]} all options $tmenu {
-	{cascad {[G_msg "Database information"]} {} "" $tmenu {			
-		{command {[G_msg "Describe table"]} {} "db.describe: Describe table structure and attributes" {} -command {execute db.describe }}
-		{command {[G_msg "List columns"]} {} "db.columns: List columns for selected table" {} -command {execute db.columns }}
-		{command {[G_msg "List drivers"]} {} "db.drivers: List available database drivers" {} -command {execute db.drivers }}
-		{command {[G_msg "List tables"]} {} "db.tables: List tables in database" {} -command {execute db.tables }}
-	}}
-	{separator}
-	{cascad {[G_msg "Manage database"]} {} "" $tmenu {			
-		{command {[G_msg "Connect to database"]} {} "db.connect: Connect to database" {} -command {execute db.connect }}
-		{command {[G_msg "Login to database"]} {} "db.login: Login to database" {} -command {execute db.login }}
-		{separator}
-		{command {[G_msg "Copy table"]} {} "db.copy: Copy attribute table" {} -command {execute db.copy }}
-		{command {[G_msg "New table"]} {} "v.db.addtable: Create and connect new attribute table to vector map" {} -command {execute v.db.addtable }}
-		{command {[G_msg "Remove table"]} {} "v.db.droptable: Remove existing attribute table for vector map" {} -command {execute v.db.droptable }}
-		{separator}
-		{command {[G_msg "Add columns"]} {} "v.db.addcol: Add columns to table" {} -command {execute v.db.addcol }}
-		{command {[G_msg "Change values"]} {} "v.db.update: Change values in a column" {} -command {execute v.db.update }}
-		{command {[G_msg "Drop column"]} {} "v.db.dropcol: Drop column from a table" {} -command {execute v.db.dropcol }}
-		{command {[G_msg "Rename a column"]} {} "v.db.renamecol: Rename a column" {} -command {execute v.db.renamecol }}
-		{separator}
-		{command {[G_msg "Test database"]} {} "db.test: Test database" {} -command {execute db.test }}
-	}}
-	{separator}
-	{cascad {[G_msg "Query"]} {} "" $tmenu {			
-		{command {[G_msg "Query any table"]} {} "db.select: Query data in any table" {} -command {execute db.select }}
-		{command {[G_msg "Query vector attribute table"]} {} "v.db.select: Query vector attribute data" {} -command {execute v.db.select }}
-		{command {[G_msg "SQL statement"]} {} "db.execute: Execute SQL statement" {} -command {execute db.execute }}
-	}}
-	{cascad {[G_msg "Vector<->database connections"]} {} "" $tmenu {			
-		{command {[G_msg "Reconnect vector to database"]} {} "v.db.reconnect.all: Reconnect vector map to attribute database" {} -command {execute v.db.reconnect.all }}
-		{command {[G_msg "Set vector - database connection"]} {} "v.db.connect: Set database connection for vector attributes" {} -command {execute v.db.connect }}
-	}}
- } 
-{[G_msg "&Help"]} all options $tmenu {
-	{command {[G_msg "GRASS help"]} {} "g.manual" {} -command { exec g.manual -i > $devnull & } }
-	{command {[G_msg "GIS Manager &help"]} {} {[G_msg "GIS Manager help"]} {} -command { exec g.manual gis.m > $devnull & } }
-	{command {[G_msg "About &GRASS"]} {} {[G_msg "About GRASS"]} {} -command { source $env(GISBASE)/etc/gm/grassabout.tcl} }
-	{command {[G_msg "About &System"]} {} {[G_msg "About System"]} {} -command { exec $env(GRASS_WISH) $env(GISBASE)/etc/gm/tksys.tcl --tcltk & }}
- }
-
-}]
-
-# Should we add an Xtns menu entry?
-if { $XtnsMenu == "True" } {
-	# build extension menu
-	lappend descmenu [G_msg "&Xtns"]
-	lappend descmenu all
-	lappend descmenu options
-	lappend descmenu $tmenu
-	lappend descmenu $menulist
-}

+ 0 - 147
gui/tcltk/gis.m/gmtool1.tcl

@@ -1,147 +0,0 @@
-###############################################################
-# gmtool1.tcl - upper toolbar file for GRASS GIS Manager main window
-# January 2006 Michael Barton, Arizona State University
-###############################################################
-
-namespace eval GmToolBar1 {
-    variable toolbar
-}
-
-proc GmToolBar1::create { tb } {
-    global iconpath
-    global mon
-    global bgcolor
-    variable toolbar
-
-    set toolbar $tb
-
-
-
-    # Raster Layers
-    set bbox0 [ButtonBox $toolbar.bbox0 -spacing 0]
-    
-    # add monitor
-    $bbox0 add -image [image create photo -file "$iconpath/gui-startmon.gif"] \
-        -command "Gm::startmon" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Start new map display monitor"]
-
-    pack $bbox0 -side left -anchor w
-
-    set sep0 [Separator $toolbar.sep0 -orient vertical -background $bgcolor ]
-    pack $sep0 -side left -fill y -padx 5 -anchor w
-
-    set bbox1 [ButtonBox $toolbar.bbox1 -spacing 0 ]
-    
-    # add raster
-    $bbox1 add -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -command "GmTree::add raster" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add raster layer"]
-
-    # add RGB or HIS layer
-    $bbox1 add -image [image create photo -file "$iconpath/channel-rgb.gif"] \
-        -command "GmTree::add rgbhis" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add RGB or HIS layer"]
-
-    # add histogram layer
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.histogram.gif"] \
-        -command "GmTree::add hist" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add histogram layer"]
-
-    # add cell values layer
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.rast.num.gif"] \
-        -command "GmTree::add rnums" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add cell values layer"]
-
-    # add cell values layer
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.rast.arrow.gif"] \
-        -command "GmTree::add arrows" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add directional arrows layer"]
-
-    # add legend
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.legend.gif"] \
-    	-command "GmTree::add legend" -highlightthickness 0 -takefocus 0 \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-    	-relief link -borderwidth 1 -helptext [G_msg "Add raster legend layer"]
-
-    pack $bbox1 -side left -anchor w
-
-    set sep1 [Separator $toolbar.sep1 -orient vertical -background $bgcolor ]
-    pack $sep1 -side left -fill y -padx 5 -anchor w
-
-
-    # VECTOR LAYERS
-    set bbox2 [ButtonBox $toolbar.bbox2 -spacing 0 ]
-
-    # add vector
-    $bbox2 add -image [image create photo -file "$iconpath/element-vector.gif"] \
-        -command "GmTree::add vector" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add vector layer"]
-
-    # add thematic
-    $bbox2 add -image [image create photo -file "$iconpath/module-d.vect.thematic.gif"] \
-        -command "GmTree::add thematic" \
-        -highlightthickness 0 -activebackground $bgcolor -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor \
-        -helptext [G_msg "Add thematic map layer"]
-
-    pack $bbox2 -side left -anchor w
-
-    # add chart
-    $bbox2 add -image [image create photo -file "$iconpath/module-d.vect.chart.gif"] \
-        -command "GmTree::add chart" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add thematic charts layer"]
-
-    set sep2 [Separator $toolbar.sep2 -orient vertical -background $bgcolor ]
-    pack $sep2 -side left -fill y -padx 5 -anchor w
-
-    # Text Layers
-    set bbox3 [ButtonBox $toolbar.bbox3 -spacing 0 ]
-
-    # add raster labels
-    $bbox3 add -image [image create photo -file "$iconpath/module-d.labels.gif"] \
-        -command "GmTree::add labels" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add raster labels layer (using v.labels file)"]
-
-    # add text
-    $bbox3 add -image [image create photo -file "$iconpath/module-d.text.gif"] \
-        -command "GmTree::add dtext" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add text layer"]
-
-    # add TclTk labels
-    $bbox3 add -image [image create photo -file "$iconpath/gui-maplabels.gif"] \
-        -command "GmTree::add clabels" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add postscript labels layer (using v.labels file)"]
-
-    # add postscript text
-    $bbox3 add -image [image create photo -file "$iconpath/gui-maptext.gif"] \
-        -command "GmTree::add ctext" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add postscript text layer"]
-
-    pack $bbox3 -side left -anchor w
-
-}
-

+ 0 - 134
gui/tcltk/gis.m/gmtool2.tcl

@@ -1,134 +0,0 @@
-###############################################################
-# gmtool2.tcl - lower toolbar file for GRASS GIS Manager main window
-# January 2006 Michael Barton, Arizona State University
-###############################################################
-
-namespace eval GmToolBar2 {
-    variable toolbar
-    variable mon
-}
-
-
-proc GmToolBar2::create { tb } {
-    global iconpath
-    global bgcolor
-    variable toolbar
-
-    set toolbar $tb
-
-    # OTHER LAYERS
-    set bbox1 [ButtonBox $toolbar.bbox1 -spacing 0 ]
-
-    # add scale and north arrow
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.barscale.gif"] -command "GmTree::add barscale" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Scalebar and north arrow"]
-
-    # add grid and lines
-    $bbox1 add -image [image create photo -file "$iconpath/module-d.grid.gif"] -command "GmTree::add gridline"\
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Overlay grids and lines"]
-
-	# add command
-    $bbox1 add -image [image create photo -file "$iconpath/gui-cmd.gif"] \
-        -command "GmTree::add cmd" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add command layer"]
-
-    # add frame (frames not functional in GIS Manager currently)
-#    $bbox1 add -image [image create photo -file "$iconpath/module-d.frame.gif"] -command "GmTree::add dframe"\
-#        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-#        -helptext [G_msg "Create or select display frame"]
-
-    pack $bbox1 -side left -anchor w
-
-    set sep1 [Separator $toolbar.sep1 -orient vertical -background $bgcolor ]
-    pack $sep1 -side left -fill y -padx 5 -anchor w
-
-    # LAYER MANAGEMENT
-    set bbox2 [ButtonBox $toolbar.bbox2 -spacing 0 ]
-
-    # add group
-    $bbox2 add -image [image create photo -file "$iconpath/gui-group.gif"] \
-        -command "GmTree::add group" -borderwidth 1\
-        -highlightthickness 0 -takefocus 0 -relief link \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Add group"]
-
-    $bbox2 add -image [image create photo -file "$iconpath/edit-copy.gif"] \
-        -command "GmTree::duplicate" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Duplicate Layer"]    
-
-    $bbox2 add -image [image create photo -file "$iconpath/edit-cut.gif"] -command \
-    	"GmTree::delete" -highlightthickness 0 -takefocus 0 -relief link \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-    	-borderwidth 1 -helptext [G_msg "Delete layer"]
-       
-    pack $bbox2 -side left -anchor w
-
-    set sep2 [Separator $toolbar.sep2 -orient vertical -background $bgcolor ]
-    pack $sep2 -side left -fill y -padx 5 -anchor w
-
- # LAYER FILES
-    set bbox3 [ButtonBox $toolbar.bbox3 -spacing 0 ]
-
-     $bbox3 add -image [image create photo -file "$iconpath/file-new.gif"] \
-     	-command "GmTree::new" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Create new workspace file (erase current workspace settings first)"]
-
-    $bbox3 add -image [image create photo -file "$iconpath/file-open.gif"] \
-    	-command "GmLib::OpenFileBox"\
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Open existing workspace file"]
-
-    $bbox3 add -image [image create photo -file "$iconpath/file-save.gif"]  \
-    	-command "GmLib::SaveFileBox"\
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Save workspace file"]
-
-    pack $bbox3 -side left -anchor w
-    
-    set sep3 [Separator $toolbar.sep3 -orient vertical -background $bgcolor ]
-    pack $sep3 -side left -fill y -padx 5 -anchor w
-
-    # 3D AND ANIMATION
-    set bbox4 [ButtonBox $toolbar.bbox4 -spacing 0 ]
-
-    # animate
-    $bbox4 add -image [image create photo -file "$iconpath/module-xganim.gif"] \
-        -command "GmAnim::main" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1\
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Animate raster map series"]
-
-
-    pack $bbox4 -side left -anchor w
-
-    set sep4 [Separator $toolbar.sep4 -orient vertical -background $bgcolor ]
-    pack $sep4 -side left -fill y -padx 5 -anchor w
-
-       # DIGITIZE
-    set bbox5 [ButtonBox $toolbar.bbox5 -spacing 20 ]
-    
-    #digitize
-    $bbox5 add -image [image create photo -file "$iconpath/module-v.digit.gif"] \
-        -command "GmTree::vedit" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor -activebackground $bgcolor \
-        -helptext [G_msg "Digitize map (select or create new map first)"]
-
-    pack $bbox5 -side left -anchor w
-
-    
-
-}
-

文件差异内容过多而无法显示
+ 0 - 1218
gui/tcltk/gis.m/gmtree.tcl


+ 0 - 96
gui/tcltk/gis.m/grassabout.tcl

@@ -1,96 +0,0 @@
-##################### some scroll widgets
-proc scrollx_widget {widget path args} {
-    frame $path
-    eval $widget $path.$widget $args {-xscrollcommand [list $path.xscroll set]}
-    scrollbar $path.xscroll -width 10 -orient horizontal \
-        -command [list $path.$widget xview]
-    grid $path.$widget -sticky news
-    grid $path.xscroll -sticky news
-    grid rowconfigure    $path 0 -weight 1
-    grid columnconfigure $path 0 -weight 1
-    return $path.$widget
-}
-
-proc scrolly_widget {widget path args} {
-    frame $path
-    eval $widget $path.$widget $args {-yscrollcommand [list $path.yscroll set]}
-    scrollbar $path.yscroll -width 10 -orient vertical \
-        -command [list $path.$widget yview]
-    grid $path.$widget $path.yscroll -sticky news
-    grid rowconfigure    $path 0 -weight 1
-    grid columnconfigure $path 0 -weight 1
-    return $path.$widget
-}
-
-proc scrollxy_widget {widget path args} {
-    frame $path
-    eval $widget $path.$widget $args { \
-        -xscrollcommand [list $path.xscroll set] \
-        -yscrollcommand [list $path.yscroll set] \
-    }
-    scrollbar $path.xscroll -width 10 -orient horizontal \
-        -command [list $path.$widget xview]
-    scrollbar $path.yscroll -width 10 -orient vertical \
-        -command [list $path.$widget yview]
-    grid $path.$widget $path.yscroll -sticky news
-    grid $path.xscroll -sticky news
-    grid rowconfigure    $path 0 -weight 1
-    grid columnconfigure $path 0 -weight 1
-    return $path.$widget
-}
-
-proc children {path} {
-    set list {}
-    foreach child [winfo children $path] {
-        eval lappend list $child [children $child]
-    }
-    return $list
-}
-
-
-proc setfont {path font} {
-    if {[llength $font] > 0} {
-        foreach child [children $path] {
-            catch {$child configure -font $font}
-        }
-    }
-}
-
-#########################################################################
-#write text in window with close button
-
-set help_font [font create -family Times -size 10]
-
-proc helptext {title textopts tagopts message} {
-    global help_font
-
-    toplevel .helptext
-    wm title .helptext $title
-
-    bind .helptext <Return> {destroy .helptext}
-
-    button .helptext.ok -text OK -command "destroy .helptext"
-    pack .helptext.ok -side bottom
-
-    eval scrollxy_widget text .helptext.frame -setgrid yes -wrap none $textopts
-    pack .helptext.frame -side top -fill both -expand yes
-    setfont .helptext.frame $help_font
-    .helptext.frame.text insert end $message texttag
-    eval .helptext.frame.text tag configure texttag $tagopts
-
-    .helptext.frame.text configure -state disabled
-    focus .helptext.frame.text
-    
-    grab .helptext
-    tkwait window .helptext
-}
-
-#########################################################################
-#grassabout.tcl
-# open g.version and print in window
-#
-
-if {[catch {set text [exec g.version -c]} error]} {
-    tk_messageBox -type ok -icon error -title [G_msg "Error"] -message [G_msg $error]
-}
-helptext {About GRASS} {-width 75} {-justify left} $text

+ 0 - 414
gui/tcltk/gis.m/gridline.tcl

@@ -1,414 +0,0 @@
-##########################################################################
-# grid.tcl - grid and line overlay layer options file for GRASS GIS Manager
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmGridline {
-    variable array opt # grid current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # raster
-    variable array lfilemask # raster
-    variable optlist
-    variable first
-    variable array dup # vector
-}
-
-proc GmGridline::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-    global mon
-    global iconpath
-
-    set node "gridline:$count"
-
-    set frm [ frame .gridicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmGridline::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo gico -file "$iconpath/module-d.grid.gif"
-    set gdico [label $frm.gdico -image gico -bd 1 -relief raised]
-    
-    bind $gdico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $gdico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "gridline $count"\
-	-window    $frm \
-	-drawcross auto  
-
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-    
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,gridline) "gridline" 
-    set opt($count,1,gridcolor) \#AAAAAA
-    set opt($count,1,gridborder) \#000000 
-    set opt($count,1,gridsize) 1000
-    set opt($count,1,gridorigin) "0,0" 
-    set opt($count,1,griddraw) 1 
-    set opt($count,1,gridgeod) 0
-    set opt($count,1,borderdraw) 1 
-    set opt($count,1,textdraw) 1 
-    set opt($count,1,textcolor) #AAAAAA
-    set opt($count,1,font) "" 
-    set opt($count,1,fontsize) 9
-    
-    set opt($count,1,rhumbdraw) 0 
-    set opt($count,1,rhumbcoor) "" 
-    set opt($count,1,rhumbcolor) "black" 
-    
-    set opt($count,1,geoddraw) 0 
-    set opt($count,1,geodcoor) "" 
-    set opt($count,1,geodcolor) "black" 
-    set opt($count,1,geodtxtcolor) "none" 
-
-    set first 1
-    set opt($count,1,mod) 1
-    
-	set optlist { _check opacity gridcolor gridborder gridsize gridorigin griddraw gridgeod \
-    			borderdraw textdraw textcolor font fontsize rhumbdraw rhumbcoor geoddraw \
-    			geodcoor geodcolor geodtxtcolor} 
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-proc GmGridline::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-##########################################################################
-proc GmGridline::set_font { id } {
-	variable opt
-
-	if {$GmGridline::opt($id,1,font) != "" } {
-		set Gm::dfont $GmGridline::opt($id,1,font)
-	}
-	Gm::defaultfont dgrid
-	tkwait variable Gm::dfont
-	set GmGridline::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-	
-}
-
-##########################################################################
-
-# display gridline options
-proc GmGridline::options { id frm } {
-    variable opt    
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display grid lines, and geodesic lines or rhumblines"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmGridline::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # grid options 1
-    set row [ frame $frm.grid1 ]
-    Label $row.a -text [G_msg "Grid options: "]
-    checkbutton $row.b -text [G_msg "draw grid"] -variable GmGridline::opt($id,1,griddraw) 
-    checkbutton $row.c -text [G_msg "geodetic grid  "] -variable GmGridline::opt($id,1,gridgeod) 
-    SelectColor $row.d -type menubutton -variable GmGridline::opt($id,1,gridcolor)    
-    Label $row.e -text [G_msg "grid color "] 
-    Button $row.f -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.grid" \
-            -background $bgcolor \
-            -helptext [G_msg "Help for grids"]
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-
-    # grid options 4
-    set row [ frame $frm.grid4 ]
-    Label $row.a -text [G_msg "    grid size (map units)"]
-    LabelEntry $row.b -textvariable GmGridline::opt($id,1,gridsize) -width 7
-    Label $row.c -text [G_msg " grid origin (east, north)"]
-    LabelEntry $row.d -textvariable GmGridline::opt($id,1,gridorigin) -width 15
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # grid options 2
-    set row [ frame $frm.grid2 ]
-    Label $row.a -text "   "
-    checkbutton $row.b -text [G_msg "draw border text "] -variable GmGridline::opt($id,1,textdraw) 
-    SelectColor $row.c -type menubutton -variable GmGridline::opt($id,1,textcolor)    
-    Label $row.d -text [G_msg "text color "] 
-    Button $row.e -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmGridline::set_font $id"
-    Label $row.f -text [G_msg "text font "]
-    Label $row.g -text [G_msg "  text size"]
-    SpinBox $row.h -range {1 72 1} -textvariable GmGridline::opt($id,1,fontsize) \
-                   -width 2 -helptext [G_msg "Grid text size in points"] 
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g $row.h -side left
-    pack $row -side top -fill both -expand yes
-
-    # grid options 3
-    set row [ frame $frm.grid3 ]
-    Label $row.a -text "   "
-    checkbutton $row.b -text [G_msg "draw grid border "] -variable GmGridline::opt($id,1,borderdraw) 
-    SelectColor $row.c -type menubutton -variable GmGridline::opt($id,1,gridborder)
-    Label $row.d -text [G_msg "border color "] 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.line ]
-    Label $row.a -text [G_msg "Geodesic and rhumblines for latlong locations only"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # geodesic line options 1
-    set row [ frame $frm.geod1 ]
-    Label $row.a -text "     "
-    checkbutton $row.b -text [G_msg "draw geodesic line"] -variable GmGridline::opt($id,1,geoddraw)
-    Button $row.c -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.geodesic" \
-            -background $bgcolor \
-            -helptext [G_msg "Help for geodesic lines"]
-    Label $row.d -text [G_msg " line color"]
-    ComboBox $row.e -padx 2 -width 7 -textvariable GmGridline::opt($id,1,geodcolor) \
-                    -values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-                    "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"}
-    Label $row.f -text [G_msg " text color"]
-    ComboBox $row.g -padx 2 -width 7 -textvariable GmGridline::opt($id,1,geodtxtcolor) \
-                    -values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-                    "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"}
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-    
-    # geodesic line options 2
-    set row [ frame $frm.geod2 ]
-    Label $row.a -text [G_msg "     line endpoints (x1,y1,x2,y2)"]
-    LabelEntry $row.b -textvariable GmGridline::opt($id,1,geodcoor) -width 35 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # rhumbline options 1
-    set row [ frame $frm.rhumb1 ]
-    Label $row.a -text "     "
-    checkbutton $row.b -text [G_msg "draw rhumbline"] -variable GmGridline::opt($id,1,rhumbdraw)
-    Button $row.c -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.rhumbline" \
-            -background $bgcolor \
-            -helptext [G_msg "Help for rhumblines"]
-    Label $row.d -text [G_msg " line color"]
-    ComboBox $row.e -padx 2 -width 7 -textvariable GmGridline::opt($id,1,rhumbcolor) \
-                    -values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-                    "yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" "magenta"}
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-    
-    # rhumbline options 2
-    set row [ frame $frm.rhumb2 ]
-    Label $row.a -text [G_msg "     line endpoints (x1,y1,x2,y2)"]
-    LabelEntry $row.b -textvariable GmGridline::opt($id,1,rhumbcoor) -width 35 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-}
-
-##########################################################################
-proc GmGridline::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"     
-
-    }                     
-}
-
-##########################################################################
-proc GmGridline::display { node mod } {
-    global mon
-    global env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    variable first
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    set cmd ""
-    set cmd2 ""
-    set cmd3 ""
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-    
-    # set hex colors to rgb         
-    set gridcolor [GmLib::color $opt($id,1,gridcolor)]
-    set gridborder [GmLib::color $opt($id,1,gridborder)]
-    set txtcolor [GmLib::color $opt($id,1,textcolor)]
-
-    
-    # d.grid command
-    if { $opt($id,1,griddraw) || $opt($id,1,borderdraw) } {
-            set cmd "d.grid size=$opt($id,1,gridsize) origin=$opt($id,1,gridorigin) \
-                color=$gridcolor bordercolor=$gridborder textcolor=$txtcolor \
-                fontsize=$opt($id,1,fontsize)" 
-        } 
-        
-    if { $opt($id,1,gridgeod) && $cmd != "" } {append cmd " -g"} 
-    if { !$opt($id,1,griddraw) && $cmd != "" } {append cmd " -n"} 
-    if { !$opt($id,1,borderdraw) && $cmd != "" } {append cmd " -b"}
-    if { !$opt($id,1,textdraw) && $cmd != "" } {append cmd " -t"}
-        
-    # d.geodesic command
-    if { $opt($id,1,geoddraw) } {
-        set cmd2 "d.geodesic coor=$opt($id,1,geodcoor) \
-                lcolor=$opt($id,1,geodcolor) \
-                tcolor=$opt($id,1,geodtxtcolor)"  
-    }
-
-    # d.rhumbline command
-    if { $opt($id,1,rhumbdraw) } {
-        set cmd3 "d.rhumbline coor=$opt($id,1,rhumbcoor) \
-	       lcolor=$opt($id,1,rhumbcolor) " 
-    }
-
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-
-    # set grass font environmental variable to user selection"
-	if { $GmGridline::opt($id,1,font) != ""} { 
-		set env(GRASS_FONT) $GmGridline::opt($id,1,font) 
-	}
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_commands [namespace current] $id [list $cmd $cmd2 $cmd3]
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-
-}
-
-
-##########################################################################
-proc GmGridline::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	variable first
-	global iconpath
-
-    set node "gridline:$count"
-	set dup($count) 1
-
-    set frm [ frame .gridlineicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmGridline::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo gico -file "$iconpath/module-d.grid.gif"
-    set gdico [label $frm.gdico -image gico -bd 1 -relief raised]
-    
-    pack $check $gdico -side left
-
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-     $tree insert $sellayer $parent $node \
-	-text  "gridline $count"\
-	-window    $frm \
-	-drawcross auto  
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check gridcolor gridborder gridsize gridorigin griddraw gridgeod \
-    			borderdraw textdraw rhumbdraw rhumbcoor geoddraw geodcoor geodcolor \
-    			geodtxtcolor} 
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 304
gui/tcltk/gis.m/group.tcl

@@ -1,304 +0,0 @@
-###############################################################
-# group.tcl - group layer creation and management procedures 
-# for GRASS GIS Manager
-# January 2006 Michael Barton, Arizona State University
-###############################################################
-
-namespace eval GmGroup {
-    variable array opt 
-    variable count 1 
-    variable array tree # mon
-    variable nvelev ""
-    variable nvcolor ""
-    variable nvpoints ""
-    variable nvlines ""
-}
-
-
-proc GmGroup::create { tree parent } {
-    variable opt
-    variable count 
-
-    set fon [font create -size 10]
-    set frm [ frame .groupicon$count ]
-    set check [checkbutton $frm.check -text "" -font $fon \
-		-variable GmGroup::opt($count,_check) \
-		-height 1]
-    set image [label $frm.image -image [Bitmap::get folder] ]
-    pack $check $image -side left
-
-    set node "group:$count"
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-		-text      "group $count" \
-		-window    $frm \
-		-drawcross auto \
-        -open 1
-	
-    set opt($count,_check) 1
-    set opt($count,treeimagepath) $image
-
-    incr count
-
-    return $node
-}
-
-proc GmGroup::save { tree depth node } {
-    variable opt
-	global mon
-	
-    if { $node != "root" } {
-		set id [GmTree::node_id $node] 
-		GmTree::rc_write $depth _check $opt($id,_check)
-    }
-    
-    foreach n [$tree nodes $node] {
-        GmTree::save_node $depth $n
-    }
-
-}
-
-proc GmGroup::display { node mod } {
-    variable opt
-    variable tree
-    global mon
-    global drawprog
-    global commandlist
-    set commandlist {}
-
-    set tree($mon) $GmTree::tree($mon)
-	set layers ""
-
-    if { $node != "root" } {
-		set id [GmTree::node_id $node] 
-        if { ! ( $opt($id,_check) ) } { return }
-    }
-
-    #invert layer list to put first tree node as top map layer
-    foreach n [$tree($mon) nodes $node] {
-	    set layers [linsert $layers 0 $n]
-    }
-    
-    # display each node/layer
-    foreach n $layers {
-        GmTree::display_node $n $mod
-        incr drawprog
-    }
-
-}
-
-###############################################################################
-
-# display background maps for digitizing in v.digit
-proc GmGroup::vdigit_display { vectmap } {
-    variable opt
-    variable tree
-    variable bg_command 
-    global mon
-    global drawprog
-    global commandlist
-
-    set bg_command ""
-    
-    # display selected layers to create a display command list if needed
-    if {[llength $commandlist] == 0} {
-            MapCanvas::request_redraw $mon 1
-            vwait commandlist
-    }
-    
-    # if the layer being digitized is the only one displayed, then don't
-    # make it a background layer too. This avoids a black background.
-    set mapname [lindex [split [lindex [split [lindex $commandlist 0] ] 1] =] 1]
-    
-    if {[llength $commandlist] == 1 && $mapname == $vectmap} {
-        return $bg_command
-    }
-
-    # add each command in display command list to background commands
-    foreach cmd $commandlist {
-            append bg_command "$cmd;"
-    }
-    
-            
-    # get rid of the ; at the end of the background command list
-    set bg_command [string trimright $bg_command ";"]
-    
-    return $bg_command
-				
-}
-
-
-###############################################################################
-
-proc GmGroup::nvdisplay { node } {
-    variable opt
-    variable tree
-    variable nvelev 
-    variable nvcolor
-    variable nvpoints
-    variable nvlines
-    global mon
-    global drawprog
-    global devnull
-    #global commandlist
-
-    #
-    #if {[llength $commandlist] == 0} {
-    #    MapCanvas::request_redraw $mon 1
-    #    vwait commandlist
-    #}
-
-    set tree($mon) $GmTree::tree($mon)
-    if { $node != "root" } {
-        set id [GmTree::node_id $node] 
-        if { ! ( $opt($id,_check) ) } { return }
-    }
-
-    foreach n [$tree($mon) nodes $node] {
-        GmGroup::nviz $n
-        incr drawprog
-    }
-
-    if { $nvelev!= "" } {
-        set cmd [list nviz elevation=$nvelev color=$nvcolor]
-        if {$nvlines != ""} {
-            lappend cmd vector=$nvlines
-        }
-        if {$nvpoints != ""} {
-            lappend cmd points=$nvpoints
-        }
-        
-        if {[catch {eval exec "$cmd 2> $devnull &"} error]} {
-            GmLib::errmsg $error
-        }
-    } else {
-        return
-    }
-
-    set nvelev ""
-    set nvcolor ""
-    set nvlines ""
-    set nvpoints ""
-}
-
-
-# display raster maps in NVIZ (base maps for elevation and drape maps for color)
-proc GmGroup::nviz { node } {
-    variable opt
-    variable tree
-    variable nvelev 
-    variable nvcolor
-    variable nvpoints
-    variable nvlines
-    global mon
-    global drawprog
-    global devnull
-            
-    #set id [GmTree::node_id $node] 
-    set vect ""
-    set vecttype ""
-    set type [GmTree::node_type $node]
-    
-    switch $type {
-        "group" {
-           GmGroup::nvdisplay $node 
-        }
-        "raster" {
-            set surf [GmRaster::addelev $node]
-            if {$surf == ""} {return}
-            set clr [GmRaster::addcolor $node]
-            if {$clr == ""} {set clr $surf}
-
-            # test whether surf and clr are valid files
-            if {[catch {set rexist [eval exec "r.info map=$surf 2> $devnull"]} error]} {
-                return
-            } else {
-                if { $rexist == "" } {return}
-            }
-
-            if {[catch {set rexist [eval exec "r.info map=$clr 2> $devnull"]} error]} {
-                set clr $surf
-            } else {
-                if {$rexist == "" } {set clr $surf}
-            }
-
-            # add surf and clr to list of maps to display in nviz
-            if {$nvelev == "" } {
-                set nvelev $surf
-            } else {
-                append nvelev ",$surf"
-            }
-                    
-            if {$nvcolor == "" } {
-                set nvcolor $clr
-            } else {
-                append nvcolor ",$clr"
-            }
-        }
-        "vector" {
-            set vect [GmVector::addvect $node]
-            if {$vect == ""} {return}
-            
-            # test whether vect is a valid file
-            if {[catch {set vexist [eval exec "v.info map=$vect 2> $devnull"]} error]} {
-                return
-            } else {
-                if {$vexist != ""} {
-                    set vecttype [GmVector::vecttype $vect]
-                } else {
-                    return
-                }
-            }
-                        
-            if {$vecttype == "points"} {
-                # display vector in nviz as points
-                if {$nvpoints == "" } {
-                    set nvpoints $vect
-                } else {
-                    append nvpoints ",$vect"
-                }
-            } else {
-                # display vector in nviz as lines
-                if {$nvlines == "" } {
-                    set nvlines $vect
-                } else {
-                    append nvlines ",$vect"
-                }
-            }
-        }
-    }
-}
-
-
-###############################################################################
-proc GmGroup::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
- 
-    set opt($id,$key) $value
-}
-
-proc GmGroup::open { id } {
-    variable opt
-
-    $GmGroup::opt($id,treeimagepath) configure -image [Bitmap::get openfold]
-
-}
-
-proc GmGroup::close { id } {
-    variable opt
-
-    $GmGroup::opt($id,treeimagepath) configure -image [Bitmap::get folder]
-}
-
-proc GmGroup::duplicate { tree parent_node sel id } {
-    puts "Duplicate for Groups not yet implemented."
-}

+ 0 - 376
gui/tcltk/gis.m/histogram.tcl

@@ -1,376 +0,0 @@
-##########################################################################
-# histogram.tcl - raster histogram display layer options file for GRASS GIS Manager
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmHist {
-    variable array opt # hist current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # histogram
-    variable array lfilemask # histogram
-    variable optlist
-    variable first
-    variable array dup # layer
-}
-
-proc GmHist::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-    global mon
-    global iconpath
-
-    set node "histogram:$count"
-
-    set frm [ frame .histicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmHist::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo hico -file "$iconpath/module-d.histogram.gif"
-    set ico [label $frm.ico -image hico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-        
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "histogram $count"\
-	-window    $frm \
-	-drawcross auto  
-    
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-    
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    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,font) "" 
-    set opt($count,1,nsteps) 255 
-    set opt($count,1,nulls) 0 
-    
-    set opt($count,1,mod) 1
-    set first 1
-
-	set optlist {_check map opacity color bgcolor style font nsteps nulls}
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}
-
-proc GmHist::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-##########################################################################
-proc GmHist::select_map { id } {
-    variable tree
-    variable node
-    global mon
-    
-    set m [GSelect cell title [G_msg "Raster map for histogram"] parent "."]
-    if { $m != "" } { 
-        set GmHist::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "histogram of %s"] $m]
-    }
-}
-
-##########################################################################
-proc GmHist::set_font { id } {
-	variable opt
-	
-	if {$GmHist::opt($id,1,font) != "" } {
-		set Gm::dfont $GmHist::opt($id,1,font)
-	}
-	Gm::defaultfont dhist
-	tkwait variable Gm::dfont
-	set GmHist::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-
-
-}
-
-##########################################################################
-# display histogram options
-proc GmHist::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Draw histogram of values from raster map or image"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmHist::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # raster name for histogram
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Raster to histogram: "]
-    Button $row.b -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmHist::select_map $id"
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmHist::opt($id,1,map)
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q d.histogram" \
-		-background $bgcolor -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # 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"} 
-    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  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmHist::set_font $id"
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # color
-    set row [ frame $frm.color ]
-    Label $row.a -text [G_msg "Histogram color: text & frame"]
-    SelectColor $row.b -type menubutton -variable GmHist::opt($id,1,color) 
-    Label $row.c -text [G_msg "  background"] 
-    SelectColor $row.d -type menubutton -variable GmHist::opt($id,1,bgcolor)
-    Label $row.e -text "  " 
-    checkbutton $row.f -text [G_msg "transparent background"] \
-    	-variable GmHist::opt($id,1,bgcolor_none) 
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-    
-    # steps for fp maps and nulls
-    set row [ frame $frm.steps ]
-    Label $row.a -text [G_msg "Steps/bins for values (fp maps only)"]
-    SpinBox $row.b -range {2 255 1} -textvariable GmHist::opt($id,1,nsteps) \
-		-width 4 -helptext "steps/bins"  
-    Label $row.c -text "   "
-    checkbutton $row.d -text [G_msg "include null values"] \
-        -variable GmHist::opt($id,1,nulls) 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-}
-
-##########################################################################
-proc GmHist::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-         GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-##########################################################################
-proc GmHist::display { node mod } {
-    global mon
-    global env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    variable first
-
-    set rasttype ""
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return } 
-    
-	set color [GmLib::color $opt($id,1,color)]
-    set bgcolor [GmLib::color $opt($id,1,bgcolor)]
-
-    # transparent background color
-    if { $opt($id,1,bgcolor_none) == 1 } { 
-        set bgcolor "none"
-    }
-
-    set cmd "d.histogram --q map=$opt($id,1,map) style=$opt($id,1,style) \
-    	color=$color bgcolor=$bgcolor"
-
-    # include nulls
-    if { $opt($id,1,nulls) } { 
-        append cmd " -n"
-    }
-
-    # set steps
-    if { $opt($id,1,nsteps) != "" } { 
-		catch {set rt [open "|r.info map=$opt($id,1,map) -t" r]}
-		set rasttype [read $rt]
-		if {[catch {close $rt} error]} {
-			GmLib::errmsg $error [G_msg "r.info error"]
-		}
-		if {[regexp -nocase ".=FCELL" $rasttype] || [regexp -nocase ".=DCELL" $rasttype]} {
-            append cmd " nsteps=$opt($id,1,nsteps)"
-        }
-	}
-
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-
-    # set grass font environmental variable to user selection"
-	if { $GmHist::opt($id,1,font) != ""} { set env(GRASS_FONT) $GmHist::opt($id,1,font) }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-
-}
-    
-##########################################################################
-proc GmHist::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    global mapname
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-
-    if { $opt($id,1,map) == "" } { return } 
-    
-    set mapname $opt($id,1,map)
-    return $mapname
-}
-
-##########################################################################
-proc GmHist::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	variable first
-	global iconpath
-
-    set node "hist:$count"
-	set dup($count) 1
-    set first 1
-
-    set frm [ frame .histicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmHist::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo hico -file "$iconpath/module-d.histogram.gif"
-    set ico [label $frm.ico -image hico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
- 	   $tree insert $sellayer $parent $node \
-		-text      "histogram $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "histogram for $opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist {_check map color style nsteps nulls}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

二进制
gui/tcltk/gis.m/intro.gif


+ 0 - 287
gui/tcltk/gis.m/labels.tcl

@@ -1,287 +0,0 @@
-##########################################################################
-# labels.tcl - vector labels layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmLabels {
-    variable array opt # labels current options
-    variable count 1
-    variable array tree # mon    
-    variable array lfile # labels
-    variable array lfilemask # labels
-    variable optlist
-    variable array dup # layer
-}
-
-
-proc GmLabels::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-	variable dup
-    global mon
-    global iconpath
-
-    set node "labels:$count"
-
-    set frm [ frame .labelsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmLabels::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo labels_ico -file "$iconpath/module-d.labels.gif"
-    set ico [label $frm.ico -image labels_ico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text      "labels $count" \
-	-window    $frm \
-	-drawcross auto 
-
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,minreg) "" 
-    set opt($count,1,maxreg) "" 
-    set opt($count,1,ignore_rot) 0 
-    set opt($count,1,mod) 1
-
-	set optlist { _check map opacity minreg maxreg}
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-proc GmLabels::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmLabels::select_labels { id } {
-    set m [GSelect paint/labels title [G_msg "Labels for vectors"] parent "."]
-    if { $m != "" } { 
-        set GmLabels::opt($id,1,map) $m
-        GmTree::autonamel $m
-    }
-}
-
-# display labels options
-proc GmLabels::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Display labels for vector objects (created with v.label)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmLabels::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # labels name
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Labels file:"]
-    Button $row.b -image [image create photo -file "$iconpath/module-d.labels.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "labels file to display"] \
-		-command "GmLabels::select_labels $id"
-    Entry $row.c -width 40 -text "$opt($id,1,map)" \
-		-textvariable GmLabels::opt($id,1,map) 
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q d.labels" \
-		-background $bgcolor \
-		-helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # display only in limited region size range
-    set row [ frame $frm.region ]
-    Label $row.a -text [G_msg "Display constraints:"]
-    LabelEntry $row.b -label [G_msg "min"] -textvariable GmLabels::opt($id,1,minreg) \
-            -width 8 
-    LabelEntry $row.c -label [G_msg "max"] -textvariable GmLabels::opt($id,1,maxreg) \
-            -width 8 
-    Label $row.d -text [G_msg "region size"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # ignore rotation
-    set row [ frame $frm.ignore_rot ]
-    checkbutton $row.a -text [G_msg " ignore rotation setting and draw horizontally"] -variable \
-        GmLabels::opt($id,1,ignore_rot) 
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # launch v.label
-    set row [ frame $frm.vlabel ]
-    Label $row.a -text [G_msg "Launch v.label to create labels file"]
-    Button $row.b -text [G_msg "v.label"] \
-	    -command "execute v.label"
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-}
-
-proc GmLabels::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-proc GmLabels::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-    
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-    if { $opt($id,1,map) == "" } { return } 
-
-    set cmd "d.labels labels=$opt($id,1,map)"
-
-    if { $opt($id,1,minreg) != "" } { 
-        append cmd " minreg=$opt($id,1,minreg)"
-    }
-    if { $opt($id,1,maxreg) != "" } { 
-        append cmd " maxreg=$opt($id,1,maxreg)"
-    }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-
-proc GmLabels::query { node } {
-    puts "Query not supported for Paint labels layer"
-}
-
-proc GmLabels::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-
-    set node "labels:$count"
-	set dup($count) 1
-
-    set frm [ frame .labelsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmLabels::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo labels_ico -file "$iconpath/module-d.labels.gif"
-    set ico [label $frm.ico -image labels_ico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-	
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "labels $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "$opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check map minreg maxreg}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 514
gui/tcltk/gis.m/legend.tcl

@@ -1,514 +0,0 @@
-##########################################################################
-# legend.tcl - raster legend layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmLegend {
-    variable array opt ;# legend current options
-    variable count 1
-    variable array lfile ;# raster
-    variable array lfilemask ;# raster
-    variable optlist
-    variable array dup ;# vector
-    variable llcorner
-}
-
-
-###############################################################################
-# create new legend layer
-proc GmLegend::create { tree parent } {
-    variable opt
-    variable count
-    variable lfile
-    variable lfilemask
-    variable optlist
-    variable first
-	variable dup
-    
-
-    set node "legend:$count"
-	set dup($count) 1
-
-    set frm [ frame .legendicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmLegend::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    set ico [label $frm.ico -bd 1 -relief raised -text "Leg"]
-    icon_configure $ico module d.legend
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-    
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "legend $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,color) "black" 
-    set opt($count,1,lines) 0 
-    set opt($count,1,thin) 1 
-    set opt($count,1,font) "" 
-    set opt($count,1,mouseset) 0
-    set opt($count,1,labelnum) 5 
-    set opt($count,1,at) "5,90" 
-    set opt($count,1,height) 80
-    set opt($count,1,width) 5 
-    set opt($count,1,use) "" 
-    set opt($count,1,range) "" 
-    set opt($count,1,nolbl) 0 
-    set opt($count,1,noval) 0 
-    set opt($count,1,skip) 0 
-    set opt($count,1,smooth) 0 
-    set opt($count,1,flip) 0 
-    set opt($count,1,mod) 1
-    
-	set optlist { _check map opacity color lines thin labelnum at height width \
-             font mouseset use range nolbl noval skip smooth flip}
-             
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmLegend::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-##########################################################################
-proc GmLegend::set_font { id } {
-	variable opt
-	
-	if {$GmLegend::opt($id,1,font) != "" } {
-		set Gm::dfont $GmLegend::opt($id,1,font)
-	}
-	Gm::defaultfont dlegend
-	tkwait variable Gm::dfont
-	set GmLegend::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-
-
-}
-
-##########################################################################
-
-proc GmLegend::mouseset { id } {
-	# use mouse to set scalebar placement coordinates
-	global mon pctentry
-	variable llcorner 
-	variable opt
-
-	if { $GmLegend::opt($id,1,mouseset) == 1 } {
-		set pctentry $GmLegend::llcorner
-	} else {
-		set pctentry ""
-	}
-
-}
-
-###############################################################################
-# select raster map
-proc GmLegend::select_map { id } {
-    variable tree
-    variable node
-    set m [GSelect cell title [G_msg "Raster map for legend"] parent "."]
-    if { $m != "" } { 
-        set GmLegend::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "legend for %s"] $m]
-    }
-}
-
-# Calculate optimal legend height for CELL maps
-proc GmLegend::getoptimalvsize { varname key op } {
-	upvar #0 $varname var
-	set numclass 0
-	
-	if {[string length $var($key)] > 0} {
-		if {![catch {open "|r.info -t map=$var($key)" r} iinput]} {
-			while {[gets $iinput iline] >= 0} {
-				if {[string equal "datatype=CELL" "$iline"]} {
-					if {![catch {open "|r.describe -1 -n --q map=$var($key)" r} dinput]} {
-						while {[gets $dinput dline] >= 0} {
-							incr numclass
-						}
-					}
-				}
-			}
-		}
-		if {$numclass > 0} {
-			set hg [expr {$numclass * 7}]
-			if {$hg > 80} {
-				set GmLegend::opt([string index $key 0],1,height) 80
-			} else {
-				set GmLegend::opt([string index $key 0],1,height) $hg
-			}
-		}
-	}
-}
-
-###############################################################################
-# legend options
-proc GmLegend::options { id frm } {
-    variable opt
-    variable llcorner
-    global bgcolor
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display legend for raster map using cat values and labels"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmLegend::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-    
-    # raster name
-    set row [ frame $frm.map ]
-    Label $row.a -text [G_msg "Raster map: "]
-    Button $row.b -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmLegend::select_map $id"
-	icon_configure $row.b element cell
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmLegend::opt($id,1,map) 
-	trace add variable GmLegend::opt($id,1,map) write GmLegend::getoptimalvsize
-    
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-            -command "spawn g.manual --q d.legend" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-	icon_configure $row.e gui help
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # size and location
-    set row [ frame $frm.at1 ]
-    Label $row.a -text [G_msg "Legend placement and size as 0-100% of display"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # at
-    set row [ frame $frm.at2 ]
-    Label $row.a -text [G_msg "    x,y of lower left corner (in % from display top left)"]
-    set llcorner [LabelEntry $row.b -width 8 \
-    	-textvariable GmLegend::opt($id,1,at)]
-    checkbutton $row.c -text [G_msg "place with mouse"] \
-    	-variable GmLegend::opt($id,1,mouseset) \
-    	-command "GmLegend::mouseset $id"
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-    
-    # size
-    set row [ frame $frm.size ]
-    Label $row.a -text [G_msg "    legend height "]
-    SpinBox $row.b -range {0 100 1} -textvariable GmLegend::opt($id,1,height) \
-		 -width 5 -helptext [G_msg "Legend height (% of display)"]
-    Label $row.c -text [G_msg "%  width"]
-    SpinBox $row.d -range {0 100 1} -textvariable GmLegend::opt($id,1,width) \
-		 -width 5 -helptext [G_msg "Legend width (% of display)"]
-    Label $row.e -text "%" 
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # text
-    set row [ frame $frm.color ]
-    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"}
-    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"] \
-	    -command "GmLegend::set_font $id"
-	icon_configure $row.d gui font
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # no category labels or numbers
-    set row [ frame $frm.cats ]
-    Label $row.a -text "    " 
-    checkbutton $row.b -text [G_msg "do not display labels"] -variable \
-        GmLegend::opt($id,1,nolbl) 
-    checkbutton $row.c -text [G_msg "do not display values"] -variable \
-        GmLegend::opt($id,1,noval) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # display lines
-    set row [ frame $frm.lines ]
-    Label $row.a -text [G_msg "    number of lines (0=display all):"]
-    SpinBox $row.b -range {0 1000 1} -textvariable GmLegend::opt($id,1,lines) \
-		 -width 5 -helptext [G_msg "Lines to display"]
-    Label $row.c -text "  " 
-    checkbutton $row.d -text [G_msg "invert legend"] -variable \
-        GmLegend::opt($id,1,flip) 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # thin
-    set row [ frame $frm.thin ]
-    Label $row.a -text [G_msg "    interval between categories (integer maps)"] 
-    SpinBox $row.b -range {1 1000 1} -textvariable GmLegend::opt($id,1,thin) \
-		 -width 5 -helptext [G_msg "Thinning interval"]
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-    
-    # labelnum
-    set row [ frame $frm.labelnum ]
-    Label $row.a -text "  " 
-    checkbutton $row.b -text [G_msg "draw smooth gradient (fp maps)"] -variable \
-        GmLegend::opt($id,1,smooth) 
-    Label $row.c -text [G_msg "with maximum of"]
-    SpinBox $row.d -range {2 100 1} -textvariable GmLegend::opt($id,1,labelnum) \
-                    -width 4 -helptext [G_msg "Maximum lines to display for gradient"]
-    Label $row.e -text [G_msg "lines"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-            
-	# display subset of values
-    set row [ frame $frm.subset ]
-    Label $row.a -text [G_msg "Display legend for subset of raster values"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # skip
-    set row [ frame $frm.opts ]
-    Label $row.a -text "  " 
-    checkbutton $row.b -text [G_msg "skip categories with no labels"] -variable \
-        GmLegend::opt($id,1,skip) 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # use cats
-    set row [ frame $frm.use ]
-    Label $row.a -text [G_msg "    legend for only these categories     "]
-    LabelEntry $row.b -textvariable GmLegend::opt($id,1,use) -width 28
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-    
-    # range
-    set row [ frame $frm.range ]
-    Label $row.a -text [G_msg "    legend for only this range of values"]
-    LabelEntry $row.b -textvariable GmLegend::opt($id,1,range) -width 28
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-	set opt($id,1,mod) "1"
-}
-
-###############################################################################
-#save legend layer to  grc file
-proc GmLegend::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-
-###############################################################################
-# render and composite legend layer
-proc GmLegend::display { node mod } {
-    global mon
-    global env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-
-    set line ""
-    set input ""
-    set cmd ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-    
-	set atlist [split $opt($id,1,at) ","]
-	set x1 [lindex $atlist 0]
-	set y1 [expr 100 - [lindex $atlist 1]]
-	
-	set placement "$y1,[expr $y1+$opt($id,1,height)],$x1,[expr $x1+$opt($id,1,width)]"
-
-    if { $opt($id,1,map) == "" } { return } 
-    set cmd "d.legend map=$opt($id,1,map) color=$opt($id,1,color) \
-            lines=$opt($id,1,lines) thin=$opt($id,1,thin) \
-            labelnum=$opt($id,1,labelnum) at=$placement"
-
-    # use cats
-    if { $opt($id,1,use) != "" } { 
-        append cmd " use=$opt($id,1,use)"
-    }
-
-    # range
-    if { $opt($id,1,range) != "" } { 
-        append cmd " range=$opt($id,1,range)"
-    }
-
-    # nolbl
-    if { $opt($id,1,nolbl) != 0 } { 
-        append cmd " -v"
-    }
-
-    # noval
-    if { $opt($id,1,noval) != 0 } { 
-        append cmd " -c"
-    }
-
-    # skip
-    if { $opt($id,1,skip) != 0} { 
-        append cmd " -n"
-    }
-
-    # smooth
-    if { $opt($id,1,smooth) != 0 } { 
-        append cmd " -s"
-    }
-        
-    # flip
-    if { $opt($id,1,flip) != 0 } { 
-        append cmd " -f"
-    }
-    
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-
-    # set grass font environmental variable to user selection"
-	if { $GmLegend::opt($id,1,font) != ""} { set env(GRASS_FONT) $GmLegend::opt($id,1,font) }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd 
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-
-}
-
-
-###############################################################################
-# duplicate legend layer
-proc GmLegend::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-
-    set node "legend:$count"
-
-    set frm [ frame .legendicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmLegend::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    set ico [label $frm.ico -bd 1 -relief raised -text "Leg"]
-    icon_configure $ico module d.legend
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
- 
-    pack $check $ico -side left
-
-	# where to insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "legend $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "legend for $opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check map opacity color lines thin labelnum at height width \
-             mouseset use range nolbl noval skip smooth flip}
-             
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

文件差异内容过多而无法显示
+ 0 - 2027
gui/tcltk/gis.m/mapcanvas.tcl


+ 0 - 608
gui/tcltk/gis.m/maplabels.tcl

@@ -1,608 +0,0 @@
-##########################################################################
-# maplabels.tcl - options panel for TclTk postscript labels layer for GRASS GIS Manager
-# April 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-#
-# TODO - Bugs and missing features. Maris Nartiss, 14.02.2007.
-#	(with comments by CM Barton 29 4 2007
-#	* Not all label file options are in use, also not all options are in labelfiles.
-#	(because this is TclTk text, v.label options don't exactly map onto what is available
-#	 in TclTk. AFAICT, all possible matches are implemented)
-#	* Label configuration options are not separated from displayed label options. It causes
-#	label options to change after every screen redraw. This way it was already working :)
-#	(Unless you check the "override" box, it will default to the values in the labels file.
-#	 I fixed a few that might not have been sticking also - CMB)
-#	* Ability to override single option. Like: use whatever defined in labelfile, except font size
-# 	(Agreed. A TODO if there is time. Needs substantial reconfiguration of options panel)
-#	* Label rotation. (not available in TclTk - CMB)
-#	* Somtime label enclosing box height is not calculated correctly. 
-#	* Ability to display label point and configure it. (I don't understand this)
-#
-
-namespace eval GmCLabels {
-    variable array opt ;# labels current options
-    variable count 1
-    variable array tree ;# mon    
-    variable optlist
-    variable array dup ;# layer
-}
-
-
-proc GmCLabels::create { tree parent } {
-    variable opt
-    variable count
-    variable optlist
-	variable dup
-    global mon
-    global iconpath
-
-    set node "clabels:$count"
-
-    set frm [ frame .clabelsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCLabels::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo clabels_ico -file "$iconpath/gui-maplabels.gif"
-    set ico [label $frm.ico -image clabels_ico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text      "PS labels $count" \
-	-window    $frm \
-	-drawcross auto 
-
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,xcoord) 1.0 
-    set opt($count,1,ycoord) 1.0 
-    set opt($count,1,xoffset) 0.0
-    set opt($count,1,yoffset) 15.0 
-    set opt($count,1,labels) "" 
-    set opt($count,1,lfont) [font create "labelfont$count" -family "Helvetica" -size 11 -weight "normal"]
-    set opt($count,1,lfontfamily) "Helvetica"
-    set opt($count,1,lfontsize) 11
-    set opt($count,1,lfontweight) "normal"
-    set opt($count,1,lfontslant) "roman"
-    set opt($count,1,lfontunderline) 0
-    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,ljust) "left" 
-    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
-    set opt($count,1,lopaque) "yes"
-    set opt($count,1,lboxbenable) "yes"
-    set opt($count,1,lborder) "black"
-    set opt($count,1,lbackground) "yellow"
-    set opt($count,1,lbwidth) 1
-    set opt($count,1,lboxlenable) 1
-    set opt($count,1,override) 0
-
-	set optlist { _check xcoord ycoord xoffset yoffset labels lfont lfontfamily lfontsize \
-		lfontweight lfontslant lfontunderline lfontoverstrike lfill lwidth \
-		lanchor ljust ltxt lhoffset lvoffset lopaque lboxbenable lborder lbackground \
-		lbwidth lboxlenable override }
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-        
-    incr count
-    return $node
-}
-
-proc GmCLabels::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmCLabels::select_labels { id } {
-    set m [GSelect paint/labels title "Label file"]
-    if { $m != "" } { 
-        set GmCLabels::opt($id,1,labels) $m
-        GmTree::autonamel $m
-    }
-}
-
-proc GmCLabels::select_font { id frm } {
-	global mon
-	variable opt
-	set fon ""
-    
-	set fon [SelectFont $frm.lfon -font $opt($id,1,lfont) -type dialog \
-		-sampletext [G_msg "This is font sample text."] -title [G_msg "Select label font"]]
-
-	if { $fon != "" } {
-		set opt($id,1,lfontfamily)	[lindex $fon 0]
-		set opt($id,1,lfontsize)	[lindex $fon 1]
-		if {[lsearch $fon "bold"]>=0} 	{ set opt($id,1,lfontweight) "bold" }
-		if {[lsearch $fon "italic"]>=0} { set opt($id,1,lfontslant) "italic"}
-		if {[lsearch $fon "underline"]>=0}  { set opt($id,1,lfontunderline) 1}
-		if {[lsearch $fon "overstrike"]>=0} { set opt($id,1,lfontoverstrike) 1}
-		
-		font configure $opt($id,1,lfont) -family $opt($id,1,lfontfamily) -size $opt($id,1,lfontsize)\
-		-weight $opt($id,1,lfontweight) -slant $opt($id,1,lfontslant) \
-		-underline $opt($id,1,lfontunderline) -overstrike $opt($id,1,lfontoverstrike)
-	}
-}
-
-# display labels options
-proc GmCLabels::options { id frm } {
-    variable opt
-    global iconpath
-
-    # Panel heading1
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Create postscript labels for vector objects from v.labels file"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # Panel heading2
-    set row [ frame $frm.heading2 ]
-    Label $row.a -text [G_msg "  (for postscript eps, pdf, and print output only)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # labels name
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Labels file:"]
-    Button $row.b -image [image create photo -file "$iconpath/gui-maplabels.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "labels file to display"] \
-		-command "GmCLabels::select_labels $id"
-    Entry $row.c -width 40 -text "$opt($id,1,labels)" \
-		-textvariable GmCLabels::opt($id,1,labels)
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # override
-    set row [ frame $frm.disp ]
-    Label $row.a -text [G_msg "Override offset, alignment, and color settings in v.labels file: "]
-    checkbutton $row.b -variable GmCLabels::opt($id,1,override)
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # labels options1
-    set row [ frame $frm.lblopt1 ]
-    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" }
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-	# label offset
-    set row [ frame $frm.offset ]
-    Label $row.a -text [G_msg "Offset label from vector object: "] 
-    LabelEntry $row.b -label [G_msg "x offset"] \
-    	-textvariable GmCLabels::opt($id,1,xoffset) \
-		-width 10
-    LabelEntry $row.c -label [G_msg "y offset"] \
-    	-textvariable GmCLabels::opt($id,1,yoffset) \
-		-width 10
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # labels options2
-    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"}
-    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
-    pack $row -side top -fill both -expand yes
-    
-# labels options3
-    set row [ frame $frm.lbltopt3 ]
-    Label $row.a -text [G_msg "Enclose label in box: "] 
-    checkbutton $row.b -variable GmCLabels::opt($id,1,lboxenable)
-    	$row.b select
-    Label $row.c -text [G_msg "Draw label background: "] 
-    checkbutton $row.d -variable GmCLabels::opt($id,1,lopaque) \
-   	-command " if { $opt($id,1,lopaque) } { set opt($id,1,lboxenable) 1 } else { set opt($id,1,lboxenable) 0 }"
-    	$row.d select
-    Label $row.e -text [G_msg "Background color:"] 
-    SelectColor $row.f -type menubutton -variable GmCLabels::opt($id,1,lbackground)
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-        
-# labels options4
-    set row [ frame $frm.lbltopt4 ]
-    Label $row.a -text [G_msg "Draw box outline: "] 
-    checkbutton $row.b -variable GmCLabels::opt($id,1,lboxbenable) \
-    -command " if { $opt($id,1,lboxbenable) } { set opt($id,1,lboxenable) 1 } else { set opt($id,1,lboxenable) 0 }"
-    	$row.b select
-    Label $row.c -text [G_msg "Border width:"]
-    Entry $row.d -width 3 -text "$opt($id,1,lbwidth)" \
-	    -textvariable GmCLabels::opt($id,1,lbwidth)
-    Label $row.e -text [G_msg "Border color:"] 
-    SelectColor $row.f -type menubutton -variable GmCLabels::opt($id,1,lborder)
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-        
-# labels options5
-    set row [ frame $frm.lbltopt5 ]
-    Label $row.a -text [G_msg "Distance between label and enclosing box. Horizontal: "] 
-    Entry $row.b -width 3 -text "$opt($id,1,lhoffset)" \
-	    -textvariable GmCLabels::opt($id,1,lhoffset)  
-    Label $row.c -text [G_msg " Vertical: "]
-    Entry $row.d -width 3 -text "$opt($id,1,lvoffset)" \
-	    -textvariable GmCLabels::opt($id,1,lvoffset)  
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-        
-    # select font
-    set row [ frame $frm.font ]
-    Label $row.a -text [G_msg "Font"] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for label"] \
-	    -command "GmCLabels::select_font $id $frm"
-    Label $row.c -text [G_msg "family:"]
-    Entry $row.d -width 15 -text GmCLabels::opt($id,1,lfontfamily) \
-	    -textvariable GmCLabels::opt($id,1,lfontfamily)
-    Label $row.e -text [G_msg "size:"]
-    Entry $row.f -width 5 -text GmCLabels::opt($id,1,lfontsize) \
-	    -textvariable GmCLabels::opt($id,1,lfontsize)
-    Label $row.g -text [G_msg "  color"] 
-    SelectColor $row.h -type menubutton -variable GmCLabels::opt($id,1,lfill)
-    pack $row.a $row.b $row.c $row.d  $row.e $row.f $row.g $row.h -side left
-    pack $row -side top -fill both -expand yes
-
-    # launch v.label
-    set row [ frame $frm.vlabel ]
-    Label $row.a -text [G_msg "Launch v.label to create labels file"]
-    Button $row.b -text [G_msg "v.label"] \
-	    -command "execute v.label"
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-}
-
-proc GmCLabels::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-proc GmCLabels::display { node } {
-    global mon
-    global env
-    variable optlist
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-    
-    if {$opt($id,1,labels) == "" } {return}
-    
-    set can($mon) $MapCanvas::can($mon)
-    if {[string match {*[@]*} $opt($id,1,labels)]} { 
-		set labelfname [string range $opt($id,1,labels) 0 [expr [string first "@" $opt($id,1,labels)] - 1] ]
-		set labelmname [string range $opt($id,1,labels) [expr [string first "@" $opt($id,1,labels)] + 1] [string length $opt($id,1,labels)] ]
-		set labelpath "$env(GISDBASE)/$env(LOCATION_NAME)/$labelmname/paint/labels/$labelfname"
-    } else {
-		set labelpath "$env(GISDBASE)/$env(LOCATION_NAME)/$env(MAPSET)/paint/labels/$opt($id,1,labels)"
-    }
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-    
-    # open the v.label file for reading
-	if { [catch {set labelfile [open $labelpath r]} err ] } {
-		GmLib::errmsg $err [G_msg "Could not open labels file "]
-		return
-	}
-	
-	#loop through coordinates and options for each label
-    while { [gets $labelfile in] > -1 } {
-		set key ""
-		set val ""
-        set in [string trim $in " "] 
-		if { $in == "" } { continue }
-		set key [string trim [lindex [split $in ":"] 0]]
-		set val [string trim [lindex [split $in ":"] 1]]
-
-		# Label options	
-		switch $key {
-			"east" {
-				set east $val
-				set opt($id,1,xcoord) [MapCanvas::mape2scrx $mon $east]
-			}
-			"north" {
-				set north $val
-				set opt($id,1,ycoord) [MapCanvas::mapn2scry $mon $north]
-			}
-			"xoffset" {
-				if { $opt($id,1,override) == 0 } {
-					set opt($id,1,xoffset) $val
-				}
-				if { $opt($id,1,xoffset) != "" } {
-					set opt($id,1,xcoord) [expr $opt($id,1,xcoord) + $opt($id,1,xoffset)]
-				}
-			}
-			"yoffset" {
-				if { $opt($id,1,override) == 0 } {
-					set opt($id,1,yoffset) $val
-				}
-				if { $opt($id,1,yoffset) != "" } {
-					set opt($id,1,ycoord) [expr $opt($id,1,ycoord) + $opt($id,1,yoffset)]
-				}
-			}
-			"ref" {
-				if { $opt($id,1,override) == 0 } {
-					set opt($id,1,lanchor) $val
-				}
-				switch $opt($id,1,lanchor) {
-					"lower left" 	{ set opt($id,1,anchor) "ne"}
-					"left lower" 	{ set opt($id,1,anchor) "ne"}
-					"lower" 		{ set opt($id,1,anchor) "n" }
-					"lower center" 	{ set opt($id,1,anchor) "n" }
-					"center lower" 	{ set opt($id,1,anchor) "n" }
-					"lower right" 	{ set opt($id,1,anchor) "nw"}
-					"right lower" 	{ set opt($id,1,anchor) "nw"}
-					"left" 			{ set opt($id,1,anchor) "e" }
-					"center left" 	{ set opt($id,1,anchor) "e" }
-					"left center" 	{ set opt($id,1,anchor) "e" }
-					"center" 		{ set opt($id,1,anchor) "center" }
-					"right" 		{ set opt($id,1,anchor) "w" }
-					"center right" 	{ set opt($id,1,anchor) "w" }
-					"right center" 	{ set opt($id,1,anchor) "w" }
-					"upper left" 	{ set opt($id,1,anchor) "se"}
-					"left upper" 	{ set opt($id,1,anchor) "se"}
-					"upper" 		{ set opt($id,1,anchor) "s" }
-					"upper center" 	{ set opt($id,1,anchor) "s" }
-					"center upper" 	{ set opt($id,1,anchor) "s" }
-					"upper right" 	{ set opt($id,1,anchor) "sw"}
-					"right upper" 	{ set opt($id,1,anchor) "sw"}
-					default 		{ set opt($id,1,anchor) "w" }
-				}
-			}
-			"font" {
-				# set independently in TclTk
-				set x ""
-			}
-			"color" {
-				if { $opt($id,1,override) == 0 } {
-					set opt($id,1,lfill)  [color_grass_to_tcltk $val]
-				}
-				if { $opt($id,1,lfill) == "" } {
-					set opt($id,1,lfill) "#000000"
-				}
-			}
-			"fontsize" {
-				if { $opt($id,1,override) == 0 } {set opt($id,1,lfontsize) $val}
-			}
-			"width" {
-				if { $opt($id,1,override) == 0 } {set opt($id,1,lbwidth) $val}
-			}
-			"hcolor" {
-				# not available in TclTk
-				set x ""
-			}
-			"hwidth" {
-				# not available in TclTk
-				set x ""
-			}
-			"background" {
-				if { $opt($id,1,override) == 0 } {
-				    if {$val != "none"} {
-    					set opt($id,1,lbackground) [color_grass_to_tcltk $val]
-    				} else {
-    				    set opt($id,1,lbackground) ""
-    				}
-				}
-			}
-			"border" {
-				if { $opt($id,1,override) == 0 } {
-				    if {$val != "none"} {
-    					set opt($id,1,lborder) [color_grass_to_tcltk $val]
-    				} else {
-    				    set opt($id,1,lborder) ""
-    				}
-				}
-			}
-			"opaque" {
-				if { $opt($id,1,override) == 0 } {set opt($id,1,lopaque) $val}
-			}
-			"rotate" {
-				# not available in TclTk
-				set x ""
-			}
-			"size"   {
-				if { $opt($id,1,override) == 0 } {set opt($id,1,lwidth) $val}
-			}
-			"text" {
-				set opt($id,1,ltxt) [subst -nocommands -novariables $val]
-				
-				# check to see if there are line breaks in the text
-				set newlines [expr [llength [split $opt($id,1,ltxt) "\n"]] - 1]
-				
-				# create each label when loop gets to a text line in the labels file
-				# Here should be set all font related options, that come from labelfile
-				if {[info exists opt($id,1,lfontsize)]} {
-					font configure $opt($id,1,lfont) -size $opt($id,1,lfontsize)
-				}
-				
-				# set the label width and height
-				set linelen [font measure $opt($id,1,lfont) $opt($id,1,ltxt)]
-				if {$linelen < $opt($id,1,lwidth)} {
-					set wid [expr $linelen + 8]
-					set lineh [expr $newlines * [font metrics $opt($id,1,lfont) -linespace] + 8]
-				} else {
-					set wid $opt($id,1,lwidth)
-					set lineh [expr $newlines * (ceil($linelen/$opt($id,1,lwidth))+1)\
-					 * [font metrics $opt($id,1,lfont) -linespace] + 8]
-				}
-				if {$opt($id,1,lopaque) != "yes"} {
-					set lbackground ""
-				} else { set lbackground $opt($id,1,lbackground) }
-				if {!$opt($id,1,lboxbenable)} {
-					set wdth 0
-				} else { set wdth $opt($id,1,lbwidth) }
-
-				# create box around text
-				
-				switch $opt($id,1,anchor) {
-					"ne" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) - ($wid-4) / 2}] 
-						set boxcenter_y [expr {$opt($id,1,ycoord) + ($lineh+4) / 2}]
-						}
-					"n" { 
-						set boxcenter_x $opt($id,1,xcoord)
-						set boxcenter_y [expr {$opt($id,1,ycoord) - ($lineh+4) / 2}]
-						}
-					"nw" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) + ($wid-4) / 2}]
-						set boxcenter_y [expr {$opt($id,1,ycoord) + ($lineh+4) / 2}]
-						}
-					"e" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) - ($wid-4) / 2}]
-						set boxcenter_y $opt($id,1,ycoord)
-						}
-					"center" { 
-						set boxcenter_x $opt($id,1,xcoord)
-						set boxcenter_y $opt($id,1,ycoord)
-						}
-					"w" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) + ($wid-4) / 2}]
-						set boxcenter_y $opt($id,1,ycoord)
-						}
-					"se" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) - ($wid-4) / 2}]
-						set boxcenter_y [expr {$opt($id,1,ycoord) - ($lineh+4) / 2}]
-						}
-					"s" { 
-						set boxcenter_x $opt($id,1,xcoord)
-						set boxcenter_y [expr {$opt($id,1,ycoord) - ($lineh+4) / 2}]
-						}
-					"sw" { 
-						set boxcenter_x [expr {$opt($id,1,xcoord) + ($wid-4) / 2}]
-						set boxcenter_y [expr {$opt($id,1,ycoord) - ($lineh+4) / 2}]
-						}
-					default { 
-						set boxcenter_x $opt($id,1,xcoord)
-						set boxcenter_y $opt($id,1,ycoord)
-						}
-				}
-
-				if {$opt($id,1,lboxenable)} { 
-					# draw recangle around label
-					$can($mon) create rectangle \
-						[expr {$boxcenter_x - $opt($id,1,lhoffset) - $wid / 2}] \
-						[expr {$boxcenter_y -2- $opt($id,1,lvoffset) - $lineh / 2}]\
-						[expr {$boxcenter_x + $opt($id,1,lhoffset) + $wid / 2}] \
-						[expr {$boxcenter_y + $opt($id,1,lvoffset) + $lineh / 2}]\
-						-width  $wdth \
-						-outline $opt($id,1,lborder) \
-						-fill $lbackground
-				}
-				$can($mon) create text $opt($id,1,xcoord) $opt($id,1,ycoord) \
-					-anchor $opt($id,1,anchor) \
-					-justify $opt($id,1,ljust) \
-					-width $wid \
-					-fill $opt($id,1,lfill) \
-					-font $opt($id,1,lfont) \
-					-text $opt($id,1,ltxt)
-			} 
-			default {
-				#for anything else, just move on
-				set x ""
-			}
-		}
-	}
-	# close labels file
-	if {[catch {close $labelfile} error]} {
-		GmLib::errmsg $error
-	}
-}
-
-
-proc GmCLabels::query { node } {
-    puts "Query not supported for Paint labels layer"
-}
-
-proc GmCLabels::duplicate { tree parent node id } {
-    variable optlist
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-
-    set node "PS labels:$count"
-	set dup($count) 1
-
-    set frm [ frame .clabelsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCLabels::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo clabels_ico -file "$iconpath/gui-maplabels.gif"
-    set ico [label $frm.ico -image clabels_ico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-	
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,labels) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "clabels $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "$opt($id,1,clabels)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-    incr count
-    return $node
-}

+ 0 - 486
gui/tcltk/gis.m/mapprint.tcl

@@ -1,486 +0,0 @@
-###############################################################
-# mapprint.tcl - GRASS GIS Manager procedures for postscript and
-# lpr printing, and pdf and eps output
-# January 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-
-namespace eval psprint {
-	variable docht
-	variable docwd
-	variable epsfile
-	variable format
-	variable gsdevices
-	variable gsexists
-	variable gspresent
-	variable gsstate
-	variable ldevice
-	variable mbottom
-	variable mleft
-	variable mright
-	variable mtop
-	variable orient
-	variable paper
-	variable paper_preset
-	variable pdffile
-	variable pght
-	variable pgwd
-	variable printer
-	variable printmode
-	variable res
-	variable tmppngfile
-	variable tmpppmfile
-	variable tmppsfile 
-	variable tmpscript 
-	variable PPap 
-	variable PVar 
-	variable PView
-	variable PWid 
-	global array can # mon
-}
-
-
-#initialize variables
-proc psprint::init { } {
-	variable pgwd
-	variable pght
-	variable docwd
-	variable docht
-	variable paper
-	variable paper_preset
-	variable printmode
-	variable printer
-	variable gsexists
-	variable orient
-	variable mleft
-	variable mright
-	variable mtop
-	variable mbottom
-	variable gsstate
-	variable ldevice
-	variable gsdevices
-	variable res
-	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::mleft 1
-	set psprint::mright 1
-	set psprint::mtop 1
-	set psprint::mbottom 1
-	
-	# default is lpr printing
-	set printmode "lpr"
-
-	# check for ghostscript	
-	# switch to native windows version of ghostscript if runing wingrass
-	if { $mingw == 1 } {
-		set cmd "gswin32c"
-	} else {
-		set cmd "gs"
-	}
-
-	#enable additional printing options if Ghostscript available
-	if {![catch {set input [exec $cmd -help]} error]} {
-		regexp ".*Available devices:(.*)Search path:" $input string gsdevices 
-		set gsstate "normal"
-		regsub -all {   } $gsdevices { } gsdevices
-		regsub -all { } $gsdevices \n gsdevices
-		regsub -all \n\n $gsdevices \n gsdevices
-	} else {
-		set gsdevices "none available"
-		set gsstate "disabled"
-		#set printmode "eps"
-		tk_messageBox -type ok -icon error -message [G_msg "Ghostscript not available"]
-	}
-}	
-
-# calculate paper size and document size on paper (all in inches)  
-proc psprint::paper { } {
-	variable paper
-	variable paper_preset
-	variable printmode
-	variable pgwd
-	variable pght
-	variable mleft
-	variable mright
-	variable mtop
-	variable mbottom
-	variable docwd
-	variable docht
-	variable orient
-    
-	# set paper dimensions
-	if { $paper == "preset" } {
-		switch $paper_preset {
-			"11x17" {
-				set pgwd 11
-				set pght 17
-			}
-			"ledger" {
-				set pgwd 17
-				set pght 11
-			}
-			"legal" {
-				set pgwd 8.5
-				set pght 14
-			}
-			"letter" {
-				set pgwd 8.5
-				set pght 11
-			}
-			"a0" {
-				set pgwd 33.0556
-				set pght 46.7778
-			}
-			"a1" {
-				set pgwd 23.3889
-				set pght 33.055
-			}
-			"a2" {
-				set pgwd 16.5278
-				set pght 23.3889
-			}
-			"a3" {
-				set pgwd 11.6944
-				set pght 16.5278 
-			}
-			"a4" {
-				set pgwd 8.26389 
-				set pght 11.6944
-			}
-		}
-	}
-
-	set docwd [expr $pgwd - $mright - $mleft]
-	set docht [expr $pght - $mtop - $mbottom]
-	
-	if { $orient == "landscape" && $printmode == "pdf" } {
-		set docwd [expr $docwd + 2]
-		set docht [expr $docht + 2]
-	} else {
-		set docwd [expr $docwd + 1]
-		set docht [expr $docht + 1]
-	}
-		
-	update
-	
-}
-
-# initialize tmpfiles for poscript printing
-proc psprint::init_tmpfiles { } {
-	variable tmpscript
-	variable tmppsfile
-	variable tmppngfile
-
-	# get temporary file for postscript printing
-	set pid [ pid ]
-	if {[catch {set tmppsfile [ exec g.tempfile pid=$pid ]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-
-	append tmppsfile ".ps"
-	set pid [ pid ]
-    
-	if {[catch {set tmppngfile [ exec g.tempfile pid=$pid ]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	    append tmppngfile ".png"
-}
-
-# show gs printer devices in output window
-proc psprint::show_devices { } {
-	variable gsdevices
-
-	set ah [monitor_annotation_start {} "Ghostscript Output Devices" {}]
-	monitor_annotate $ah $gsdevices
-}
-
-
-# create printer options window
-proc psprint::window { cm cv cx cy } {
-	variable pgwd
-	variable pght
-	variable paper
-	variable paper_preset
-	variable printmode
-	variable printer
-	variable gsexists
-	variable epsfile
-	variable pdffile
-	variable orient
-	variable res
-	variable pgwd
-	variable pght
-	variable mleft
-	variable mright
-	variable mtop
-	variable mbottom
-	variable gspresent
-	variable ldevice
-	variable gsdevices
-	variable gsstate
-	global mon
-	
-	set mon $cm
-	    
-	# check if opened
-	if { [winfo exists .printwin] } {
-		wm deiconify .printwin
-		raise .printwin
-		return
-	}
-	
-	set PW [toplevel .printwin]
-	wm title $PW [G_msg "Postscript and LPR printing of map display"]
-	
-	# Left part paper + output
-	set PWid(left) [ frame $PW.left -padx 5 -pady 5]  
-	pack $PWid(left) -side left -anchor w
-	
-	# paper size, scale
-	set PWid(paper) [ frame $PWid(left).paper]  
-	pack $PWid(paper) -side top -anchor w
-	
-	    # preset paper sizes (from ghostscript)
-	set row [ frame $PWid(paper).row1 ]
-	radiobutton $row.a -variable psprint::paper -value "preset" \
-		-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
-	pack $row.a $row.b $row.c -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# custom paper sizes
-	set row [ frame $PWid(paper).row2 ]
-	radiobutton $row.a -variable psprint::paper -value "custom" \
-		-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
-	Label $row.e -anchor w -text [G_msg "  height:"]
-	Entry $row.f -width 10 -textvariable psprint::pght 
-	pack $row.a $row.b $row.c $row.d $row.e $row.f -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	#margins
-	set row [ frame $PWid(paper).row3]
-	Label $row.a -anchor w -text [G_msg "Margins  left:"]
-	Entry $row.b -width 10 -textvariable psprint::mleft 
-	Label $row.c -anchor w -text [G_msg " right:"] 
-	Entry $row.d -width 10 -textvariable psprint::mright 
-	Label $row.e -anchor w -text [G_msg " top:"]
-	Entry $row.f -width 10 -textvariable psprint::mtop 
-	Label $row.g -anchor w -text [G_msg " bottom:"]
-	Entry $row.h -width 10 -textvariable psprint::mbottom 
-	
-	pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g $row.h -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# portrait or landscape
-	set row [ frame $PWid(paper).row4 ]
-		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" \
-		-text "landscape mode" -highlightthickness 0
-	radiobutton $row.d -variable psprint::orient -value "portrait" \
-		-text "portrait mode  " -highlightthickness 0
-	pack $row.a $row.b $row.c $row.d -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# output options
-	set PWid(output) [ frame $PWid(left).output ]  
-	pack $PWid(output) -side top -anchor w
-	
-	# LPR printer
-	set row [ frame $PWid(output).lpr ]
-	radiobutton $row.a -variable psprint::printmode -value "lpr" \
-		-highlightthickness 0
-	Label $row.b -anchor w -text [G_msg "Print on LPR printer"]
-	pack $row.a $row.b -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# Postscript printer
-	set row [ frame $PWid(output).psprinter ]
-	radiobutton $row.a -variable psprint::printmode -value "psprint" \
-		-state $psprint::gsstate -highlightthickness 0
-	Label $row.b -anchor w -text [G_msg "Print on postscript device* "] \
-		-state $psprint::gsstate
-	ComboBox $row.c -width 20 -textvariable psprint::printer  \
-		-values $psprint::gsdevices -editable 0 -entrybg white
-	pack $row.a $row.b $row.c -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# PDF file
-	set row [ frame $PWid(output).pdffile]
-	radiobutton $row.a -variable psprint::printmode -value "pdf" \
-		-state $psprint::gsstate -highlightthickness 0 
-	Label $row.b -anchor w -text [G_msg "Save to PDF file*              "]  \
-		-state $psprint::gsstate 
-	Entry $row.c -width 30 -textvariable psprint::pdffile  -state $gsstate
-	Button $row.d -text [G_msg "Browse"]  -command { set psprint::pdffile \
-		[tk_getSaveFile -title "Output PDF file" -defaultextension ".pdf"]} \
-		-state $psprint::gsstate
-	pack $row.a $row.b $row.c $row.d -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	# EPS file
-	set row [ frame $PWid(output).epsfile ]
-	radiobutton $row.a -variable psprint::printmode -value "eps" \
-		-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 \
-	       [ tk_getSaveFile -title "Output EPS file" -defaultextension ".eps"] }
-	pack $row.a $row.b $row.c $row.d -side left;
-	pack $row -side top -fill x -expand no -anchor n
-	
-	set row [ frame $PWid(output).gsmessage ]
-	Label $row.a -anchor w -text [G_msg "*requires ghostscript to be installed and in path"]
-	pack $row.a -side bottom;
-	pack $row -side top -fill x -expand yes -anchor center
-	
-	# Buttons 
-	set but [ frame $PWid(left).buttons ]  
-	pack $but -side top
-	
-	Button $but.print -text [G_msg "Print"] -command "update; psprint::print $cv"
-	Button $but.close -text [G_msg "Close"] -command { destroy .printwin }
-	pack $but.print $but.close -side left 
-
-}
-
-proc psprint::print { cv } {
-	variable paper
-	variable paper_preset
-	variable printmode
-	variable printer
-	variable gsexists
-	variable res
-	variable format
-	variable orient
-	variable epsfile
-	variable pdffile
-	variable tmppsfile 
-	variable tmppngfile
-	variable pgwd
-	variable pght
-	variable docwd
-	variable docht
-	variable mright
-	variable mleft
-	variable mtop
-	variable mbottom
-	global gmpath
-	global mon
-	global mingw
-    
-	psprint::init_tmpfiles
-   	psprint::paper
-   	update
-	set landscape $gmpath/landscap.ps
-    
-	#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)]
-	set h [expr round($pght * $res)]
-	set format "-g$w"
-	append format "x$h"
-	
-	# switch to native windows version of ghostscript if runing wingrass
-	if { $mingw == 1 } {
-		set cmd "gswin32c"
-	} else {
-		set cmd "gs"
-	}
-		
-		
-   
-	if { $orient == "portrait" } {
-		$cv postscript -pageheight $cdocht -pagewidth $cdocwd \
-			-file $tmppsfile
-	} else {
-		$cv postscript -rotate 1 -pageheight $cdocht -pagewidth $cdocwd \
-			-file $tmppsfile			
-	}	
-	
-	
-	after 500
-
-	# lpr printing		
- 	if { $printmode == "lpr" } {
- 		if {[catch {exec lpr -o position=center $tmppsfile } error]} {
-			GmLib::errmsg $error
-		}
-	}
-
-	# postsript printing via ghostsript
-	if { $printmode == "psprint" && $printer != "" } {
-		if {[catch {exec $cmd  $format -sDEVICE#$printer -r$res -sNOPAUSE -dBATCH -- $tmppsfile} error]} {
-			GmLib::errmsg $error
-		}
-		 
-	}
-
-	# output to pdf file via ghostscript	
-	if { $printmode == "pdf" && $pdffile != "" } {
-		if {[catch {exec $cmd  $format -sDEVICE#pdfwrite -r$res -sNOPAUSE -sOutputFile#$pdffile -dBATCH -- $tmppsfile} error]} {
-			GmLib::errmsg $error
-		}
-		 
-	}
-
-	# output to eps file
-	if { $printmode == "eps" && $epsfile != "" } {
-		if { $orient == "portrait" } {
-			$cv postscript -file "$epsfile"
-		} else {
-			$cv postscript -file "$epsfile" -rotate 1
-		}
-	}
-	
-	psprint::clean
-}
-
-
-proc psprint::set_option { key value } {
-	variable PWid 
-	variable PVar 
-	variable PPap 
-	variable PView
-    
-	set PVar($key) $value
-
-}
-
-# Delete temporary files
-proc psprint::clean {  } {
-	variable tmppsfile
-	variable tmppngfile
-    
-	catch {file delete $tmppsfile}
-	catch {file delete $tmppngfile}
-
-}
-

+ 0 - 315
gui/tcltk/gis.m/maptext.tcl

@@ -1,315 +0,0 @@
-###############################################################
-# maptext.tcl - TclTk canvas postscript text layer options file for GRASS GIS Manager
-# February 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmCtext {
-    variable array opt # ctext options
-    variable placement #entry widget for x,y coordinates
-    variable count 1
-    variable optlist
-}
-
-proc GmCtext::create { tree parent } {
-    variable opt
-    variable count
-	variable dup
-	variable optlist
-    global iconpath
-    global env
-
-    set node "ctext:$count"
-
-    set frm [ frame .ctexticon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCtext::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo ctico -file "$iconpath/gui-maptext.gif"
-    set ico [label $frm.ico -image ctico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "PS text layer $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,text) "" 
-    set opt($count,1,at) "100,100"
-    set opt($count,1,font) "times 12" 
-    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,mouseset) 0
-    
-    set optlist { _check opacity text at font fill width anchor justify coordinates mouseset}
-    
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmCtext::select_font { id frm } {
-	global mon
-	variable opt
-    
-    set fon [SelectFont $frm.fontset -type dialog -sampletext [G_msg "This is font sample text."] -title [G_msg "Select label font"]]
-	if { $fon != "" } {set opt($id,1,font) $fon}
-}
-
-###############################################################################
-proc GmCtext::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-###############################################################################
-
-proc GmCtext::mouseset { id } {
-	# use mouse to set scalebar placement coordinates
-	global mon pctentry pixelentry geogentry
-	variable placement
-	if { $GmCtext::opt($id,1,mouseset) == 1} {
-		if {$GmCtext::opt($id,1,coordinates) == "pixels"} {
-			set pixelentry $GmCtext::placement
-		} else {
-			set pixelentry ""
-		}
-		if {$GmCtext::opt($id,1,coordinates) == "percent"} {
-			set pctentry $GmCtext::placement
-		} else {
-			set pctentry ""
-		}
-		if {$GmCtext::opt($id,1,coordinates) == "geographic"} {
-			set geogentry $GmCtext::placement
-		} else {
-			set geogentry ""
-		}
-	}
-}
-###############################################################################
-
-# ctext options
-proc GmCtext::options { id frm } {
-    variable opt
-	variable placement
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Create postscript text object (for postscript eps, pdf, and print output only)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # text
-    set row [ frame $frm.text ]
-    Label $row.a -text [G_msg "Text to display:"]
-    LabelEntry $row.b -textvariable GmCtext::opt($id,1,text) -width 45 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-    
-    # coordinates1
-    set row [ frame $frm.east_north ]
-    set placement [LabelEntry $row.a -label [G_msg "Text placement: x,y coordinates (from upper left) "] \
-    	-textvariable GmCtext::opt($id,1,at) -width 24]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-        
-    # coordinates2
-    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"
-    checkbutton $row.c -text [G_msg "place with mouse"] \
-    	-variable GmCtext::opt($id,1,mouseset) \
-    	-command "GmCtext::mouseset $id"
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-        
-    # 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) \
-		-values {"lower_left" "bottom_center" "lower_right" "center_left" "center" 
-		"center_right" "upper_left" "top_center" "upper_right" } 
-    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"} 
-    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
-    pack $row -side top -fill both -expand yes
-        
-    # select font
-    set row [ frame $frm.font ]
-    Label $row.a -text [G_msg "Font:"] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmCtext::select_font $id $frm"
-    Entry $row.c -width 15 -text "$opt($id,1,font)" \
-	    -textvariable GmCtext::opt($id,1,font) 
-    Label $row.d -text [G_msg "  color"] 
-    SelectColor $row.e -type menubutton -variable GmCtext::opt($id,1,fill)
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-
-}
-
-###############################################################################
-proc GmCtext::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-###############################################################################
-proc GmCtext::display { node } {
-    variable opt
-    variable tree
-    variable can
-    global mon
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-    set canvas_w($mon) $MapCanvas::canvas_w($mon)
-    set canvas_h($mon) $MapCanvas::canvas_h($mon)
-    
-
-    set can($mon) $MapCanvas::can($mon)
-    
-    
-    if {$opt($id,1,_check) == 0 } { return } 
-
-    if { $opt($id,1,text) == "" } { return } 
-        
-    switch $opt($id,1,anchor) {
-    	"lower_left" 	{ set anchor "sw"}
-    	"bottom_center" { set anchor "s" }
-    	"lower_right" 	{ set anchor "se"}
-    	"center_left" 	{ set anchor "w" }
-    	"center" 		{ set anchor "center" }
-    	"center_right" 	{ set anchor "e" }
-    	"upper_left" 	{ set anchor "nw"}
-    	"top_center" 	{ set anchor "n" }
-    	"upper_right" 	{ set anchor "ne"}
-    }
-     
-    set xcoord [lindex [split $opt($id,1,at) ","] 0]
-    set ycoord [lindex [split $opt($id,1,at) ","] 1]	
-    
-    if {$opt($id,1,coordinates) == "geographic"} {
-		set xcoord [MapCanvas::mape2scrx $mon $xcoord]
-		set ycoord [MapCanvas::mapn2scry $mon $ycoord]
-		$can($mon) create text $xcoord $ycoord \
-			-anchor $anchor \
-			-justify $opt($id,1,justify) \
-			-width $opt($id,1,width) \
-			-fill $opt($id,1,fill) \
-			-font $opt($id,1,font) \
-			-text $opt($id,1,text)
-    } elseif {$opt($id,1,coordinates) == "percent"} {
-		set xpct [expr ($xcoord/100.0) * $canvas_w($mon)]
-		set ypct [expr ($ycoord/100.0) * $canvas_h($mon)]
-		$can($mon) create text $xpct $ypct \
-			-anchor $anchor \
-			-justify $opt($id,1,justify) \
-			-width $opt($id,1,width) \
-			-fill $opt($id,1,fill) \
-			-font $opt($id,1,font) \
-			-text $opt($id,1,text)
-    } else {
-		$can($mon) create text $xcoord $ycoord \
-			-anchor $anchor \
-			-justify $opt($id,1,justify) \
-			-width $opt($id,1,width) \
-			-fill $opt($id,1,fill) \
-			-font $opt($id,1,font) \
-			-text $opt($id,1,text)
-	}
-}
-###############################################################################
-
-proc GmCtext::duplicate { tree parent node id } {
-    variable opt
-    variable count
-	variable dup
-	variable optlist
-    global iconpath
-
-    set node "ctext:$count"
-
-    set frm [ frame .ctexticon$count]
-    set check [checkbutton $frm.check \
-		-variable GmCtext::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo ctico -file "$iconpath/gui-maptext.gif"
-    set ico [label $frm.ico -image ctico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "PS text layer $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-	set opt($count,1,opacity) $opt($id,1,opacity)
-    set first 1
-    
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-
-    incr count
-    return $node
-}

+ 0 - 433
gui/tcltk/gis.m/maptool.tcl

@@ -1,433 +0,0 @@
-###############################################################
-# maptool.tcl - toolbar file GRASS GIS Manager map display canvas
-# January 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-###############################################################
-
-
-namespace eval MapToolBar {
-	variable toolbar
-	variable array maptools
-}
-
-
-###############################################################################
-
-proc MapToolBar::create { tb } {
-	global bgcolor
-	global mon
-	global env
-	global tk_version
-	global iconpath
-	variable toolbar
-	variable maptools
-
-	set selclr #88aa88
-	set toolbar $tb
-	set maptools($mon) "pointer"
-
-	# DISPLAY AND MONITOR SELECTION
-	set bbox1 [ButtonBox $toolbar.bbox1 -spacing 0 ]
-
-	# display
-	$bbox1 add -image [image create photo -file "$iconpath/gui-display.gif"] \
-		-command "MapCanvas::request_redraw $mon 0" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor  -activebackground $bgcolor\
-		-helptext [G_msg "Display active layers"]
-
-	# re-render all layers
-	$bbox1 add -image [image create photo -file "$iconpath/gui-redraw.gif"] \
-		-command "MapCanvas::request_redraw $mon 1" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor -activebackground $bgcolor \
-		-helptext [G_msg "Redraw all layers"]
-
-
-	$bbox1 add -image [image create photo -file "$iconpath/module-nviz.gif"] \
-		-command {GmGroup::nvdisplay "root"} \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor  -activebackground $bgcolor\
-		-helptext [G_msg "Start NVIZ using active layers in current region"]
-
-	$bbox1 add -image [image create photo -file "$iconpath/module-d.nviz.gif"] \
-		-command "MapCanvas::dnviz $mon" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor  -activebackground $bgcolor\
-		-helptext [G_msg "Create flythough path for NVIZ"]
-
-	# erase
-	$bbox1 add -image [image create photo -file "$iconpath/gui-erase.gif"] \
-		-command "MapCanvas::erase $mon" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor  -activebackground $bgcolor\
-		-helptext [G_msg "Erase to white"]
-
-	pack $bbox1 -side left -anchor w
-
-	set sep1 [Separator $toolbar.sep1 -orient vertical -background $bgcolor ]
-	pack $sep1 -side left -fill y -padx 5 -anchor w
-
-	# DISPLAY TOOLS
-
-	# pointer
-	if {$tk_version < 8.4 } {
-		set pointer [radiobutton $tb.pointer \
-			-image [image create photo -file "$iconpath/gui-pointer.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::pointer $mon" \
-			-variable maptools($mon) -value pointer -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor  ]
-	} else {
-		set pointer [radiobutton $tb.pointer \
-			-image [image create photo -file "$iconpath/gui-pointer.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::pointer $mon" \
-			-variable maptools($mon) -value pointer \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor  ]
-	}
-	DynamicHelp::register $pointer balloon [G_msg "Pointer"]
-
-	# zoom in
-	if {$tk_version < 8.4 } {
-		set zoomin [radiobutton $tb.zoomin \
-			-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon 1" \
-			-variable maptools($mon) -value zoomin -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set zoomin [radiobutton $tb.zoomin \
-			-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon 1" \
-			-variable maptools($mon) -value zoomin \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $zoomin balloon [G_msg "Zoom In"]
-
-	#zoom out
-	if {$tk_version < 8.4 } {
-		set zoomout [radiobutton $tb.zoomout \
-			-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon -1" \
-			-variable maptools($mon) -value zoomout -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set zoomout [radiobutton $tb.zoomout \
-			-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon -1" \
-			-variable maptools($mon) -value zoomout \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $zoomout balloon [G_msg "Zoom Out"]
-
-	# pan
-	if {$tk_version < 8.4 } {
-		set pan [radiobutton $tb.pan \
-			-image [image create photo -file "$iconpath/gui-pan.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::panbind $mon" \
-			-variable maptools($mon) -value pan -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set pan [radiobutton $tb.pan \
-			-image [image create photo -file "$iconpath/gui-pan.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::panbind $mon" \
-			-variable maptools($mon) -value pan \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $pan balloon [G_msg "Pan"]
-
-	pack $pointer $zoomin $zoomout $pan -side left -anchor w
-
-	set sep2 [Separator $toolbar.sep2 -orient vertical -background $bgcolor ]
-	pack $sep2 -side left -fill y -padx 5 -anchor w
-
-	set bbox2 [ButtonBox $toolbar.bbox2 -spacing 0	]
-
-	# zoom.back
-	$bbox2 add -image [image create photo -file "$iconpath/gui-zoom_back.gif"] \
-		-command "MapCanvas::zoom_back $mon" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1\
-		-highlightbackground $bgcolor -activebackground $bgcolor \
-		-helptext [G_msg "Return to previous zoom"]
-
-	set mapzoom [menubutton $tb.mapzoom	 \
-		-image [image create photo -file "$iconpath/gui-mapzoom.gif"] \
-		-highlightthickness 0 -takefocus 0 -relief flat -borderwidth 1 \
-		-highlightbackground $bgcolor -activebackground honeydew \
-		-bg $bgcolor -width 32 -indicatoron 0 -direction below]
-	DynamicHelp::register $mapzoom balloon [G_msg "Zoom to..."]
-
-	# menu zooming display
-	set zoommenu [menu $mapzoom.zm -type normal]
-
-# Could use these images along with text if -compound worked in all platforms
-#	set zmimg [image create photo -file "$iconpath/gui-zoom_map.gif"]
-#	set zrimg [image create photo -file "$iconpath/gui-zoom_region.gif"]
-#	set zcimg [image create photo -file "$iconpath/gui-zoom_current.gif"]
-#	set zdimg [image create photo -file "$iconpath/gui-zoom_default.gif"]
-
-	$zoommenu add command \
-		-label [G_msg "Zoom display to selected map"] \
-		-command {MapCanvas::zoom_map $mon}
-	$zoommenu add command \
-		-label [G_msg "Zoom display to saved region"] \
-		-command {MapCanvas::zoom_region $mon}
-	$zoommenu add command \
-		-label [G_msg "Save display extents to named region"] \
-		-command {MapCanvas::save_region $mon}
-	$zoommenu add command \
-		-label [G_msg "Zoom display to computational region (set with g.region)"] \
-		-command {MapCanvas::zoom_current $mon}
-	$zoommenu add command \
-		-label [G_msg "Zoom display to default region"] \
-		-command {MapCanvas::zoom_default $mon}
-	$zoommenu add command \
-		-label [G_msg "Set computational region extents to match display"] \
-		-command {MapCanvas::set_wind $mon "" 0}
-
-	$mapzoom configure -menu $zoommenu
-
-	pack $bbox2 -side left -anchor w
-
-	pack $mapzoom -side left -anchor w -expand no -fill y
-
-	set sep3 [Separator $toolbar.sep3 -orient vertical -background $bgcolor ]
-	pack $sep3 -side left -fill y -padx 5 -anchor w
-
-	# query
-	if {$tk_version < 8.4 } {
-		set query [radiobutton $tb.query \
-			-image [image create photo -file "$iconpath/gui-query.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::querybind $mon" \
-			-variable maptools($mon) -value query -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set query [radiobutton $tb.query \
-			-image [image create photo -file "$iconpath/gui-query.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::querybind $mon" \
-			-variable maptools($mon) -value query \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $query balloon [G_msg "Query"]
-
-	# measure
-	if {$tk_version < 8.4 } {
-		set measure [radiobutton $tb.measure \
-			-image [image create photo -file "$iconpath/gui-measure.gif"]  \
-			-command "MapCanvas::stoptool $mon; MapCanvas::measurebind $mon"\
-			-variable maptools($mon) -value measure -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set measure [radiobutton $tb.measure \
-			-image [image create photo -file "$iconpath/gui-measure.gif"] \
-			-command "MapCanvas::stoptool $mon; MapCanvas::measurebind $mon"\
-			-variable maptools($mon) -value measure \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $measure balloon [G_msg "Measure"]
-
-	set bbox3 [ButtonBox $toolbar.bbox3 -spacing 0 ]
-	$bbox3 add -image [image create photo -file "$iconpath/gui-profile.gif"] \
-		-command "MapCanvas::stoptool $mon; MapCanvas::startprofile $mon" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1	\
-		-highlightbackground $bgcolor -activebackground $bgcolor \
-		-helptext [G_msg "Create profile of raster map"]
-
-
-	pack $query $measure -side left -anchor w
-	pack $bbox3 -side left -anchor w
-
-
-	set sep4 [Separator $toolbar.sep4 -orient vertical -background $bgcolor ]
-	pack $sep4 -side left -fill y -padx 5 -anchor w
-
-	# FILE & PRINT
-	set bbox4 [ButtonBox $toolbar.bbox4 -spacing 0 ]
-
-	$bbox4 add -image [image create photo -file "$iconpath/file-print.gif"] \
-		-command "MapCanvas::printcanvas $mon" \
-		-highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 \
-		-highlightbackground $bgcolor -activebackground $bgcolor \
-		-helptext [G_msg "Print raster & vector maps to eps file"]
-
-	set mapsave [menubutton $tb.mapsave \
-		-image [image create photo -file "$iconpath/gui-filesave.gif"] \
-		-highlightthickness 0 -takefocus 0 -relief flat -borderwidth 1 \
-		-highlightbackground $bgcolor -activebackground honeydew \
-		-bg $bgcolor -width 32 -indicatoron 0 -direction below]
-	DynamicHelp::register $mapsave balloon [G_msg "Export display to graphics file"]
-
-	pack $mapsave -side left -anchor w -expand no -fill y
-	pack $bbox4 -side left -anchor w
-
-	# menu for saving display
-	set savefile [menu $mapsave.sf -type normal]
-	set jpgfile [menu $savefile.jpg -type normal]
-
-	$savefile add command -label "BMP*" -command {MapToolBar::savefile bmp 0}
-	$savefile add cascade -label "JPG*" -menu $jpgfile
-		$jpgfile add command -label [G_msg "low quality (50)"]	\
-			-command {MapToolBar::savefile jpg 50}
-		$jpgfile add command -label [G_msg "mid quality (75)"] \
-			-command {MapToolBar::savefile jpg 75}
-		$jpgfile add command -label [G_msg "high quality (95)"] \
-			-command {MapToolBar::savefile jpg 95}
-		$jpgfile add command -label [G_msg "very high resolution (300% your current resolution)"] \
-			-command {MapToolBar::savefile jpg 300}
-	$savefile add command -label "PPM/PNM" -command {MapToolBar::savefile ppm 0}
-	$savefile add command -label "PNG" -command {MapToolBar::savefile png 0}
-	$savefile add command -label "TIF*" -command {MapToolBar::savefile tif 0}
-	$savefile add command -label [G_msg "(* requires gdal)"] -state disabled
-
-	$mapsave configure -menu $savefile
-
-	set sep5 [Separator $toolbar.sep5 -orient vertical ]
-	pack $sep5 -side left -fill y -padx 5 -anchor w
-
-	# Render modes
-
-	# Strict render mode
-	# Uses previous resolution and exact boundaries
-	if {$tk_version < 8.4 } {
-		set strictdraw [radiobutton $tb.strictdraw \
-			-command "MapCanvas::exploremode $mon 0" \
-			-variable MapToolBar::explore($mon) -value strict -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set strictdraw [radiobutton $tb.strictdraw \
-			-command "MapCanvas::exploremode $mon 0" \
-			-variable MapToolBar::explore($mon) -value strict \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $strictdraw balloon [G_msg "Constrain map to region geometry"]
-	icon_configure $strictdraw drawmode strict
-
-	# Explore render mode
-	# Uses resolution to match display and expanded boundaries to fill display
-	if {$tk_version < 8.4 } {
-		set exploredraw [radiobutton $tb.strictzoom \
-			-command "MapCanvas::exploremode $mon 1" \
-			-variable MapToolBar::explore($mon) -value explore -relief flat \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	} else {
-		set exploredraw [radiobutton $tb.strictzoom \
-			-command "MapCanvas::exploremode $mon 1" \
-			-variable MapToolBar::explore($mon) -value explore \
-			-relief flat -offrelief flat -overrelief raised \
-			-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
-			-activebackground $bgcolor -highlightbackground $bgcolor ]
-	}
-	DynamicHelp::register $exploredraw balloon [G_msg "Map fills display window"]
-	icon_configure $exploredraw drawmode explore
-
-	# This does not actually set the mode
-	# it just starts visually in sync with the default
-	set MapToolBar::explore($mon) strict
-
-	pack $strictdraw $exploredraw -side left -anchor w
-}
-
-
-###############################################################################
-# changes button on keypress
-proc MapToolBar::changebutton { rbname } {
-	global mon
-	variable maptools
-
-	set maptools($mon) $rbname
-}
-
-###############################################################################
-# procedures for saving files
-
-# save png file
-proc MapToolBar::savefile { type quality } {
-	global env
-	global mon
-	global tmpdir
-
-	set outfile($mon) $MapCanvas::outfile($mon)
-
-	if { [info exists env(HOME)] } {
-		set dir $env(HOME)
-		set path [tk_getSaveFile -initialdir $dir \
-			-title "Save file: do not add extension to file name"]
-	} else {
-		set path [tk_getSaveFile  \
-			 -title "Save file: do not add extension to file name"]
-	}
-	set currdir [pwd]
-	cd $tmpdir
-
-	catch {file copy -force $outfile($mon) $path.ppm}
-
-	cd $currdir
-
-	if { $path != "" } {
-		switch $type {
-			"bmp" {
-				if { [catch {exec gdal_translate $path.ppm $path.bmp -of BMP} error ]} {
-					GmLib::errmsg $error [G_msg "Could not create BMP"]
-				}
-				catch {file delete $path.ppm}
-			}
-			"jpg" {
-			    if { $quality == 300 } {
-					if { [catch {exec gdal_translate $path.ppm $path.jpg -of JPEG -co QUALITY=95 -outsize 300% 300% } error ]} {
-						GmLib::errmsg $error [G_msg "Could not create JPG"]
-					}					
-					catch {file delete $path.ppm}
-				} else {
-					if { [catch {exec gdal_translate $path.ppm $path.jpg -of JPEG -co QUALITY=$quality  } error ]} {
-						GmLib::errmsg $error [G_msg "Could not create JPG"]
-					}					
-
-					catch {file delete $path.ppm}
-				}
-			}
-			"png" {
-				if { [catch {exec gdal_translate $path.ppm $path.png -of PNG} error ]} {
-					GmLib::errmsg $error [G_msg "Could not create PNG"]
-				}
-				
-				catch {file delete $path.ppm}
-			}
-			"ppm" {
-				return
-			}
-			"tif" {
-				if { [catch {exec gdal_translate $path.ppm $path.tif -of GTIFF} error ]} {
-					GmLib::errmsg $error [G_msg "Could not create TIF"]
-				}
-				
-				catch {file delete $path.ppm}
-			}
-		}
-	}
-	return
-}
-

+ 0 - 34
gui/tcltk/gis.m/pkgIndex.tcl

@@ -1,34 +0,0 @@
-# Load all of the layers, etc only as they are used.
-package ifneeded GisM 1.0 [list tclPkgSetup $dir GisM 1.0 {
-	{gmtool1.tcl source {GmToolBar1::create}}
-	{gmtool2.tcl source {GmToolBar2::create}}
-	{maptool.tcl source {MapToolBar::create}}
-	{mapcanvas.tcl source {MapCanvas::create}}
-	{commonlayer.tcl source {GmCommonLayer::display_command GmCommonLayer::display_commands}}
-	{gmtree.tcl source {GmTree::create GmTree::load}}
-	{group.tcl source {GmGroup::create GmGroup::display}}
-	{cmd.tcl source {GmCmd::create}}
-	{vector.tcl source {GmVector::create}}
-	{raster.tcl source {GmRaster::create}}
-	{labels.tcl source {GmLabels::create}}
-	{gridline.tcl source {GmGridline::create}}
-	{rgbhis.tcl source {GmRgbhis::create}}
-	{histogram.tcl source {GmHist::create}}
-	{rastnums.tcl source {GmRnums::create}}
-	{rastarrows.tcl source {GmArrows::create}}
-	{legend.tcl source {GmLegend::create}}
-	{frames.tcl source {GmDframe::create}}
-	{barscale.tcl source {GmBarscale::create}}
-	{chart.tcl source {GmChart::create}}
-	{thematic.tcl source {GmThematic::create}}
-	{dtext.tcl source {GmDtext::create}}
-	{maptext.tcl source {GmCtext::create}}
-	{maplabels.tcl source {GmCLabels::create}}
-	{mapprint.tcl source {psprint::init}}
-	{profile.tcl source {GmProfile::create}}
-	{georect.tcl source {GRMap::startup}}
-	{georecttool.tcl source {GRToolBar::create}}
-	{rules.tcl source {GmRules::main}}
-	{dnviz.tcl source {GmDnviz::main}}
-	{animate.tcl source {GmAnim::main}}
-}]

+ 0 - 704
gui/tcltk/gis.m/profile.tcl

@@ -1,704 +0,0 @@
-##########################################################################
-# profile.tcl - Dialog to create profile of raster surface for GRASS GIS Manager
-# May 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2007 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmProfile {
-    variable pcan
-    variable status ""
-    variable pmap ""
-    variable pmainframe
-    variable transect ""
-    variable tottransect ""
-    variable pcoords ""
-    variable pcoordslist ""
-    variable profilelist ""
-    variable x
-    variable y
-    variable first 1
-    variable firsteast 0.0
-    variable firstnorth 0.0
-    variable east1 0.0
-    variable north1 0.0
-    variable east2 0.0
-    variable north2 0.0
-    variable tlength 0.0
-    variable tottlength 0.0
-    variable linex1 0.0
-    variable liney1 0.0
-    variable linex2 0.0
-    variable liney2 0.0	
-    variable array psegment len #
-    variable elevrange 0.0
-    variable elevmax 0.0
-    variable elevmin 0.0
-    variable elev 0.0
-    variable msg
-}
-
-
-###############################################################################
-# select raster map to profile
-
-# select base raster map from list and put name in layer tree node
-proc GmProfile::select_rast { } {
-    variable pmap
-    variable status
-    
-    set m [GSelect cell title "Raster map for profile" parent [winfo containing [winfo pointerx .] [winfo pointery .]]]
-    if { $m != "" } { 
-        set pmap $m
-    }
-    
-    set GmProfile::status [G_msg "Profile for $pmap"]    
-
-}
-
-
-###############################################################################
-# create canvas for displaying profile
-proc GmProfile::create { mapcan } {
-    global gmpath
-    global iconpath
-    global env
-    global bgcolor
-    global mon
-	variable pmap
-	variable pcan
-	
-	if { [winfo exists .profile] } {return}
-
-	set ptitle "Profile Window"
-	toplevel .profile
-    wm title .profile [G_msg $ptitle]
-
-
-    wm withdraw .profile
-    #wm overrideredirect $txt 1
-
-	# create canvas for profile
-	set profilemf [MainFrame .profile.mf \
-		-textvariable GmProfile::status]
-		
-	set profile_frame [$profilemf getframe]
-			
-	set pcan [canvas $profile_frame.can -bg white\
-		-borderwidth 0 -closeenough 1.0 \
-        -relief ridge -selectbackground #c4c4c4 \
-        -width 600 -height 300 ]
-        	   
-    # setting geometry
-    place $pcan \
-        -in $profile_frame -x 0 -y 0 -anchor nw \
-        -bordermode ignore 
-
-	# profile control buttons
-	set pcan_tb [$profilemf addtoolbar]
-	pack $pcan_tb -side left -expand yes -fill x
-	
-	set pcanbb [ButtonBox $pcan_tb.bb -orient horizontal]
-	$pcanbb add -image [image create photo -file "$iconpath/element-cell.gif"] \
-		-command "GmProfile::select_rast" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Select raster map to profile.\nCurrently selected raster is default."] -highlightbackground $bgcolor
-	$pcanbb add  -image [image create photo -file "$iconpath/gui-profiledefine.gif"] \
-		-command "GmProfile::profilebind $mapcan" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Draw profile transect in map display"] -highlightbackground $bgcolor
-	$pcanbb add -image [image create photo -file "$iconpath/gui-profiledraw.gif"] \
-		-command "GmProfile::pdraw" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Draw profile"] -highlightbackground $bgcolor
-	$pcanbb add -image [image create photo -file "$iconpath/gui-erase.gif"] \
-		-command "GmProfile::perase $mapcan" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Clear profile"] -highlightbackground $bgcolor
-	$pcanbb add -image [image create photo -file "$iconpath/file-save.gif"] \
-		-command "GmProfile::psave" \
-        -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1  \
-        -highlightbackground $bgcolor  -activebackground $bgcolor\
-        -helptext [G_msg "Save profile to EPS file"] -highlightbackground $bgcolor
-	set helpbtn [Button $pcan_tb.help -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q gm_profile" \
-		-background $bgcolor -borderwidth 1 \
-		-helptext [G_msg "Help"]]
-        
-    # add a menu button to set preferences?
-
-	pack $profilemf -expand yes -fill both -padx 0 -pady 0
-	pack $pcan -fill both -expand yes
-	pack $helpbtn -side right -anchor e
-	pack $pcanbb -side left -anchor w
-			
-    set GmProfile::status [G_msg "Profile for $pmap"]
-    $profilemf showstatusbar status 
-    pack $profilemf -fill both -expand yes
-
-	BWidget::place .profile 0 0 at 500 100
-    wm deiconify .profile
-    
-	# bindings for closing profile window
-	bind .profile <Destroy> "GmProfile::cleanup %W $mapcan"
-	    
-}
-
-###############################################################################
-proc GmProfile::setelev { pmap } {
-	variable elevrange
-	variable elevmax
-	variable elevmin
-	global devnull
-	
-    #calculate elevation range so all profiles with same window geometry with have
-    # same scale. Elevation range calcuated within currently displayed region.
-        
-   	#set input [exec r.describe -rdq map=$pmap]
-	#regexp -nocase {^([0-9]+) thru ([0-9]+)} $input trash elevmin elevmax
-	#set elevrange [expr $elevmax - $elevmin]		
-	
-    
-	if {![catch {open "|r.univar --q -g map=$pmap 2> $devnull" r} input]} {
-		while {[gets $input line] >= 0} {
-			regexp -nocase {^([a-z]+)=(.*)$} $line trash key value
-			set elev($key) $value	
-		}
-		if {[catch {close $input} error]} {
-			GmLib::errmsg $error [G_msg "r.univar error"]
-		}
-	
-		set elevmax $elev(max)
-		set elevmin $elev(min)
-		set elevrange $elev(range)	
-	}
-	
-	#vwait elevrange
-    #set GmProfile::status [G_msg "Profile for $pmap"]    
-
-}
-###############################################################################
-# save profile to eps file
-proc GmProfile::psave { } {
-	variable pcan
-	global env
-		
-	set types {
-    {{EPS} {.eps}}
-	}
-
-	if { [info exists HOME] } {
-		set dir $env(HOME)
-		set path [tk_getSaveFile -filetypes $types -initialdir $dir \
-			-defaultextension ".eps" -parent .profile]
-	} else {
-		set path [tk_getSaveFile -filetypes $types -defaultextension ".eps" -parent .profile]
-	}
-	
-	$pcan postscript -file "$path"
-
-	return
-}
-
-
-###############################################################################
-# procedures for marking profile location 
-
-#  bindings for drawing profile transect
-proc GmProfile::profilebind { mapcan } {
-	variable measurement_annotation_handle
-	variable tlength 
-	variable tottlength
-	variable linex1 
-	variable liney1
-	variable linex2
-	variable liney2
-	variable first
-	variable msg
-	global mon
-		
-	# Make the output for the measurement
-	set measurement_annotation_handle [monitor_annotation_start $mon "Measurement" {}]
-    
-	if {[info exists linex1]} {unset linex1}
-	if {[info exists liney1]} {unset liney1}
-	if {[info exists linex2]} {unset linex2}
-	if {[info exists liney2]} {unset liney2}
-		
-	bind $mapcan <1> "GmProfile::marktransect $mapcan %x %y"
-	bind $mapcan <B1-Motion> "GmProfile::drawtransect $mapcan %x %y"
-	bind $mapcan <ButtonRelease-1> "GmProfile::getcoords $mapcan"
-	
-	set GmProfile::msg "Draw profile transect with mouse"
-		
-	MapCanvas::setcursor $mon "pencil"
-	set tlength 0
-	set tottlength 0
-
-}
-
-# start profile transect
-proc GmProfile::marktransect {mapcan x y} {
-	variable transect
-	variable tlength 
-	variable tottlength
-	variable linex1 
-	variable liney1
-	variable linex2
-	variable liney2
-	variable first
-	variable firsteast
-	variable firstnorth
-	variable pcoords
-	global mon
-
-	#start line
-	if { ![info exists linex1] } {
-	    set linex1 [$mapcan canvasx $x]
-	    set liney1 [$mapcan canvasy $y]
-	}
-
-	if { $first == 1 } {
-		set firsteast  [MapCanvas::scrx2mape $mon $linex1]
-		set firstnorth [MapCanvas::scry2mapn $mon $liney1]
-		set pcoords "$firsteast,$firstnorth"
-	}
-
-	set first 0
-
-	#check for click with no drag
-	if { ![info exists linex2] } {
-	    set linex2 $linex1
-	}
-	if { ![info exists liney2] } {
-	    set liney2 $liney1
-	}
-
-    $mapcan delete transect
-}
-
-# draw profile transect
-proc GmProfile::drawtransect { mapcan x y } {
-	variable measurement_annotation_handle
-	variable transect
-	variable tlength 
-	variable tottlength
-	variable linex1 
-	variable liney1
-	variable linex2
-	variable liney2
-	variable pcoords
-	global mon
-	    
-	set scrxmov $x
-	set scrymov $y
-	set eastcoord [eval MapCanvas::scrx2mape $mon $x]
-	set northcoord [eval MapCanvas::scry2mapn $mon $y]
-	set coords "$eastcoord,$northcoord"
-	set xc [$mapcan canvasx $x]
-	set yc [$mapcan canvasy $y]
-	
-	# draw line segment
-	if {($linex1 != $xc) && ($liney1 != $yc)} {
-		$mapcan delete transect
-		$mapcan addtag transect withtag \
-			[$mapcan create line $linex1 $liney1 $xc $yc \
-			-fill red -arrow last -width 2]
-		set linex2 $xc
-		set liney2 $yc
-	}
-}	
-
-# get coordinates for transect nodes and endpoints
-proc GmProfile::getcoords { mapcan } {
-	variable measurement_annotation_handle
-	variable transect
-	variable tottransect
-	variable tlength 
-	variable tottlength
-	variable linex1 
-	variable liney1
-	variable linex2
-	variable liney2
-	variable pcoords
-	variable firsteast
-	variable east1
-	variable north1
-	variable east2
-	variable north2
-	variable pcoords
-	variable pcoordslist
-	global mon
-	
-	# draw cumulative line
-	$mapcan addtag tottransect withtag \
-		[$mapcan create line $linex1 $liney1 $linex2 $liney2 \
-		-fill blue -arrow last -width 2]
-
-	# get line endpoints in map coordinates
-	
-	set east1  [expr 1.0 * [MapCanvas::scrx2mape $mon $linex1]]
-	set north1 [expr 1.0 * [MapCanvas::scry2mapn $mon $liney1]]
-	set east2  [expr 1.0 * [MapCanvas::scrx2mape $mon $linex2]]
-	set north2 [expr 1.0 * [MapCanvas::scry2mapn $mon $liney2]]
-	
-	# coordinates for use in r.profile
-	append pcoords "," $east2 "," $north2
-	
-	# x distance off each transect segment
-	
-	# First convert map coordinates to profile screen coordinates
-	# Then add the profile screen coordinates to the profile coordinates list. 
-	# Only add east1 and north1 the first time; 
-	# continue to add east2 and north2 until ready to draw profile
-
-	# calculate line segment length and total length
-	set tlength [expr {sqrt(pow(($east1 - $east2), 2) + pow(($north1 - $north2), 2))}]
-	set tottlength [expr {$tottlength + $tlength}]
-	
-	lappend pcoordslist $tottlength
-	
-	monitor_annotate $measurement_annotation_handle " --segment length\t= $tlength\n"
-	monitor_annotate $measurement_annotation_handle "cumulative length\t= $tottlength\n"
-	
-	set linex1 $linex2
-	set liney1 $liney2
-}
-
-###############################################################################
-# draw profile
-proc GmProfile::pdraw { } {
-    variable pcan
-    variable pmap
-    variable tottlength
-    variable elevrange
-    variable elevmax
-    variable elevmin
-    variable firsteast
-    variable firstnorth
-    variable east1
-    variable north1
-    variable east2
-    variable north2
-    variable pcoords
-    variable pcoordslist
-    variable profilelist
-    variable status
-    global mon
-    global devnull
-
-    set cumdist 0.0
-
-    if {![catch {open "|g.proj -p" r} input]} {
-	set key ""
-	set value ""
-	while {[gets $input line] >= 0} {
-	    if { [string equal "XY location (unprojected)" "$line"] } {
-		set mapunits "map units"
-		break
-	    }
-	    regexp -nocase {^(.*):(.*)$} $line trash key value
-	    set key [string trim $key]
-	    set value [string trim $value]
-	    set prj($key) $value    
-	}
-	if {[catch {close $input} error]} {
-	    GmLib::errmsg $error [G_msg "g.proj or projection error"]
-	} 
-    }
-
-    # r.profile always returns meters, but here profile length is calculated
-    #  from the map canvas arrows and so is measured & plotted in map units.
-    # May already be set above if locn was XY.
-    if { ! [ info exist mapunits ] } {
-	set mapunits $prj(units)
-    }
-
-	if {$pmap == ""} {
-	   # get currently selected raster map as default to profile if nothing else chosen
-		set tree($mon) $GmTree::tree($mon)
-		set sel [ lindex [$tree($mon) selection get] 0 ]	
-		if { $sel != "" } {
-			set type [GmTree::node_type $sel]
-			if {$type == "raster" } {
-				set GmProfile::pmap [GmRaster::mapname $sel]
-			}
-		} else {
-			tk_messageBox -message [G_msg "You must select a raster to profile"] -type ok -icon warning \
-			-title [G_msg "No raster map selected"] -parent .profile
-			return
-		}
-	}    
-
-	if {$pcoords == ""} {
-		tk_messageBox -message [G_msg "You must draw a transect to profile"] -type ok -icon warning \
-		-title [G_msg "No transect drawn"] -parent .profile
-		return
-	}
-
-	
-	set GmProfile::status [G_msg "Please wait while profile elevations are calculated"] 
-	update
-	# calculate elevation max, min, and range
-	GmProfile::setelev $pmap
-	if {$elevrange == 0} {
-		tk_messageBox -message [G_msg "Elevation range for selected raster is zero.\nNo profile can be created."]\
-		-type ok -icon warning -title [G_msg "Zero elevation range"] -parent .profile
-		return
-	}
-	
-	# put map name back in status bar
-	set GmProfile::status [G_msg "Profile for $pmap"]    
-
-	$pcan delete all
-	set profilelist ""
-	
-	# calculate screen length and width
-	set w [winfo width $pcan]
-	set h [winfo height $pcan]
-	
-	#calculate graph box and scale extents
-	set top [expr 0.20 * $h]
-	set bottom [expr 0.80 * $h]
-	set height [expr $bottom - $top]
-	set left [expr 0.2 * $w]
-	set right [expr 0.9 * $w]
-	set center [expr 0.55 * $w]
-	set width [expr $right - $left]
-	set yscaleright [expr $left - 10]
-	set xscaletop [expr $bottom	+ 10]
-	set titlebottom [expr 0.10 * $h]
-	set titleleft [expr $left + 15]
-	
-	# create title
-	$pcan create text $center $titlebottom \
-		-text [G_msg "Profile for $pmap"] \
-		-font {-size 14 -weight bold} \
-		-anchor s \
-		-justify center
-	
-	# create y axis (from 20%x20% to 20%x80% - top to bottom)
-	$pcan create line $left $top $left [expr $bottom + 5]
-
-	# format axis labels in a nice way, as a function of range
-	if { $elevrange >= 100 } {
-	    set outfmt "%.0f"
-	} elseif { $elevrange > 0 } {
-	    set outfmt "%.[expr {int(ceil(2 - log10($elevrange)))}]f"
-	} else {
-	    # error: no range (nan?)
-	    set outfmt "%g"
-	}
-
-	# add scale to y axis
-	$pcan create text $yscaleright $top \
-		-text "[format $outfmt $elevmax]" \
-		-anchor e \
-		-justify right
-
-	$pcan create text $yscaleright $bottom \
-		-text "[format $outfmt $elevmin]" \
-		-anchor e \
-		-justify right
-
-	# create x axis (from 20%x80% to 90%x80% - left to right)
-	$pcan create line [expr $left - 5] $bottom $right $bottom
-
-	# add scale to x axis
-	$pcan create text $left $xscaletop \
-		-text "0" \
-		-anchor n \
-		-justify center
-
-	# add tick marks
-	$pcan create line $right $bottom $right [expr $bottom + 5]
-	$pcan create line [expr $left - 5] $top $left $top
-
-	# run r.profile first time to calculate total transect distance (needed for lat lon regions)
-   	if {![catch {open "|r.profile input=$pmap profile=$pcoords null=nan 2> $devnull" r} input]} {
-		while {[gets $input line] >= 0} {
-			if { [regexp -nocase {^([0-9].*) ([[.-.]0-9na].*)$} $line trash dist elev] } {
-				set cumdist $dist
-			}
-		}
-		if {[catch {close $input} error]} {
-			GmLib::errmsg $error [G_msg "r.profile error"]
-		}
-	}
-
-	set divisor "1.0"
-	if { [string equal "meters" "$mapunits"] } {
-	    if { $tottlength > 2500 } {
-		set mapunits "km"
-		set divisor "1000.0"
-	    }
-	} elseif { [string first "feet" "$mapunits"] >= 0 } {
-	    # nano-bug: we match any "feet", but US Survey feet is really 
-	    #  5279.9894 per statute mile, or 1.06' per 100 miles. As >100
-	    #  miles the tick markers are rounded to the nearest 10th of a
-	    #  mile (528'), the difference in foot flavours is ignored.
-	    if { $tottlength > 5280 } {
-		set mapunits "miles"
-		set divisor "5280.0"
-	    }
-	} elseif { [string first "degree" "$mapunits"] >= 0 } {
-	    if { $tottlength < 1 } {
-		set mapunits "minutes"
-		set divisor [expr 1/60.0]
-	    }
-	}
-
-	# format axis labels in a nice way, as a function of range
-	if { [expr $tottlength/$divisor ] >= 500 } {
-	   set outfmt "%.0f"
-	} elseif { [expr $tottlength/$divisor ] >= 100 } {
-	    set outfmt "%.1f"
-	} elseif { [expr $tottlength/$divisor ] > 0 } {
-	    set outfmt "%.[expr {int(ceil(2 - log10($tottlength/$divisor)))}]f"
-	} else {
-	    # error: no range (nan?)
-	    set outfmt "%g"
-	}
-
-	# add axis label
-	$pcan create text $center $xscaletop \
-		-text [G_msg "distance along transect ($mapunits)"] \
-		-anchor n \
-		-justify center
-
-	# add transect segment markers
-	foreach {x} $pcoordslist {
-		if { $tottlength > 0.0 } {
-			set segx [expr $left + (($x * $width) / $tottlength)]
-			$pcan create line $segx $bottom $segx $top -fill grey
-			$pcan create text $segx $top -text "[format $outfmt [expr $x/$divisor]]" \
-				-anchor s -justify center -fill grey
-		}
-	}
-
-	# add label for total transect distance
-	$pcan create text $right $xscaletop \
-		-text "[format $outfmt [expr $tottlength/$divisor]]" \
-		-anchor n \
-		-justify center
-
-	# run r.profile again to
-	# convert dist elev (stdout) to xy coordinates of profile line
-   	if {![catch {open "|r.profile input=$pmap profile=$pcoords null=nan 2> $devnull" r} input]} {
-		while {[gets $input line] >= 0} {
-			if { [regexp -nocase {^([0-9].*) ([[.-.]0-9na].*)$} $line trash dist elev] } {
-			    if { [string equal "$elev" "nan" ]  } {
-				# draw profile line
-				if { [ info exist profilelist ] } {
-				    if { [llength $profilelist] >= 4 } {
-					$pcan create line $profilelist -fill blue
-				    } elseif { [llength $profilelist] == 2 } {
-					# plot a dot
-					$pcan create oval [concat $profilelist $profilelist] \
-					    -fill blue -outline blue -width 1
-				    }
-				    unset profilelist
-				}
-			    } else {
-				set pelev [expr $bottom - ($height * ($elev - $elevmin) / $elevrange)] 
-				set pdist [expr $left + (($dist * $width) / $cumdist)]
-				lappend profilelist $pdist $pelev
-			    }
-			}
-		}
-		if {[catch {close $input} error]} {
-			GmLib::errmsg $error [G_msg "r.profile error"]
-		}
-	}
-
-	# draw profile line
-	if { [ info exist profilelist ] && [llength $profilelist] >= 4 } {
-		$pcan create line $profilelist -fill blue
-	}
-
-}
-###############################################################################
-# erase profile and clear transects
-proc GmProfile::perase { mapcan } {
-	variable pmap
-	variable pcan
-	variable transect
-	variable tottransect
-	variable tlength
-	variable tottlength
-	variable pcoords
-	variable pcoordslist
-	variable profilelist
-	variable first
-	variable linex1
-	variable liney1
-	variable elevrange
-	variable elevmax
-	variable elevmin
-	
-	$pcan delete all
-	$mapcan delete transect
-	$mapcan delete tottransect
-	set tlength 0.0
-	set tottlength 0.0
-	set pcoords ""
-	set pcoordslist ""
-	set profilelist ""
-	set first 1
-	if { [info exists linex1] } {
-		unset linex1
-	}
-	if { [info exists liney1] } {
-		unset liney1
-	}
-	
-
-}
-
-###############################################################################
-
-proc GmProfile::cleanup { destroywin mapcan } {
-	# cleanup procedures on closing profile window	
-	variable pcan
-	variable transect
-	variable tottransect
-	variable tlength
-	variable tottlength
-	variable pcoords
-	variable pcoordslist
-	variable profilelist
-	variable first
-	variable linex1
-	variable liney1
-	global mon
-	
-	set tlength 0.0
-	set tottlength 0.0
-	set pcoords ""
-	set pcoordslist ""
-	set profilelist ""
-	set first 1
-	if { [info exists linex1] } {
-		unset linex1
-	}
-	if { [info exists liney1] } {
-		unset liney1
-	}
-	
-	$mapcan delete transect
-	$mapcan delete tottransect
-	MapCanvas::restorecursor $mon
-
-}
-
-
-###############################################################################

+ 0 - 366
gui/tcltk/gis.m/rastarrows.tcl

@@ -1,366 +0,0 @@
-##########################################################################
-# rastarrows.tcl - raster slope arrows layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmArrows {
-    variable array opt # arrows current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # raster
-    variable array lfilemask # raster
-    variable optlist
-    variable array dup # vector
-}
-
-###############################################################################
-proc GmArrows::create { tree parent } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "arrows:$count"
-
-    set frm [ frame .arrowicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmArrows::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo aico -file "$iconpath/module-d.rast.arrow.gif"
-    set ico [label $frm.ico -image aico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-    
-    pack $check $ico -side left
-        
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-    	-text  "arrows $count"\
-		-window $frm -drawcross auto  
-    
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
- 	set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,type) "grass" 
-    set opt($count,1,arrow_color) "green" 
-    set opt($count,1,grid_color) "grey" 
-    set opt($count,1,x_color) "black" 
-	set opt($count,1,unknown_color) "red" 
-    set opt($count,1,skip) 1
-    set opt($count,1,magnitude_map) "" 
-    set opt($count,1,scale) 1.0 
-    set opt($count,1,mod) 1
-
-	set optlist {_check map opacity type arrow_color grid_color x_color unknown_color \
-    	skip magnitude_map scale} 
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmArrows::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmArrows::select_map { id } {
-    variable tree
-    variable node
-    global mon
-    
-    set m [GSelect cell title [G_msg "Aspect map"] parent "."]
-    if { $m != "" } { 
-        set GmArrows::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "arrows for %s"] $m]
-    }
-}
-
-proc GmArrows::select_magmap { id } {
-    variable tree
-    variable node
-    global mon
-    
-    set m [GSelect cell title [G_msg "Slope/intensity map"] parent "."]
-    if { $m != "" } { 
-        set GmArrows::opt($id,1,magnitude_map) $m
-        GmTree::autonamel [format [G_msg "arrows for %s"] $m]
-    }
-}
-
-###############################################################################
-# display histogram options
-proc GmArrows::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display arrows whose orientations are based on raster aspect map"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.heading2 ]
-    Label $row.a -text [G_msg "  (optionally, arrow lengths are based on slope or intensity map)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmArrows::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # raster map for arrow direction
-    set row [ frame $frm.map ]
-    Label $row.a -text [G_msg "Aspect map: "]
-    Button $row.b -image [image create photo -file "$iconpath/gui-rastarrowsdir.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmArrows::select_map $id"
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmArrows::opt($id,1,map) 
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q d.rast.arrow" \
-		-background $bgcolor -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # map type
-    set row [ frame $frm.type ]
-    Label $row.a -text [G_msg "    aspect value type"]
-    ComboBox $row.b -padx 2 -width 8 -textvariable GmArrows::opt($id,1,type) \
-		-values {"grass" "compass" "agnps" "answers"} 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-		
-    # skip factor
-    set row [ frame $frm.skip ]
-    Label $row.a -text [G_msg "    draw arrows every Nth grid cell"]
-    SpinBox $row.b -range {1 200 1} -textvariable GmArrows::opt($id,1,skip) \
-		-width 4  
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # arrow and grid color
-    set row [ frame $frm.color1 ]
-    Label $row.a -text [G_msg "    arrow color      "]
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmArrows::opt($id,1,arrow_color) \
-		-values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"} 
-    Label $row.c -text [G_msg "     cell grid color"]
-    ComboBox $row.d -padx 2 -width 10 -textvariable GmArrows::opt($id,1,grid_color) \
-		-values {"none" "white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"} 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # x and unknown color
-    set row [ frame $frm.color2 ]
-    Label $row.a -text [G_msg "    null value color"]
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmArrows::opt($id,1,x_color) \
-		-values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"} 
-    Label $row.c -text { 'unknowns' color}
-    ComboBox $row.d -padx 2 -width 10 -textvariable GmArrows::opt($id,1,unknown_color) \
-		-values {"none" "white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"} 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # raster map for arrow magnitude
-    set row [ frame $frm.mag ]
-    Label $row.a -text [G_msg "Slope/intensity map: "]
-    Button $row.b -image [image create photo -file "$iconpath/gui-rastarrowsint.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmArrows::select_magmap $id"
-    Entry $row.c -width 35 -text " $opt($id,1,magnitude_map)" \
-          -textvariable GmArrows::opt($id,1,magnitude_map) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-		
-    # scale arrow length
-    set row [ frame $frm.scale ]
-    LabelEntry $row.a -label [G_msg "    scale factor for computing arrow length"] \
-		-textvariable GmArrows::opt($id,1,scale) -width 5 
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-proc GmArrows::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-         GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-###############################################################################
-proc GmArrows::display { node mod} {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return } 
-
-    set cmd "d.rast.arrow map=$opt($id,1,map) type=$opt($id,1,type) \
-    	arrow_color=$opt($id,1,arrow_color) grid_color=$opt($id,1,grid_color) \
-    	x_color=$opt($id,1,x_color) unknown_color=$opt($id,1,unknown_color) \
-    	skip=$opt($id,1,skip) scale=$opt($id,1,scale)"
-
-    # include nulls
-    if { $opt($id,1,magnitude_map) != "" } { 
-        append cmd " magnitude_map=$opt($id,1,magnitude_map)"
-    }
-	
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-    
-###############################################################################
-proc GmArrows::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    global mapname
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map) == "" } { return } 
-    
-    set mapname $opt($id,1,map)
-    return $mapname
-}
-
-###############################################################################
-proc GmArrows::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-    
-    set node "arrows:$count"
-	set dup($count) 1
-
-    set frm [ frame .arrowicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmArrows::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo aico -file "$iconpath/module-d.rast.arrow.gif"
-    set ico [label $frm.ico -image aico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	# where to insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-    		-text "arrows $count" -window $frm \
-			-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-	    	-text "arrows for $opt($id,1,map)" \
-			-window $frm -drawcross auto
-	}
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist {_check map type arrow_color grid_color x_color unknown_color \
-    	skip magnitude_map scale} 
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	set id $count
-
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-
-    incr count
-    return $node
-}

+ 0 - 471
gui/tcltk/gis.m/raster.tcl

@@ -1,471 +0,0 @@
-##########################################################################
-# raster.tcl - raster layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:    (C) 1999 - 2006 by the GRASS Development Team
-#
-#       This program is free software under the GNU General Public
-#       License (>=v2). Read the file COPYING that comes with GRASS
-#       for details.
-#
-##########################################################################
-
-namespace eval GmRaster {
-    variable array opt # raster current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # raster
-    variable array lfilemask # raster
-    variable optlist
-    variable array dup # vector
-}
-
-###############################################################################
-
-# create raster map node in layer tree
-proc GmRaster::create { tree parent } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "raster:$count"
-
-    #create form for layer tree entry
-    set frm [ frame .rastericon$count]
-    set check [checkbutton $frm.check \
-        -variable GmRaster::opt($count,1,_check) \
-        -height 1 -padx 0 -width 0]
-
-    image create photo rico -file "$iconpath/element-cell.gif"
-    set ico [label $frm.ico -image rico -bd 1 -relief raised]
-    pack $check $ico -side left
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    #insert new layer
-    if {[$tree selection get] != "" } {
-        set sellayer [$tree index [$tree selection get]]
-    } else {
-        set sellayer "end"
-    }
-
-    $tree insert $sellayer $parent $node \
-    -text  "raster $count"\
-    -window    $frm \
-    -drawcross auto
-
-    #set default option values
-    set opt($count,1,_check) 1
-    set dup($count) 0
-
-    set opt($count,1,opacity) 1.0
-    set opt($count,1,map) ""
-    set opt($count,1,drapemap) ""
-    set opt($count,1,brighten) 0
-    set opt($count,1,querytype) "cat"
-    set opt($count,1,rastquery) ""
-    set opt($count,1,rasttype) ""
-    set opt($count,1,bkcolor) ""
-    set opt($count,1,overlay) 1
-    set opt($count,1,mod) 1
-
-    set optlist {_check opacity map drapemap brighten querytype rastquery rasttype bkcolor \
-        overlay}
-
-    foreach key $optlist {
-        set opt($count,0,$key) $opt($count,1,$key)
-    }
-
-    # create files in tmp diretory for layer output
-    set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-    set lfilemask($count) $lfile($count)
-    append lfile($count) ".ppm"
-    append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-
-}
-
-###############################################################################
-
-proc GmRaster::set_option { node key value } {
-    variable opt
-
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-###############################################################################
-
-# select base raster map from list and put name in layer tree node
-proc GmRaster::select_map { id } {
-    variable tree
-    variable node
-    global mon
-
-    set m [GSelect cell title [G_msg "Raster map"] parent "."]
-    if { $m != "" } {
-        set GmRaster::opt($id,1,map) $m
-        GmTree::autonamel $m
-    }
-}
-
-# select drape raster map from list and put name in layer tree node
-proc GmRaster::select_drapemap { id } {
-    variable tree
-    variable node
-    global mon
-
-    set m [GSelect cell title [G_msg "Raster drape map"] parent "."]
-    if { $m != "" } {
-        set GmRaster::opt($id,1,drapemap) $m
-        GmTree::autonamel $m
-    }
-}
-
-###############################################################################
-
-# show base raster info in output window
-proc GmRaster::show_info { id } {
-	variable opt
-	set mapname $opt($id,1,map)
-	set cmd "r.info map=$mapname"		
-	run_panel $cmd
-}
-
-# show drape raster info in output window
-proc GmRaster::show_info_drape { id } {
-	variable opt
-	set mapname $opt($id,1,drapemap)
-	set cmd "r.info map=$mapname"		
-	run_panel $cmd
-}
-###############################################################################
-
-# set and display raster options
-proc GmRaster::options { id frm } {
-    variable opt
-    global iconpath
-    global bgcolor
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Display raster maps"] \
-        -fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    #opacity
-    set row [ frame $frm.opc]
-    Label $row.a -text [G_msg "Opaque "]
-    scale $row.b -from 1.0 -to 0.0 -showvalue 1 \
-        -orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-        -variable GmRaster::opt($id,1,opacity)
-    Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # raster name
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Base map:\t"]
-    Button $row.b -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "base raster map to display"]\
-        -command "GmRaster::select_map $id"
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmRaster::opt($id,1,map)
-    Label $row.d -text ""
-    Button $row.e -text [G_msg "base map info"] \
-            -image [image create photo -file "$iconpath/gui-rv.info.gif"] \
-            -command "GmRaster::show_info $id" \
-            -background $bgcolor \
-            -helptext [G_msg "base map info"]
-    Label $row.f -text ""
-    Button $row.g -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.rast" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-
-    # raster query
-    set row [ frame $frm.rquery ]
-    Label $row.a -text [G_msg "\tvalues to display"]
-    LabelEntry $row.b -textvariable GmRaster::opt($id,1,rastquery) -width 35
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # drape name
-    set row [ frame $frm.drapeinfo1 ]
-    Label $row.a -text [G_msg "\tOptional color draping. Use base map for shading,"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.drapeinfo2 ]
-    Label $row.a -text [G_msg "\tdrape map for color in color relief map or data fusion"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.drape ]
-    Label $row.a -text [G_msg "\tdrape map:  "]
-    Button $row.b -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "raster map to drape over base map"]\
-        -command "GmRaster::select_drapemap $id"
-    Entry $row.c -width 35 -text " $opt($id,1,drapemap)" \
-          -textvariable GmRaster::opt($id,1,drapemap)
-    Label $row.d -text ""
-    Button $row.e -text [G_msg "drape map info"] \
-            -image [image create photo -file "$iconpath/gui-rv.info.gif"] \
-            -command "GmRaster::show_info_drape $id" \
-            -background $bgcolor \
-            -helptext [G_msg "drape map info"] 
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-    
-    # HIS brightness for drape map
-    set row [ frame $frm.bright ]
-    Label $row.a -text [G_msg "\tdrape map brightness adjustment\t "]
-    SpinBox $row.b -range {-99 99 1} -textvariable GmRaster::opt($id,1,brighten) \
-		-width 3 -helptext [G_msg "Adjust brightness of drape map"] \
-		-entrybg white
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # overlay
-    set row [ frame $frm.over ]
-    checkbutton $row.a -text [G_msg "overlay maps from other layers (transparent null value cells)"] \
-        -variable GmRaster::opt($id,1,overlay)
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    # background color
-    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"}
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-
-# save raster node to workspace grc file
-proc GmRaster::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-         GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    }
-}
-
-
-###############################################################################
-
-# append elevation maps display lists for NVIZ
-proc GmRaster::addelev {node } {
-    variable opt
-    variable tree
-    global mon
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { ! ( $opt($id,1,_check) ) } { return }
-
-    set nvelev "$opt($id,1,map)"
-
-    return $nvelev
-}
-
-# append drape colors to display lists for NVIZ
-proc GmRaster::addcolor {node } {
-    variable opt
-    variable tree
-    global mon
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { ! ( $opt($id,1,_check) ) } { return }
-
-    if { $opt($id,1,drapemap) != "" } {
-        set nvcolor $opt($id,1,drapemap)
-    } else {
-        set nvcolor $opt($id,1,map)
-    }
-    return $nvcolor
-}
-
-###############################################################################
-
-# display raster map and output to graphic file for compositing
-proc GmRaster::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-
-    set rasttype ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return }
-
-    set cmd "d.rast map=$opt($id,1,map)"
-
-    # overlay
-    if { $opt($id,1,overlay) } {
-        append cmd " -o"
-    }
-
-    # set raster type
-    set rasttype ""
-    set rt ""
-    if {![catch {open "|r.info map=$opt($id,1,map) -t" r} rt]} {
-        set rasttype [read $rt]
-		if {[catch {close $rt} error]} {
-			GmLib::errmsg $error
-		}
-    }
-
-    if {$rasttype == "" || [regexp -nocase ".=CELL" $rasttype]} {
-        set querytype "cat"
-    } else {
-        set querytype "vallist"
-    }
-
-
-    # raster query
-    if { $opt($id,1,rastquery) != "" } {
-        append cmd " {$querytype=$opt($id,1,rastquery)}"
-    }
-
-    # background color
-    if { $opt($id,1,bkcolor) != "" } {
-        append cmd " bg=$opt($id,1,bkcolor)"
-    }
-
-    set cmd2 "d.his h_map=$opt($id,1,drapemap) i_map=$opt($id,1,map) brighten=$opt($id,1,brighten)"
-
-    if { $opt($id,1,drapemap) == "" } {
-        # set cmd $cmd
-    } else {
-        set cmd $cmd2
-    }
-
-    # Decide whether to run, run command, and copy files to temp
-    GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-###############################################################################
-
-# get selected raster map (used for query)
-proc GmRaster::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map) == "" } { return }
-
-    set mapname $opt($id,1,map)
-    return $mapname
-}
-
-###############################################################################
-
-# duplicate currently selected layer
-proc GmRaster::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "raster:$count"
-    set dup($count) 1
-
-    set frm [ frame .rastericon$count]
-    set check [checkbutton $frm.check \
-        -variable GmRaster::opt($count,1,_check) \
-        -height 1 -padx 0 -width 0]
-
-    image create photo rico -file "$iconpath/element-cell.gif"
-    set ico [label $frm.ico -image rico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-    # where to insert new layer
-    if {[$tree selection get] != "" } {
-        set sellayer [$tree index [$tree selection get]]
-    } else {
-        set sellayer "end"
-    }
-
-    if { $opt($id,1,map) == ""} {
-        $tree insert $sellayer $parent $node \
-        -text      "raster $count" \
-        -window    $frm \
-        -drawcross auto
-    } else {
-        $tree insert $sellayer $parent $node \
-        -text      "$opt($id,1,map)" \
-        -window    $frm \
-        -drawcross auto
-    }
-
-    set opt($count,1,opacity) $opt($id,1,opacity)
-
-    set optlist {_check map drapemap brighten querytype rastquery rasttype bkcolor \
-        overlay}
-
-    foreach key $optlist {
-        set opt($count,1,$key) $opt($id,1,$key)
-        set opt($count,0,$key) $opt($count,1,$key)
-    }
-
-    set id $count
-
-    # create files in tmp directory for layer output
-    set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-    set lfilemask($count) $lfile($count)
-    append lfile($count) ".ppm"
-    append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 368
gui/tcltk/gis.m/rastnums.tcl

@@ -1,368 +0,0 @@
-##########################################################################
-# rastnums.tcl - cell value display layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmRnums {
-    variable array opt # rnums current options
-    variable count 1
-    variable array tree # mon
-    variable array lfile # raster
-    variable array lfilemask # raster
-    variable optlist
-    variable array dup # vector
-}
-
-###############################################################################
-proc GmRnums::create { tree parent } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "rnums:$count"
-
-    set frm [ frame .rnumsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmRnums::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo nico -file "$iconpath/module-d.rast.num.gif"
-    set ico [label $frm.ico -image nico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-    
-    pack $check $ico -side left
-        
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "cell values $count"\
-	-window    $frm \
-	-drawcross auto  
-    
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,grid_color) "grey" 
-    set opt($count,1,text_color) "black" 
-    set opt($count,1,cellcolor) 0 
-    set opt($count,1,font) "" 
-    set opt($count,1,mod) 1
-
-	set optlist {_check map opacity grid_color text_color cellcolor font}
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-		return
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmRnums::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmRnums::select_map { id } {
-    variable tree
-    variable node
-    global mon
-    
-    set m [GSelect cell title [G_msg "Raster map"] parent "."]
-    if { $m != "" } { 
-        set GmRnums::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "cell values for %s"] $m]
-    }
-}
-
-##########################################################################
-proc GmRnums::set_font { id } {
-	variable opt
-	
-	if {$GmRnums::opt($id,1,font) != "" } {
-		set Gm::dfont $GmRnums::opt($id,1,font)
-	}
-	Gm::defaultfont drastnum
-	tkwait variable Gm::dfont
-	set GmRnums::opt($id,1,font) $Gm::dfont
-	set Gm::dfont ""
-
-
-}
-
-###############################################################################
-# Options for displaying cats in raster cells
-proc GmRnums::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display cell values from raster map or image"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.heading2 ]
-    Label $row.a -text [G_msg "  (resolution must be 100x100 or less)"]
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmRnums::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # raster name for histogram
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Raster to display: "]
-    Button $row.b -image [image create photo -file "$iconpath/element-cell.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmRnums::select_map $id"
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmRnums::opt($id,1,map)
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q d.rast.num" \
-		-background $bgcolor -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # grid color
-    set row [ frame $frm.grid ]
-    Label $row.a -text [G_msg "Color for cell grid:       "]
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmRnums::opt($id,1,grid_color) \
-		-values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"}
-    Label $row.c -text [G_msg "  cell values font "]
-    Button $row.d -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "select font for text"] \
-	    -command "GmRnums::set_font $id"
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # text color
-    set row [ frame $frm.text ]
-    Label $row.a -text [G_msg "Color for cell values:   "]
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmRnums::opt($id,1,text_color) \
-		-values {"white" "grey" "gray" "black" "brown" "red" "orange" \
-		"yellow" "green" "aqua" "cyan" "indigo" "blue" "purple" "violet" \
-		"magenta"}
-    checkbutton $row.c -text [G_msg "use raster colors for cell values"] \
-        -variable GmRnums::opt($id,1,cellcolor) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-proc GmRnums::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-         GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-###############################################################################
-proc GmRnums::display { node mod } {
-    global mon
-	global env
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable rasttype
-    variable tree
-    variable dup
-    variable count
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return } 
-
-    set cmd "d.rast.num map=$opt($id,1,map) grid_color=$opt($id,1,grid_color) \
-    	text_color=$opt($id,1,text_color)"
-
-    # include nulls
-    if { $opt($id,1,cellcolor) } { 
-        append cmd " -f"
-    }
-
-    
-	# only run if less than 100x100 cells
-	set string ""
-	set cells 0
-	
-	catch {set rc [open "|g.region -ugp" r]}
-	set rowscolumns [read $rc]
-	if {[catch {close $rc} error]} {
-		GmLib::errmsg $error "Region settings error"
-	}
-	regexp {rows=(\d*)} $rowscolumns string rows
-	regexp {cols=(\d*)} $rowscolumns string cols
-	set cells [expr $rows * $cols]
-	if {$cells < 1} {return}
-
-    # check value of GRASS_FONT variable prior to display
-	if {![catch {set env(GRASS_FONT)}]} {
-		set currfont $env(GRASS_FONT)
-	} else {
-		set currfont "romans"
-	}
-
-    # set grass font environmental variable to user selection"
-	if { $GmRnums::opt($id,1,font) != ""} { set env(GRASS_FONT) $GmRnums::opt($id,1,font) }
-
-	# can only display if 10K cells or less in region
-	if { $cells <= 10000} {
-		# Decide whether to run, run command, and copy files to temp
-		GmCommonLayer::display_command [namespace current] $id $cmd
-		set mapdispht $env(GRASS_HEIGHT)
-		set mapdispwd $env(GRASS_WIDTH)
-	} elseif {$opt($id,1,_check)} {
-		set msgtxt [G_msg "Cell values can only be displayed\nfor regions of < 10,000 cells"]
-		set answer [tk_messageBox -message $msgtxt -type ok -parent .mapcan($mon)]
-		if { $answer == "ok" } {return}
-    }
-	
-	# set grass font environmental variable to whatever it was when we started
-	# this lets different text layers have different fonts
-	
-	set env(GRASS_FONT) $currfont
-
-}
-    
-###############################################################################
-proc GmRnums::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    global mapname
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map) == "" } { return } 
-    
-    set mapname $opt($id,1,map)
-    return $mapname
-}
-
-###############################################################################
-proc GmRnums::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "rnums:$count"
-	set dup($count) 1
-
-    set frm [ frame .rnumsicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmRnums::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo nico -file "$iconpath/module-d.rast.num.gif"
-    set ico [label $frm.ico -image nico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	# where to insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "cell values $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "cell values for $opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist {_check map grid_color text_color cellcolor}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	set id $count
-
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}

+ 0 - 390
gui/tcltk/gis.m/rgbhis.tcl

@@ -1,390 +0,0 @@
-##########################################################################
-# rgbhis.tcl - RGB and HIS display layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmRgbhis {
-    variable array opt # rgbhis current options
-    variable count 1
-    variable array lfile # rgbhis
-    variable array lfilemask # rgbhis
-    variable optlist
-    variable array dup # vector
-}
-
-
-###############################################################################
-proc GmRgbhis::create { tree parent } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "rgbhis:$count"
-
-    set frm [ frame .rgbicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmRgbhis::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo rgbico -file "$iconpath/module-d.rgb.gif"
-    set ico [label $frm.ico -image rgbico -bd 1 -relief raised]
-    
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "RGB-HIS $count"\
-	-window    $frm \
-	-drawcross auto  
-    
-    #set default option values
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-
-    set opt($count,1,map1) "" 
-    set opt($count,1,map2) "" 
-    set opt($count,1,map3) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,overlay) 1 
-    set opt($count,1,rgb) 1 
-    set opt($count,1,his) 0 
-    set opt($count,1,mod) 1
-    set opt($count,1,brighten) 0
-
-
-	set optlist { _check map1 map2 map3 brighten opacity rgb his overlay}
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-	
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmRgbhis::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmRgbhis::select_map1 { id } {
-    variable tree
-    variable node
-    set m1 [GSelect cell title [G_msg "Raster map for red or hue channel"] parent "."]
-    if { $m1 != "" } { 
-        set GmRgbhis::opt($id,1,map1) $m1
-        GmTree::autonamel [format [G_msg "RGB-HIS %s"] $m1]
-    }
-}
-
-proc GmRgbhis::select_map2 { id } {
-    variable tree
-    variable node
-    set m2 [GSelect cell title [G_msg "Raster map for green or intensity channel"] parent "."]
-    if { $m2 != "" } { 
-        set GmRgbhis::opt($id,1,map2) $m2
-    }
-}
-proc GmRgbhis::select_map3 { id } {
-    variable tree
-    variable node
-    set m3 [GSelect cell title [G_msg "Raster map for blue or saturation channel"] parent "."]
-    if { $m3 != "" } { 
-        set GmRgbhis::opt($id,1,map3) $m3
-    }
-}
-###############################################################################
-# display RGB and HIS options
-proc GmRgbhis::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Display 3 raster maps as Red/Green/Blue or Hue/Intensity/Saturation channels"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmRgbhis::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # display type
-    set row [ frame $frm.type ]
-    radiobutton $row.a -variable GmRgbhis::opt($id,1,rgb) -value "1" \
-		-highlightthickness 0 
-	Label $row.b -anchor w -text [G_msg "display maps as RGB"]
-    Button $row.c -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.rgb" \
-            -background $bgcolor \
-            -helptext [G_msg "Help for RGB"]
-    Label $row.d -text " \t"
-    radiobutton $row.e -variable GmRgbhis::opt($id,1,rgb) -value "0" \
-		-highlightthickness 0 
-	Label $row.f -anchor w -text [G_msg "display maps as HIS"]
-    Button $row.g -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.his" \
-            -background $bgcolor \
-            -helptext [G_msg "Help for HIS"]
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # raster1 name
-    set row [ frame $frm.name1 ]
-    Label $row.a -text [G_msg "red (RGB) or hue (HIS): "]
-    Button $row.b -image [image create photo -file "$iconpath/channel-red.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "raster map for red or hue channel (HIS drape)"]\
-		-command "GmRgbhis::select_map1 $id" -height 26
-    Entry $row.c -width 30 -text " $opt($id,1,map1)" \
-          -textvariable GmRgbhis::opt($id,1,map1)
-    pack $row.c $row.b $row.a -side right -padx 3
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # raster2 name
-    set row [ frame $frm.name2 ]
-    Label $row.a -text [G_msg "green (RGB) or intensity (HIS): "]
-    Button $row.b -image [image create photo -file "$iconpath/channel-green.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "raster map for green or intensity channel (HIS relief)"]\
-		-command "GmRgbhis::select_map2 $id" -height 26
-    Entry $row.c -width 30 -text " $opt($id,1,map2)" \
-          -textvariable GmRgbhis::opt($id,1,map2) 
-    pack $row.c $row.b $row.a -side right -padx 3
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # raster3 name
-    set row [ frame $frm.name3 ]
-    Label $row.a -text [G_msg "blue (RGB) or saturation (HIS): "]
-    Button $row.b -image [image create photo -file "$iconpath/channel-blue.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "raster map for blue or saturation channel"]\
-		-command "GmRgbhis::select_map3 $id" -height 26
-    Entry $row.c -width 30 -text " $opt($id,1,map3)" \
-          -textvariable GmRgbhis::opt($id,1,map3) 
-    pack $row.c $row.b $row.a -side right -padx 3
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-    
-    # HIS brightness
-    set row [ frame $frm.bright ]
-    Label $row.a -anchor w -text [G_msg "HIS brightness adjustment\t "]
-    SpinBox $row.b -range {-99 99 1} -textvariable GmRgbhis::opt($id,1,brighten) \
-		-width 3 -helptext [G_msg "Adjusts the HIS intensity channel brightness"] \
-		-entrybg white
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # overlay
-    set row [ frame $frm.over ]
-    checkbutton $row.a -text [G_msg "overlay maps from other layers (transparent null value cells)"] \
-	-variable GmRgbhis::opt($id,1,overlay) 
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes -padx 5 -pady 1
-
-    # something changed, redraw needed
-    set opt($id,1,mod) "1"
-
-}
-
-###############################################################################
-proc GmRgbhis::save { tree depth node } {
-    variable opt
-    variable optlist
-    global mon
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-
-###############################################################################
-proc GmRgbhis::display { node mod} {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    
-    set line ""
-    set input ""
-    
-    set cmd1 ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map1) == "" } { return } 
-    if { $opt($id,1,map2) == "" &&  $opt($id,1,map3) == "" && $opt($id,1,rgb) == 1 } { 
-        return 
-     } 
-  
-    if { $opt($id,1,rgb) == 1 } { 
-        set cmd1 "d.rgb red=$opt($id,1,map1) green=$opt($id,1,map2) blue=$opt($id,1,map3)" 
-     } else { 
-		set cmd1 "d.his h_map=$opt($id,1,map1)"
-	
-		if { $opt($id,1,map2) != "" } {
-			append cmd1 " i_map=$opt($id,1,map2)"
-		}
-		if { $opt($id,1,map3) != "" } {
-			append cmd1 " s_map=$opt($id,1,map3)"
-		}
-		if { $opt($id,1,brighten) != "0" } {
-			append cmd1 " brighten=$opt($id,1,brighten)"
-		}
-    }		
-
-    # overlay
-    if { $opt($id,1,overlay) && $opt($id,1,rgb) == 1 } { 
-		append cmd1 " -o"
-    } else {
-		append cmd1 " -n"
-    }
-
-    # Decide whether to run, run commands, and copy files to temp
-    # Original logic here was to erase before drawing his if both exist
-    # Was this really supposed to be mutually exclusive?
-    GmCommonLayer::display_commands [namespace current] $id [list $cmd1]
-}
-
-
-
-###############################################################################
-proc GmRgbhis::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-    global iconpath
-    global mon
-
-    set node "rgbhis:$count"
-	set dup($count) 1
-
-    set frm [ frame .rgbhisicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmRgbhis::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo rgbico -file "$iconpath/module-d.rgb.gif"
-    set ico [label $frm.ico -image rgbico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	# where to insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map1) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "RGB-HIS $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "RGB-HIS $opt($id,1,map1)" \
-		-window    $frm \
-		-drawcross auto
-	}
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check map1 map2 map3 rgb his overlay brighten}
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	set id $count
-
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}
-
-###############################################################################
-proc GmRgbhis::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map1) == "" && $opt($id,1,map2) == "" } { return }
-
-    set mapname "$opt($id,1,map1),$opt($id,1,map2)"
-
-    if {$opt($id,1,map3) != ""} {
-    	append mapname ",$opt($id,1,map3)"
-    }
-    
-    return $mapname
-}

+ 0 - 259
gui/tcltk/gis.m/rules.tcl

@@ -1,259 +0,0 @@
-################################################################################
-#   
-#       FILE:       rules.tcl
-#   
-#       PURPOSE:    Permits interactive rule entry for r.reclass and r.recode
-#  
-#       AUTHOR:     Michael Barton, Arizona State University
-#       COPYRIGHT:  (C) 2007 by the GRASS Development Team
-#                   This program is free software under the GNU General Public
-#                   License (>=v2). Read the file COPYING that comes with GRASS
-#                   for details.
-#
-#
-################################################################################
-
-
-
-
-namespace eval GmRules {
-    variable inmap
-    variable outmap
-    variable rules
-    variable overwrite
-	global env
-
-}
-# G_msg.tcl should be sourced first for internationalized strings.
-
-
-###############################################################################
-
-# select input map
-proc GmRules::select_map { seltype } {
-
-    set m [GSelect $seltype title [G_msg "Select input map"] parent "."]
-    if { $m != "" } {
-        set GmRules::inmap $m
-    }
-}
-
-###############################################################################
-
-#Create main panel for interactie rules entry
-proc GmRules::main { cmd } {
-    variable inmap
-    variable outmap
-    variable rules
-    variable overwrite
-	global env
-	global iconpath
-	global bgcolor
-		
-	#initialize variables
-	set inmap ""
-	set outmap ""
-	set rules ""
-	set overwrite 0
-	
-	switch $cmd {
-        "r.colors" {
-            set label1 "Create new color table using color rules"
-            set label2 "Raster map:"
-            set label3 None
-            set label4 "Enter color rules"
-            set btn_icon "element-cell.gif"
-            set seltype "cell"
-        }
-        "r.reclass" {
-            set label1 "Reclassify raster map using rules"
-            set label2 "Map to reclassify: \t"
-            set label3 "Reclassified map: \t"
-            set label4 "Enter reclassification rules"
-            set btn_icon "element-cell.gif"
-            set seltype "cell"
-        }
-        "r.recode" {
-            set label1 "Recode raster map using rules"
-            set label2 "Map to recode:"
-            set label3 "Recoded map:"
-            set label4 "Enter recoding rules"
-            set btn_icon "element-cell.gif"
-            set seltype "cell"
-        }
-        "v.reclass" {
-            set label1 "Reclassify vector map using SQL rules"
-            set label2 "Map to reclassify:"
-            set label3 "Reclassified map:"
-            set label4 "Enter reclassification rules"
-            set btn_icon "element-vector.gif"
-            set seltype "vector"
-        }
-    }
-
-        
-	# create rules input window
-	set rules_win [toplevel .rulesPopup]
-	wm title $rules_win [ G_msg "Interactive rules entry" ]
-	# put it in the middle of the screen
-	update idletasks
-	set winWidth [winfo reqwidth $rules_win]
-	set winHeight [winfo reqheight $rules_win]
-	set scrnWidth [winfo screenwidth $rules_win]
-	set scrnHeight [winfo screenheight $rules_win]
-	set x [expr ($scrnWidth - $winWidth) / 2-250]
-	set y [expr ($scrnHeight  - $winHeight) / 2]
-	wm geometry $rules_win +$x+$y
-	wm deiconify $rules_win
-        
-	#create the form and buttons
-
-    # Title
-    set row [ frame $rules_win.heading ]
-    Label $row.a -text [G_msg $label1] \
-        -fg MediumBlue
-    pack $row.a -side top -padx 5 -pady 3
-    pack $row -side top -fill x -expand yes
-
-    # input map
-    set row [ frame $rules_win.input ]
-    Label $row.a -text [G_msg "$label2"]
-    Button $row.b -image [image create photo -file "$iconpath/$btn_icon"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -command "GmRules::select_map $seltype"
-    Entry $row.c -width 30 -text "$inmap" \
-          -textvariable GmRules::inmap
-    pack $row.c $row.b $row.a -side right -padx 3 -anchor e
-    pack $row -side top -fill x -expand no -padx 5
-	
-    if { $cmd != "r.colors" } {
-        # set output file for everything exept r.colors
-        set row [ frame $rules_win.output ]
-        LabelEntry $row.a -label [G_msg "$label3"] \
-                    -textvariable GmRules::outmap -width 30
-        pack $row.a -side right -anchor e -padx 3
-        pack $row -side top -fill x -expand no -padx 5
-    }
-    
-    set row [ frame $rules_win.help ]
-    Button $row.a -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q $cmd" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a -side right -anchor e -padx 5
-    if { $cmd != "r.colors" } {
-        checkbutton $row.b -variable GmRules::overwrite \
-                -text [G_msg "Overwrite existing file"]
-        pack $row.b -side left -anchor w -padx 5
-    }
-    pack $row -side top -fill x -expand no
-
-    
-    # create text widget for rules entry
-    set row [ frame $rules_win.rulestxt ]
-    set rules_text [text $row.a \
-    	-wrap none -relief sunken  \
-    	-exportselection true \
-    	-height 15 -width 50 \
-    	-yscrollcommand "$row.b set" \
-    	-xscrollcommand "$row.c set"]
-	scrollbar $row.b -relief sunken -command "$rules_text yview"
-	scrollbar $row.c -relief sunken -command "$rules_text xview" \
-	    -orient horizontal
-    pack $row.c -side bottom -fill x -expand no
-    pack $row.a -side left -fill both -expand yes 
-    pack $row.b -side left -fill y -expand no 
-    pack $row -side top -expand yes -fill both -pady 3 -padx 5
-    
-    set row [ frame $rules_win.buttons ]
-    Button $row.a -text [G_msg "OK"] -width 8 -bd 1 \
-    	-command "GmRules::process_rules $cmd $rules_text 1" 
-    Button $row.b -text [G_msg "Cancel"] -width 8 -bd 1 \
-    	-command "destroy .rulesPopup"
-    Button $row.c -text [G_msg "Apply"] -width 8 -bd 1 \
-    	-command "GmRules::process_rules $cmd $rules_text 0"
-    pack $row.a $row.b $row.c -side right -padx 5
-    pack $row -side bottom -pady 3 -padx 5 -expand 0 -fill none -anchor e
-    
-    bind Text <Control-c> {tk_textCopy %W}
-    bind Text <Control-v> {tk_textPaste %W}
-
-}
-
-###############################################################################
-# send rules to command
-proc GmRules::process_rules { cmd w quit } {
-    variable inmap
-    variable outmap
-    variable overwrite
-    global devnull
-
-    if { $inmap == ""} {
-        tk_messageBox -type ok -icon warning -parent $w \
-		-message [G_msg "You must select an input map"] -title [G_msg "No input map selected"]
-        return
-    }
-    if { $cmd != "r.colors" && $outmap == ""} {
-        tk_messageBox -type ok -icon warning -parent $w \
-		-message [G_msg "You must specify an output map"] -title [G_msg "No output map specified"]
-        return
-    }    
-    
-    # make tempfile to store rules for input into command
-    set rulespid [pid]
-	
-	if {[catch {set rulesfile [exec g.tempfile pid=$rulespid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-
-    # get rules from text widget
-    set rules [$w get 1.0 end]
-    set rules [string trim $rules]
-    if { $cmd == "r.recode" } {
-        set rules "$rules\n"
-     }
-    
-    # save rules to tempfile
-    catch {set output [open $rulesfile w ]}
-        puts $output $rules
-	if {[catch {close $output} error]} {
-		GmLib::errmsg $error [G_msg "Error creating rules file"]
-		return
-	}
-	
-	set options {}
-	
-	if { $cmd == "r.colors"} {
-	    lappend options "map=$inmap"
-	} else {
-	    lappend options "input=$inmap"
-	}
-
-    lappend options "rules=$rulesfile"
-    
-    if { $cmd != "r.colors"} {
-        lappend options "output=$outmap"
-    }
-
-	# set overwrite flage
-    if { $overwrite == 1} {
-        lappend options "--o"
-    } 
-
-    
-    if {[catch {eval [list exec -- $cmd] $options} error]} {
-		tk_messageBox -type ok -icon error -message [G_msg $error]
-	}
-    
-
-    # delete rules file and close popup window when finished
-    
-    if { $quit == 1 } {
-        file delete $rulesfile
-        destroy .rulesPopup
-    }
-
-
-}
-

+ 0 - 287
gui/tcltk/gis.m/runandoutput.tcl

@@ -1,287 +0,0 @@
-############################################################################
-#
-# LIBRARY:      runandoutput.tcl
-# AUTHOR(S):    Cedric Shock (cedricgrass AT shockfamily.net)
-# PURPOSE:      Interactive console for gis.m and other run commands
-# COPYRIGHT:    (C) 2006 GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-############################################################################
-
-#############################################
-#Overloaded gui.tcl behaviour:
-
-# Overload run_cmd (proc called when run button is pushed)
-proc run_cmd {dlg} {
-	global gronsole
-	global opt
-
-	set cmd [dialog_get_command $dlg]
-
-	catch {$opt($dlg,run_button) configure -state disabled}
-
-	$gronsole run $cmd {} "catch {$opt($dlg,run_button) configure -state active}"
-	
-	# Bring that output window up:
-	raise [winfo toplevel $gronsole]
-}
-
-# no output or progress or buttons:
-proc make_output {dlg path root} {}
-proc make_progress {dlg path root} {}
-proc make_buttons {dlg path root} {}
-
-###########################################
-
-proc make_fun_buttons {dlg path} {
-	global opt env
-	set pgm_name $opt($dlg,pgm_name)
-
-	set buttonframe [frame $path.buttonframe]
-	button $buttonframe.run   -text [G_msg "Run"]   -command "run_cmd $dlg"
-	# In the future we'll have a button to make a layer from here:
-	# button $buttonframe.layer -text [G_msg "Layer"] -command "layer_cmd $dlg"
-	button $buttonframe.help  -text [G_msg "Help"]  -command "help_cmd $dlg"
-	button $buttonframe.close -text [G_msg "Close"] -command "close_cmd $dlg"
-
-	set opt($dlg,run_button) $buttonframe.run 
-
-	# Turn off help button if the help file doesn't exist
-	if {! [file exists $env(GISBASE)/docs/html/$pgm_name.html]} {
-		$buttonframe.help configure -state disabled
-	}
-
-	pack $buttonframe.run $buttonframe.help $buttonframe.close \
-		-side left -expand yes -padx 5 -pady 5
-	pack $buttonframe -expand no -fill x -side bottom -before [lindex [pack slaves $path] 0]
-
-	# Set the starting window size if this is a toplevel window
-	if {[winfo toplevel $path] == $path} {
-		wm geometry $path "560x400"
-	}
-}
-
-proc run_ui {cmd} {
-    global dlg 
-    global path
-    global devnull
-
-    set program [lindex $cmd 0]
-    set code ""
-
-	if {[catch {set code [exec -- $program --tcltk 2> $devnull]} error]} {
-		GmLib::errmsg $error
-	}
-
-    set path .dialog$dlg
-    toplevel $path
-    
-    if {$code == ""} { return }
-    eval $code
-
-    # Push the command to the dialog
-    set thisdialog $dlg
-    dialog_set_command $dlg $cmd
-
-    # Add our ui
-    make_fun_buttons $dlg $path
-}
-
-#################################################
-
-proc run_disabled {gronsole button cmd} {
-	if {[catch {$button configure -state disabled} error]} {
-		GmLib::errmsg $error
-	}
-
-	$gronsole run $cmd {running} "catch {$button configure -state active}"
-}
-
-proc gronsole_history {cmdtext ci cmd} {
-	$cmdtext delete 1.0 end
-	$cmdtext insert end $cmd
-}
-
-proc command_window {where} {
-	global keycontrol
-	global bgcolor
-	set cmdpane [frame $where.command -bg $bgcolor]
-	set cmdwin [ScrolledWindow $where.win -relief flat -borderwidth 1]
-	set gronsole [Gronsole $where.gronsole -clickcmd "gronsole_history $cmdwin.text"]
-	set cmdtext [text $cmdwin.text -height 2 -width 80] 
-	$cmdwin setwidget $cmdtext
-	set runbutton [button $cmdpane.run -text [G_msg "Run"] -width 14 -wraplength 90 -default active -bd 1 \
-		-command "run_disabled $gronsole $cmdpane.run \[string trim \[$cmdtext get 1.0 end\]\]"]
-	set run2button [button $cmdpane.run2 -text [G_msg "Run (background)"] -width 14 -wraplength 90 -bd 1 \
-		-command "$gronsole run \[string trim \[$cmdtext get 1.0 end\]\] {} {}"]
-	set runuibutton [button $cmdpane.runui -text [G_msg "Run (GUI)"] -width 14 -wraplength 90 -bd 1 \
-		-command "run_ui \[string trim \[$cmdtext get 1.0 end\]\]"]
-	set runxterm [button $cmdpane.xterm -text [G_msg "Run (in Xterm)"] -width 14 -wraplength 90 -bd 1 \
-		-command "$gronsole run_xterm \[string trim \[$cmdtext get 1.0 end\]\] {}"]
-	set outpane [frame $where.output -bg $bgcolor]
-	set savebutton [button $outpane.save -text [G_msg "Save"] -command "$gronsole save" \
-		-bd 1 -padx 10]
-	set clearbutton [button $outpane.clear -text [G_msg "Clear"] -command "$gronsole clear" \
-		-bd 1 -padx 10]
-
-	pack $runbutton $run2button $runuibutton $runxterm \
-		-side left -expand yes -padx 5 -pady 5
-	pack $savebutton $clearbutton \
-		-side left -expand yes -padx 5 -pady 5
-
-	pack $cmdpane -fill x -side bottom
-	pack $cmdwin -fill x -side bottom
-	pack $outpane -fill x -side bottom
-	pack $gronsole -side top -fill both -expand yes
-
-	bind $cmdtext <$keycontrol-c> "tk_textCopy %W"
-	bind $cmdtext <$keycontrol-v> "tk_textPaste %W"
-	bind $cmdtext <$keycontrol-x> "tk_textCut %W"
-
-	return $gronsole
-}
-
-toplevel .gronsole
-wm title .gronsole [G_msg "Output - GIS.m"]
-
-# If we had our own window manager we could withdraw windows instead of iconifying them:
-wm protocol .gronsole WM_DELETE_WINDOW "wm iconify .gronsole"
-
-set gronsole [command_window {.gronsole}]
-
-###############################################################################
-# Run procs for gis.m:
-
-################################################################################
-
-proc execute {cmd} {
-    # Use run and output
-    run_ui $cmd
-}
-
-###############################################################################
-proc spawn {cmd args} {
-
-	if {[catch {eval [list exec -- $cmd] $args &} error]} {
-		GmLib::errmsg $error
-	}
-
-}
-
-###############################################################################
-proc spawn_panel {cmd args} {
-	global gronsole
-
-	$gronsole run $cmd gism {}
-}
-
-###############################################################################
-
-proc run_panel {cmd} {
-	global gronsole
-
-	$gronsole run_wait $cmd gism
-}
-
-###############################################################################
-proc run {cmd args} {
-	global devnull
-
-	# This and runcmd are being used to run command in the background
-	# These used to go to stdout and stderr
-	# but we don't want to pollute that console.
-	# eval exec -- $cmd $args >@ stdout 2>@ stderr
-	
-	if {[catch {eval [list exec -- $cmd] $args >& $devnull} error]} {
-		GmLib::errmsg $error
-	}
-
-	
-}
-
-###############################################################################
-
-proc runcmd {cmd args} {
-	global gronsole
-
-	set ci [$gronsole annotate $cmd [list gism running]]
-
-	eval run $cmd $args
-
-	$gronsole remove_tag $ci running	
-}
-
-###############################################################################
-proc term_panel {cmd} {
-	global gronsole
-
-	$gronsole run_xterm $cmd gism
-}
-
-###############################################################################
-proc term {cmd args} {
-	global env
-	global mingw
-	
-	if { $mingw == "1" } {
-		if {[catch {eval [list exec -- cmd.exe /c start $env(GISBASE)/etc/grass-run.bat $cmd] $args &} error]} {
-			GmLib::errmsg $error
-		}
-	   
-	} else {
-		if {[catch {eval [list exec -- $env(GISBASE)/etc/grass-xterm-wrapper -name xterm-grass -e $env(GISBASE)/etc/grass-run.sh $cmd] $args &} error]} {
-			GmLib::errmsg $error
-		}
-	   
-	}
-}
-
-###############################################################################
-# Make sure there's an xmon before running some commands.
-# Used in menus.
-
-proc guarantee_xmon {} {
-	if {![catch {open "|d.mon -L" r} input]} {
-		while {[gets $input line] >= 0 } {
-			if {[regexp -nocase {(x[0-9]+).*not running} $line dummy monitor]} {
-				# $monnum is the monitor number
-				#create list of non-running monitors
-				lappend xmonlist $monitor
-			}
-		}
-
-	}
-
-	if {[catch {close $input} error]} {
-		tk_messageBox -type ok -icon error -title [G_msg "Error"] \
-			-message [G_msg "d.mon error: problem launching xmon, $error"]
-		return
-	}
-
-	if { ![info exists xmonlist] } {
-		tk_messageBox -type ok -icon error -title [G_msg "Error"] \
-			-message [G_msg "This module requires X11 support, but no xmons were found"]
-		return
-	}
-
-	set xmon  [lindex $xmonlist 0]
-	spawn d.mon start=$xmon
-}
-
-###############################################################################
-# Annotation procs for gis.m:
-
-proc monitor_annotation_start {mon title tags} {
-	global gronsole
-	set handle [$gronsole annotate $title $tags]
-	$gronsole set_click_command $handle {}
-	return $handle
-}
-
-proc monitor_annotate {handle text} {
-	global gronsole
-	$gronsole annotate_text $handle $text
-}

+ 0 - 827
gui/tcltk/gis.m/thematic.tcl

@@ -1,827 +0,0 @@
-##########################################################################
-# thematic.tcl - thematic vector mapping layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmThematic {
-    variable array opt # thematic current options
-	variable array tlegend # mon id
-	variable array tlegcan # mon id
-    variable count 1
-    variable array lfile # raster
-    variable array lfilemask # raster
-    variable optlist
-    variable array dup # vector
-}
-
-
-###############################################################################
-# create new thematic layer
-
-proc GmThematic::create { tree parent } {
-    variable opt
-    variable count
-    variable dup
-    variable lfile
-    variable lfilemask
-    variable optlist
-    global iconpath
-
-    set node "thematic:$count"
-
-    set frm [ frame .thematicicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmThematic::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo thematicico -file "$iconpath/module-d.vect.thematic.gif"
-    set ico [label $frm.ico -image thematicico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-    
-    pack $check $ico -side left
-    
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text  "thematic $count"\
-	-window    $frm \
-	-drawcross auto  
-        
-    set opt($count,1,_check) 1 
-    set dup($count) 0
-    
-    set opt($count,1,map) "" 
-	set opt($count,1,opacity) 1.0
-    set opt($count,1,type) "area"
-    set opt($count,1,column) "" 
-    set opt($count,1,themetype) "graduated_colors" 
-    set opt($count,1,themecalc) "interval" 
-    set opt($count,1,breakpoints) "" 
-    set opt($count,1,where) "" 
-    set opt($count,1,layer) 1 
-    set opt($count,1,icon) "basic/circle" 
-    set opt($count,1,ptsize) 5 
-    set opt($count,1,maxsize) 20 
-    set opt($count,1,nint) 4 
-    set opt($count,1,colorscheme) "blue-red" 
-    set opt($count,1,pointcolor) \#FF0000 
-    set opt($count,1,linecolor) \#000000 
-    set opt($count,1,startcolor) \#FF0000 
-    set opt($count,1,endcolor) \#0000FF 
-    set opt($count,1,update_rgb) 0 
-    set opt($count,1,math) 0 
-    set opt($count,1,psmap) "" 
-    set opt($count,1,border) 1 
-    # keep font names here to make sure that all fonts used are in proper TclTk format
-    set opt($count,1,titlefont) "{times} 14 bold" 
-    set opt($count,1,subtitlefont) "{times} 12 bold"
-    set opt($count,1,labelfont) "{times} 12" 
-    set opt($count,1,tfontcolor) \#000000  
-    set opt($count,1,lfontcolor) \#000000  
-    set opt($count,1,mod) 1
-
-	set optlist { _check map opacity type column themetype themecalc breakpoints where \
-             layer icon ptsize maxsize nint colorscheme pointcolor linecolor\
-             startcolor endcolor border update_rgb math psmap \
-             titlefont tfontcolor subtitlefont labelfont lfontcolor} 
-
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-    
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-    
-    incr count
-    return $node
-}
-
-###############################################################################
-
-proc GmThematic::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-}
-
-proc GmThematic::select_map { id } {
-    variable tree
-    variable node
-    set m [GSelect vector title [G_msg "Vector map"] parent "."]
-    if { $m != "" } { 
-        set GmThematic::opt($id,1,map) $m
-        GmTree::autonamel [format [G_msg "thematic map for %s"] $m]
-    }
-}
-
-###############################################################################
-# select fonts for legend
-proc GmThematic::select_tfont { id frm} {
-	variable opt
-    
-    set fon [SelectFont $frm.font -type dialog -sampletext [G_msg "This is font sample text."] -title [G_msg "Select font"]]
-	if { $fon != "" } {set opt($id,1,titlefont) $fon}
-}
-
-proc GmThematic::select_stfont { id frm} {
-	variable opt
-    
-    set fon [SelectFont $frm.font -type dialog -sampletext [G_msg "This is font sample text."] -title [G_msg "Select font"]]
-	if { $fon != "" } {set opt($id,1,subtitlefont) $fon}
-}
-proc GmThematic::select_lfont { id frm} {
-	variable opt
-    
-    set fon [SelectFont $frm.font -type dialog -sampletext [G_msg "This is font sample text."] -title [G_msg "Select font"]]
-	if { $fon != "" } {set opt($id,1,labelfont) $fon}
-}
-
-###############################################################################
-# show attribute columns and attribute values
-
-proc GmThematic::show_columns { id } {
-	variable opt
-	global bgcolor
-	set mapname $opt($id,1,map)
-	set layernum $opt($id,1,layer)
-	set cmd "v.info -c map=$mapname layer=$layernum"
-	run_panel $cmd
-}
-
-proc GmThematic::show_data { id } {
-	variable opt
-	global bgcolor
-	set mapname $opt($id,1,map)
-	set layer $opt($id,1,layer)
-	if {![catch {open "|v.db.connect map=$mapname layer=$layer -g" r} vdb]} {
-		set vectdb [read $vdb]
-		if {[catch {close $vdb} error]} {
-			GmLib::errmsg $error
-		}
-		set vdblist [split $vectdb " "]
-		set tbl [lindex $vdblist 1]
-		set db [lindex $vdblist 3]
-		set drv [lindex $vdblist 4]
-		set cmd "db.select table=$tbl database=$db driver=$drv"
-		run_panel $cmd
-	}
-}
-
-###############################################################################
-
-# select symbols from directories
-proc GmThematic::select_symbol { id } {
-    variable opt
-    set i [GSelect symbol title [G_msg "Vector point symbol"] parent "."]
-    if { $i != "" } {
-        set GmThematic::opt($id,1,icon) $i
-    }
-}
-
-###############################################################################
-
-# set thematic options
-proc GmThematic::options { id frm } {
-    variable opt
-    global iconpath
-    global bgcolor
-
-    # Panel heading
-    set row [ frame $frm.heading1 ]
-    Label $row.a -text [G_msg "Display vector maps thematically by graduate colors (all types)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-    set row [ frame $frm.heading2 ]
-    Label $row.a -text [G_msg "  or by graduated sizes (points and lines)"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmThematic::opt($id,1,opacity) 
-	Label $row.c -text [G_msg " Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # vector name
-    set row [ frame $frm.map ]
-    Label $row.a -text [G_msg "Vector map:"]
-    Button $row.b -image [image create photo -file "$iconpath/element-vector.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "vector for thematic mapping"] \
-		-command "GmThematic::select_map $id"
-    Entry $row.c -width 35 -text " $opt($id,1,map)" \
-          -textvariable GmThematic::opt($id,1,map) 
-    Label $row.d -text "   "
-    Button $row.e -text [G_msg "Help"] \
-            -image [image create photo -file "$iconpath/gui-help.gif"] \
-            -command "spawn g.manual --q d.vect.thematic" \
-            -background $bgcolor \
-            -helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # vector type and layer
-    set row [ frame $frm.vtype ]
-    Label $row.a -text [G_msg "    vector type"] 
-    ComboBox $row.b -padx 2 -width 10 -textvariable GmThematic::opt($id,1,type) \
-                    -values {"area" "point" "centroid" "line" "boundary"}
-    Label $row.c -text [G_msg " attribute layer"]
-    LabelEntry $row.d -textvariable GmThematic::opt($id,1,layer) -width 3 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # vector column
-    set row [ frame $frm.column ]
-    Label $row.a -text [G_msg "    NUMERIC attribute column to use for thematic map"]
-    LabelEntry $row.b -textvariable GmThematic::opt($id,1,column) -width 15
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-    
-	#show columns and data
-	set row [ frame $frm.columns ]
-    Label $row.a -text [G_msg "    show attribute columns"] 
-    Button $row.b -text [G_msg "columns"] \
-            -image [image create photo -file "$iconpath/db-columns.gif"] \
-            -command "GmThematic::show_columns $id" \
-            -background $bgcolor \
-            -helptext [G_msg "Show columns"]
-    Label $row.c -text [G_msg "   show data"] 
-    Button $row.d -text [G_msg "data"] \
-            -image [image create photo -file "$iconpath/db-values.gif"] \
-            -command "GmThematic::show_data $id" \
-            -background $bgcolor \
-            -helptext [G_msg "Show data"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-    
-    # Thematic type
-    set row [ frame $frm.ttype ]
-    Label $row.a -text [G_msg "Thematic map: type"] 
-    ComboBox $row.b -padx 2 -width 16 -textvariable GmThematic::opt($id,1,themetype) \
-		-values {"graduated_colors" "graduated_points" "graduated_lines"} 
-    Label $row.c -text [G_msg " map by"] 
-    ComboBox $row.d -padx 2 -width 15 -textvariable GmThematic::opt($id,1,themecalc) \
-		-values {"interval" "std_deviation" "quartiles" \
-		"custom_breaks"} 
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # intervals
-    set row [ frame $frm.int ]
-    Label $row.a -text [G_msg "    number of intervals to map (interval themes):"]
-    SpinBox $row.b -range {1 99 1} -textvariable GmThematic::opt($id,1,nint) \
-                    -width 3 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # breakpoints
-    set row [ frame $frm.break ]
-    Label $row.a -text [G_msg "    custom breakpoints (val val ...)  "]
-    LabelEntry $row.b -textvariable GmThematic::opt($id,1,breakpoints) -width 32
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # where
-    set row [ frame $frm.where ]
-    Label $row.a -text [G_msg "    query with SQL where clause   "]
-    LabelEntry $row.b -textvariable GmThematic::opt($id,1,where) -width 32 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # point options1
-    set row [ frame $frm.pts1 ]  
-    Label $row.a -text [G_msg "Graduated points & lines: "]
-    Button $row.b -text [G_msg "icon"] \
-	    -command "GmThematic::select_symbol $id"
-    Entry $row.c -width 10 -text "$opt($id,1,icon)" \
-	    -textvariable GmThematic::opt($id,1,icon)  
-    Label $row.d -text [G_msg "point color"] 
-    SelectColor $row.e -type menubutton -variable GmThematic::opt($id,1,pointcolor)
-    Label $row.f -text [G_msg "line color"] 
-    SelectColor $row.g -type menubutton -variable GmThematic::opt($id,1,linecolor)
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-
-    # point options2
-    set row [ frame $frm.pts2 ]  
-    Label $row.a -text [G_msg "    size/min size (graduated pts/lines)"]
-    SpinBox $row.b -range {1 50 1} -textvariable GmThematic::opt($id,1,ptsize) \
-        -width 2 -helptext [G_msg "icon size/min size (graduated pts/lines)"]
-    Label $row.c -text [G_msg "max size (graduated pts)"]
-    SpinBox $row.d -range {1 50 1} -textvariable GmThematic::opt($id,1,maxsize) \
-        -width 2 -helptext [G_msg " max size (graduated pts/lines)"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-    # color options1
-    set row [ frame $frm.color1 ]
-    Label $row.a -text [G_msg "Graduated colors: preset color schemes"] 
-    ComboBox $row.b -padx 2 -width 18 -textvariable GmThematic::opt($id,1,colorscheme) \
-        -values {"blue-red" "red-blue" "green-red" "red-green" \
-        "blue-green" "green-blue" "cyan-yellow" "yellow-cyan" "custom_gradient" \
-        "single_color" } 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # color options2
-    set row [ frame $frm.color2 ]
-    Label $row.a -text [G_msg "    custom color scheme - start color"]
-    SelectColor $row.b -type menubutton -variable GmThematic::opt($id,1,startcolor)
-    Label $row.c -text [G_msg " end color"]
-    SelectColor $row.d -type menubutton -variable GmThematic::opt($id,1,endcolor)
-    checkbutton $row.e -text [G_msg "draw border"] -variable GmThematic::opt($id,1,border)     
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-    
-    # color options3
-    set row [ frame $frm.color3 ]
-    Label $row.a -text "   "
-    checkbutton $row.b -text [G_msg "save thematic colors to GRASSRGB column of vector file"] -variable \
-        GmThematic::opt($id,1,update_rgb) 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # legend 1
-    set row [ frame $frm.legend1 ]
-    Label $row.a -text [G_msg "Legend: title font "] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "title font for legend"] \
-	    -command "GmThematic::select_tfont $id $frm"
-    Entry $row.c -width 15 -text "$opt($id,1,titlefont)" \
-	    -textvariable GmThematic::opt($id,1,titlefont)  
-    Label $row.d -text [G_msg " font color"]
-    SelectColor $row.e -type menubutton -variable GmThematic::opt($id,1,tfontcolor)
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-    
-    # legend 2
-    set row [ frame $frm.legend2 ]
-    Label $row.a -text [G_msg "    subtitle font    "] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "subtitle font for legend"] \
-	    -command "GmThematic::select_stfont $id $frm"
-    Entry $row.c -width 15 -text "$opt($id,1,subtitlefont)" \
-	    -textvariable GmThematic::opt($id,1,subtitlefont)  
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-    
-    # legend 3
-    set row [ frame $frm.legend3 ]
-    Label $row.a -text [G_msg "    label font       "] 
-    Button $row.b -image [image create photo -file "$iconpath/gui-font.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "label font for legend"] \
-	    -command "GmThematic::select_lfont $id $frm"
-    Entry $row.c -width 15 -text "$opt($id,1,labelfont)" \
-	    -textvariable GmThematic::opt($id,1,labelfont)  
-    Label $row.d -text [G_msg " font color"]
-    SelectColor $row.e -type menubutton -variable GmThematic::opt($id,1,lfontcolor)
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-    
-	# legend 4
-    set row [ frame $frm.legend4 ]
-    Label $row.a -text "   "
-    checkbutton $row.b -text [G_msg "use math notation in legend"] -variable \
-        GmThematic::opt($id,1,math) 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # psmap
-    set row [ frame $frm.psmap ]
-    Label $row.a -text [G_msg "Name for ps.map instruction files"]
-    LabelEntry $row.b -textvariable GmThematic::opt($id,1,psmap) -width 34 
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-# save to grc file
-
-proc GmThematic::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-
-###############################################################################
-
-# get selected vector map 
-proc GmThematic::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { $opt($id,1,map) == "" } { return ""} 
-
-
-    set mapname $opt($id,1,map)
-	return $mapname
-}
-
-###############################################################################
-# render and composite thematic layer
-
-proc GmThematic::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-
-    set line ""
-    set input ""
-    set cmd ""
-
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,map) == "" } { return } 
-    if { $opt($id,1,column) == "" } { return }
-
-    # set hex colors to rgb         
-    set pointcolor [GmLib::color $opt($id,1,pointcolor)]
-    set linecolor [GmLib::color $opt($id,1,linecolor)]
-    set startcolor [GmLib::color $opt($id,1,startcolor)]
-    set endcolor [GmLib::color $opt($id,1,endcolor)]
-    
-    # turn off x11 display
-    set monitor "none"
-
-    #create d.vect.thematic command
-    set cmd "d.vect.thematic -s map=$opt($id,1,map) type=$opt($id,1,type) column=$opt($id,1,column) \
-			layer=$opt($id,1,layer) icon=$opt($id,1,icon) size=$opt($id,1,ptsize) \
-            maxsize=$opt($id,1,maxsize) nint=$opt($id,1,nint) pointcolor=$pointcolor \
-			linecolor=$linecolor startcolor=$startcolor endcolor=$endcolor \
-			themetype=$opt($id,1,themetype) monitor=$monitor \
-			themecalc=$opt($id,1,themecalc) colorscheme=$opt($id,1,colorscheme)"
-             
-    # breakpoints
-    if { $opt($id,1,breakpoints) != "" } { 
-        append cmd " {breakpoints=$opt($id,1,breakpoints)}"
-    }
-
-    # where query
-    if { $opt($id,1,where) != "" } { 
-        append cmd " {where=$opt($id,1,where)}"
-    }
-
-    # psmap file 
-    if { $opt($id,1,psmap) != "" } { 
-        append cmd " psmap=$opt($id,1,psmap)"
-    }
-
-    # hide border
-    if { $opt($id,1,border) == 0 } { 
-        append cmd "  -f"
-    }
-
-    # update_rgb
-    if { $opt($id,1,update_rgb) == 1 } { 
-        append cmd " -u"
-    }
-
-    # math notation
-    if { $opt($id,1,math) == 1 } { 
-        append cmd " -m"
-    }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-
-	# Legend
-    if { $opt($id,1,_check) } {
-		GmThematic::tlegend $mon $id
-		GmThematic::tleg_item $mon $id
-	}
-	
-}
-
-
-###############################################################################
-# duplicate thematic layer 
-proc GmThematic::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	global iconpath
-
-    set node "thematic:$count"
-	set dup($count) 1
-
-    set frm [ frame .thematicicon$count]
-    set check [checkbutton $frm.check \
-		-variable GmThematic::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-
-    image create photo thematicico -file "$iconpath/module-d.vect.thematic.gif"
-    set ico [label $frm.ico -image thematicico -bd 1 -relief raised]
-
-    bind $ico <ButtonPress-1> "GmTree::selectn $tree $node"
-
-    pack $check $ico -side left
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,map) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "thematic $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "thematic map for $opt($id,1,map)" \
-		-window    $frm \
-		-drawcross auto
-	} 
-
-	set opt($count,1,opacity) $opt($id,1,opacity)
-	
-	set optlist { _check map type column themetype themecalc breakpoints where \
-		 layer icon ptsize maxsize nint colorscheme pointcolor linecolor\
-		 startcolor endcolor border update_rgb math psmap \
-		 titlefont tfontcolor subtitlefont labelfont lfontcolor} 
-
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-	
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}
-
-###############################################################################
-
-# create graphic legend in separate display canvas
-proc GmThematic::tlegend { mon id } {
-	global bgcolor
-	global iconpath
-    global env
-	variable opt
-	variable tlegend
-	variable tlegcan
-
-	if { [winfo exists .tlegend($mon,$id)] } {return}
-
-	set legendtitle [format [G_msg "Legend for Map %d, %s"] $mon $opt($id,1,map)]
-	toplevel .tlegend($mon,$id)
-    wm title .tlegend($mon,$id) $legendtitle
-
-
-    wm withdraw .tlegend($mon,$id)
-    #wm overrideredirect $txt 1
-
-	# create canvas for legend
-	set tlegmf [MainFrame .tlegend($mon,$id).mf ]
-	set tlegcan($mon,$id) [canvas $tlegmf.can -bg white\
-		-borderwidth 0 -closeenough 1.0 \
-        -relief ridge -selectbackground #c4c4c4 \
-        -width 300 -height 300 ]
-	   
-    # setting geometry
-    place $tlegcan($mon,$id) \
-        -in $tlegmf -x 0 -y 0 -anchor nw \
-        -bordermode ignore 
-
-	# control buttons
-	set tleg_tb [$tlegmf addtoolbar]
-	set tlbb [ButtonBox $tleg_tb.bb -orient horizontal]
-	$tlbb add -text [G_msg "clear"] -command "GmThematic::tleg_erase $mon $id" -bg #dddddd \
-		-highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
-        -helptext [G_msg "Clear legend"] -highlightbackground $bgcolor
-	$tlbb add -text [G_msg "save"] -command "GmThematic::tleg_save $mon $id"  -bg #dddddd \
-		-highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1 \
-        -helptext [G_msg "Save legend to EPS file"] -highlightbackground $bgcolor
-
-	pack $tlegmf -expand yes -fill both -padx 0 -pady 0
-	pack $tlegcan($mon,$id) -fill both -expand yes
-	pack $tlbb -side left -anchor w
-			
-	BWidget::place .tlegend($mon,$id) 0 0 at 500 100
-    wm deiconify .tlegend($mon,$id)
-
-}
-
-# read legend file and create legend items
-proc GmThematic::tleg_item { mon id } {
-	variable tlegend
-	variable tlegcan
-	variable opt
-	global legfile
-	
-	GmThematic::tleg_erase $mon $id
-	# get legend file created by d.vect.thematic in GRASS tmp diretory
-	set mappid [pid]
-	if {[catch {set tmpdir [file dirname [exec g.tempfile pid=$mappid]]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-
-	set legfile "$tmpdir/gismlegend.txt"
-	if {![file exists $legfile]} {return}
-	catch {set ltxt [open $legfile r]}
-	set x1 30
-	set y1 40
-	set txtx 60
-	set font $opt($id,1,labelfont)
-	regexp {.*\s(\d*)} $font string lineht
-	set yinc [expr {$lineht * 2}]	
-	
-	set titlefont $opt($id,1,titlefont)
-	set tfontcolor $opt($id,1,tfontcolor)
-	set subtitlefont $opt($id,1,subtitlefont)
-
-	set labelfont $opt($id,1,labelfont)
-	set lfontcolor $opt($id,1,lfontcolor)
-	while {![eof $ltxt]} {
-		gets $ltxt line
-		set type [lindex $line 0]
-		set fcolor [lindex $line 1]
-		set lcolor [lindex $line 2]
-		set size [lindex $line 3]
-		set label [lindex $line 4]
-		if { $fcolor != "-" } { set xfcolor [GmThematic::rgb2hex $fcolor] }
-		if { $lcolor != "-" } { set xlcolor [GmThematic::rgb2hex $lcolor] }
-		switch $type {
-			title {
-				regexp {.*\s(\d*)\s.*} $titlefont string lineht
-				set yinc [expr {$lineht * 2}]	
-				set x2 [expr {$x1 + 15}]
-				set y2 [expr {$y1 + 15}]
-				$tlegcan($mon,$id) create text $x1 $y2 -anchor sw -width 250 \
-					-fill $tfontcolor -font $titlefont -text "$label"
-			}
-			subtitle {
-				regexp {.*\s(\d*)\s.*} $subtitlefont string lineht
-				set yinc [expr {$lineht * 2}]	
-				set x2 [expr {$x1 + 15}]
-				set y2 [expr {$y1 + 15}]
-				$tlegcan($mon,$id) create text $x1 $y2 -anchor sw -width 250 \
-					-fill $tfontcolor -font $subtitlefont -text "$label"
-				incr y2 10
-				$tlegcan($mon,$id) create line $x1 $y2 [expr {$x1 + 250}] $y2 \
-					-width 1 -fill #000000				
-				incr y1 10
-			}
-			text {
-				regexp {.*\s(\d*)\s.*} $labelfont string lineht
-				set yinc [expr {$lineht * 2}]	
-				set x2 [expr {$x1 + 15}]
-				set y2 [expr {$y1 + 15}]
-				$tlegcan($mon,$id) create text $x1 $y2 -anchor sw -width 250 \
-					-fill $lfontcolor -font $labelfont -text "$label"
-			}
-			area {
-				regexp {.*\s(\d*)\s.*} $labelfont string lineht
-				set yinc [expr {$lineht * 2}]	
-				set x2 [expr {$x1 + 15}]
-				set y2 [expr {$y1 + 15}]
-				$tlegcan($mon,$id) create rectangle $x1 $y1 $x2 $y2 -fill $xfcolor \
-					-outline $xlcolor
-				$tlegcan($mon,$id) create text [expr {$x2 + 15}] [expr {(($y2-$y1)/2) + $y1}] \
-				-fill $lfontcolor -anchor w -font $labelfont -text "$label"
-			}
-			point {
-				regexp {.*\s(\d*)\s.*} $labelfont string lineht
-				set yinc [expr {$lineht * 2}]	
-				if { $size > [expr {$yinc + 2}] } {
-					incr y1 [expr {int(($size/5) + 2)}]
-				}
-				if { $txtx <= [expr {$x1 + $size + 15}] } {
-					set txtx [expr {$x1 + $size + 15}]
-				}
-				set x2 [expr {$x1 + $size}]
-				set y2 [expr {$y1 + $size}]
-				$tlegcan($mon,$id) create oval $x1 $y1 $x2 $y2 -fill $xfcolor \
-					-outline $xlcolor
-				$tlegcan($mon,$id) create text $txtx [expr (($y2-$y1)/2) + $y1] \
-				-fill $lfontcolor -anchor w -font $labelfont -text "$label"
-			}
-			line {
-				regexp {.*\s(\d*)\s.*} $labelfont string lineht
-				set yinc [expr {$lineht * 2}]	
-				set x2 [expr {$x1 + 15}]
-				set y2 [expr {$y1 + 15}]
-				$tlegcan($mon,$id) create line $x1 $y1 $x2 $y2 -width $size  \
-					-fill $xlcolor
-				$tlegcan($mon,$id) create text [expr $x2 + 15] [expr (($y2-$y1)/2) + $y1] \
-				-fill $lfontcolor -anchor w -font $labelfont -text "$label"
-			}
-			default { break }
-		}
-		if { $size > $yinc } {
-			incr y1 [expr {int($size + 2)}]
-		} else {
-			incr y1 $yinc
-		}
-	}
-	if {[catch {close $ltxt} error]} {
-		GmLib::errmsg $error
-	}
-
-	return
-}
-
-# rgb to hex color convertor
-proc GmThematic::rgb2hex { clr } {
-	set rgb [split $clr :]
-	set r [lindex $rgb 0]
-	set g [lindex $rgb 1]
-	set b [lindex $rgb 2]
-	if {$r == "" || $g == "" || $b == ""} {return}
-	set xclr [format "#%02x%02x%02x" $r $g $b]
-	return $xclr
-}
-
-# erase legend canvas
-proc GmThematic::tleg_erase { mon id} {
-	variable tlegcan
-	
-	$tlegcan($mon,$id) delete all
-	return
-}
-
-#save legend canvas (might use maptool procedures)
-proc GmThematic::tleg_save { mon id} {
-	global env
-	variable tlegcan
-		
-	set types {
-    {{EPS} {.eps}}
-	}
-
-	if { [info exists HOME] } {
-		set dir $env(HOME)
-		set path [tk_getSaveFile -filetypes $types -initialdir $dir \
-			-defaultextension ".eps"]
-	} else {
-		set path [tk_getSaveFile -filetypes $types -defaultextension ".eps"]
-	}
-	
-	$tlegcan($mon,$id) postscript -file "$path"
-
-	return
-}

+ 0 - 238
gui/tcltk/gis.m/tksys.tcl

@@ -1,238 +0,0 @@
-#!/bin/sh
-# the next line restarts using wish \
-exec $GRASS_WISH "$0" "$@"
-
-# tksys.tcl
-# get some basic system information 
-# from within tcl/tk.
-# Designed to work with tcl/tk 8.4 and above.
-# Works in a terminal window and 
-# in a graphics window (X Window, MS Windows, Macintosh)
-# 
-# andreas.lange@rhein-main.de
-
-source $env(GISBASE)/etc/gtcltk/options.tcl
-source $env(GISBASE)/etc/gtcltk/gmsg.tcl
-source $env(GISBASE)/etc/gm/gmlib.tcl
-
-array set items { 
-    platform   "Platform               "
-    os         "Operating System       "
-    osVersion  "OS Version             "
-    machine    "Processor Type (arch)  "
-    user       "User Name              "
-    hostname   "Hostname               "
-    tclversion "Tcl Version            "
-    nameofexecutable \
-               "Name of Executable     "
-    patchlevel "Tcl Version/Patchlevel " 
-    uname      "Full OS ID             " 
-    script     "Name of current Script " }
-
-
-array set range {
-    1  platform 
-    2  os 
-    3  osVersion 
-    4  machine 
-    5  uname 
-    7  patchlevel 
-    8  nameofexecutable 
-    9  script
-    10 hostname 
-    11 user }
-
-# tclversion is the same as patchlevel
-# 6 tclversion
-
-array set tcl_platform_subst { 
-    unix      "Unix"
-    windows   "MS Windows"
-    macintosh "Apple Macintosh" }
-
-array set tcl_machine_subst { }
-
-array set tcl_os_subst { }
-
-puts [G_msg "\n***** Please wait *****"]
-puts [G_msg "Gathering information about your system"]
-
-proc sys_getinfo { } {
-    global sys tcl_platform tcl_platform_subst
-
-    if { [info exists tcl_platform(platform)] } {
-		set sys(platform) $tcl_platform_subst($tcl_platform(platform))
-    } else {
-		set sys(platform) "Unknown"
-    } 
-
-    foreach name { os osVersion machine user } {
-		if { [info exists tcl_platform($name)] } {
-		    set sys($name) $tcl_platform($name)
-		} else {
-	    	set sys($name) "unknown"
-		}
-	}
-
-    # fix for tcl/tk 8.0, where tcl_platform(user) is missing
-    if { [string compare "$sys(user)" "unknown"] == 0 && \
-	 [string compare "$sys(platform)" "$tcl_platform_subst(unix)"] == 0 } {
-		if {[catch {set sys(user) [exec whoami]} error]} {
-			GmLib::errmsg $error
-		}
-    }
-
-    set host [info hostname]
-    if { [string length $host] == 0 } {
-		set sys(hostname) "hostname not available"
-    } else {
-		set sys(hostname) $host
-    }
-
-    foreach name { tclversion nameofexecutable patchlevel script } {
-		set tmp [info $name]
-		if { [info exists tmp] } {
-			set sys($name) $tmp
-		} else {
-			set sys($name) "n/a"
-		}
-    }
-
-	if { [string compare "$sys(platform)" "$tcl_platform_subst(unix)"] == 0 } { 
-		if {[catch {set tmp [exec uname -srm]} error]} {
-			GmLib::errmsg $error
-		}
-		regsub -all { } $tmp {-} tmp 
-		set sys(uname) $tmp
-	} else {
-		set sys(uname) "unsupported"
-	}
-    
-    return
-}
-
-
-proc hline { {sign "-"} {nbr 75} } {
-    # string repeat was added with tcl/tk 8.1
-    # set string [string repeat $sign $nbr] 
-    set string $sign
-    for { set i 0 } { $i < $nbr } { incr i 1 } {	
-		append string $sign
-    }
-
-    return $string
-}
-
-
-proc sys_putinfo { path } {
-    global sys range items
-
-    puts $path "\n"
-    puts $path [hline "="]
-    puts $path "System Information"
-    puts $path [hline "="]
-    
-    foreach index [lsort -integer [array names range]] {
-		set name $range($index)
-		set string $items($name)
-		puts $path "$string $sys($name)"
-		puts $path [hline]
-    }
-
-    return
-}
-
-
-proc sys_wininfo { } {
-    global sys range items
-
-    frame .frame0 -borderwidth 2 -relief raised
-    frame .frame0.heading -borderwidth 2
-
-    set t [text .frame0.heading.text -relief flat \
-	       -height 1 -width 50 -bg #dddddd \
-	       -font bolddefault ]
-    $t tag configure all -justify center
-    $t insert end "System Information\n"
-    $t tag add all 1.0 end
-    $t configure -state disabled
-
-    pack .frame0 -side top -fill x
-    pack .frame0.heading -side top -fill x
-    pack .frame0.heading.text -side top -fill x
-
-    frame .frame1 -borderwidth 2 -relief raised
-
-    foreach index [lsort -integer [array names range]] {
-		set name $range($index)
-		set string $items($name)
-	
-		frame .frame1.$index
-		label .frame1.$index.string -anchor w \
-			-width 20 -text "$string"
-		label .frame1.$index.name -relief sunken -bg white \
-			-anchor w -width 30 -text "$sys($name)" \
-			-wraplength [font measure textfont "XXXXXXXXXXXXXXXXXXXXXXXXXXXX" ]
-		pack .frame1.$index.string -side left -fill x
-		pack .frame1.$index.name -side left
-		pack .frame1.$index -side top -fill x
-    }
-
-    pack .frame1 -side top -fill x
-
-    frame .frame2 -borderwidth 2 -relief raised
-
-    button .frame2.ok -text "Close" -padx 10 -command { exit }
-    button .frame2.save -text "Save" -padx 10 -command { sys_save }
-    button .frame2.clear -text "Update" -padx 10 -command { update }
-
-    pack .frame2 -side top -fill x
-    pack .frame2.ok .frame2.save .frame2.clear -side left -expand yes
-
-    bind . <Return>    { exit }
-    bind . <Control-c> { exit }
-    bind . <Escape>    { exit }
-    
-    wm title . "TK System Information"
-    wm resizable . 0 0 
-    grab .
-    tkwait window .
-
-    # never reached
-    return
-}
-
-proc sys_save { } {
-    global sys range items
-
-    set file [tk_getSaveFile -initialdir . \
-		  -defaultextension ".txt" \
-		  -title "Enter filename to save info text"]
-    if {[string length $file] == 0 } {
-		return
-    }
-    if [catch {open $file w} error] {
-		GmLib::errmsg $error 
-	} else {
-		sys_putinfo $out
-		if {[catch {close $out} error]} {
-			GmLib::errmsg $error
-		}
-    }
-
-    return
-}
-
-
-# main program	
-sys_getinfo
-
-puts [G_msg "***** Done *****"]
-
-if { [regexp {.*tk.*} [lindex $argv 0]] } {
-    sys_wininfo
-} else {
-    sys_putinfo stdout
-}
-
-exit

+ 0 - 827
gui/tcltk/gis.m/vector.tcl

@@ -1,827 +0,0 @@
-##########################################################################
-# vector.tcl - vector display layer options file for GRASS GIS Manager
-# March 2006 Michael Barton, Arizona State University
-# COPYRIGHT:	(C) 1999 - 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-##########################################################################
-
-namespace eval GmVector {
-    variable array opt # vector current options
-    variable count 1
-    variable array lfile # vector
-    variable array lfilemask # vector
-    variable optlist
-    variable array dup # vector
-}
-
-###############################################################################
-# set dynamic legend display in layer tree for vectors
-proc GmVector::legend { id } {
-    variable opt
-   
-    set lh $GmTree::legend_height
-    set lw $GmTree::legend_width
-    set mar 2
-    set leg $opt($id,1,_legend)
-
-    $leg delete all
-
-    # area    
-    if { $opt($id,1,type_area) || $opt($id,1,type_face)} {
-		set x1 [expr $mar ]
-		set x2 [expr {$lw - $mar} ]
-		set y1 [expr $mar ]
-		set y2 [expr {$lh - $mar} ]
-		set lwidth  $opt($id,1,lwidth)
-		if { $lwidth == 0 } { set lwidth 1 }
-		if {$opt($id,1,_use_color) == 1} {
-			if {$opt($id,1,_use_fcolor) == 1} {		
-				$leg create rectangle $x1 $y1 $x2 $y2 -outline $opt($id,1,color) \
-					-fill $opt($id,1,fcolor) -width $lwidth
-			} else {
-				$leg create rectangle $x1 $y1 $x2 $y2 -outline $opt($id,1,color) \
-					 -width $lwidth
-			}
-		} else {
-			if {$opt($id,1,_use_fcolor) == 1} {		
-				$leg create rectangle $x1 $y1 $x2 $y2 -fill $opt($id,1,fcolor) \
-					-width 0
-			}
-		}
-    }
-    
-    #line
-    if { $opt($id,1,type_line) || $opt($id,1,type_boundary) } {
-		set x1 [expr $mar ]
-		set x2 [expr {$lw - $mar} ]
-		set y1 [expr $mar ]
-		set y2 [expr {$lh - $mar} ]
-		set lwidth  $opt($id,1,lwidth)
-		if { $lwidth == 0 } { set lwidth 1 }
-		if {$opt($id,1,_use_color) == 1} {
-			$leg create rectangle $x1 $y1 $x2 $y2 -outline $opt($id,1,color) \
-					 -width $lwidth
-		}
-    }
-
-    # point 
-    set xc [expr {$lw / 2 + $mar - 1} ]
-    set yc [expr {$lh / 2} ]
-    set size $opt($id,1,size)
-   
-    set maxpsize  [expr {$lw / 3 - 2} ]
-    if { $size > $maxpsize } { set size $maxpsize }
-	set x1 [expr {$xc - $size / 2} ]
-	set x2 [expr {$xc + $size / 2 + 1} ]
-	set y1 [expr {$yc - $size / 2 }]
-	set y2 [expr {$yc + $size / 2 + 1} ]
-
-    if { $opt($id,1,type_point) || $opt($id,1,type_centroid) } {
-	set lwidth  $opt($id,1,lwidth)
-	if { $lwidth == 0 } { set lwidth 1 }
-        $leg create line $x1 $yc $x2 $yc -fill $opt($id,1,color) -width $lwidth
-	$leg create line $xc $y1 $xc $y2 -fill $opt($id,1,color) -width $lwidth
-    }
-
-
-	set opt($id,1,mod) "1"
-}
-
-###############################################################################
-
-# create new vector layer
-proc GmVector::create { tree parent } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-    variable dup
-
-    set node "vector:$count"
-
-    set frm [ frame .vectoricon$count]
-    set check [checkbutton $frm.check \
-		-variable GmVector::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-    set can [ canvas $frm.c -width $GmTree::legend_width \
-                     -height $GmTree::legend_height ]
-    set opt($count,1,_legend) $can
-    pack $check $can -side left
-
-    bind $can <ButtonPress-1> "GmTree::selectn $tree $node"
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-    $tree insert $sellayer $parent $node \
-	-text      "vector $count" \
-	-window    $frm \
-	-drawcross auto 
-
-    set dup($count) 0
-    set opt($count,1,_check) 1 
-
-    set opt($count,1,vect) "" 
-    set opt($count,1,opacity) 1.0
-    set opt($count,1,display_shape) 1 
-    set opt($count,1,display_cat) 0
-    set opt($count,1,display_topo) 0 
-    set opt($count,1,display_dir) 0 
-    set opt($count,1,display_attr) 0
-    set opt($count,1,type_point) 1 
-    set opt($count,1,type_line) 1
-    set opt($count,1,type_boundary) 1
-    set opt($count,1,type_centroid) 0
-    set opt($count,1,type_area) 1
-    set opt($count,1,type_face) 0 
-
-    set opt($count,1,color) \#000000
-    set opt($count,1,sqlcolor) 0
-    set opt($count,1,rdmcolor) 0
-    set opt($count,1,fcolor) \#AAAAAA 
-    set opt($count,1,lcolor) \#000000
-    set opt($count,1,_use_color) 1
-    set opt($count,1,_use_fcolor) 1
-    set opt($count,1,lwidth) 1
-
-    set opt($count,1,symdir) "basic"
-    set opt($count,1,icon) "basic/circle"
-    set opt($count,1,size) 5 
-
-    set opt($count,1,layer) 1 
-    set opt($count,1,lfield) 1 
-    set opt($count,1,cat) "" 
-    set opt($count,1,where) "" 
-    set opt($count,1,_use_where) 1
-    set opt($count,1,qmap) "" 
-	set opt($count,1,qsave) 0
-	set opt($count,1,qoverwrite) 0
-
-    set opt($count,1,attribute) "" 
-    set opt($count,1,xref) "left"
-    set opt($count,1,yref) "center"
-    set opt($count,1,lsize) 8
-
-    set opt($count,1,minreg) "" 
-    set opt($count,1,maxreg) "" 
-    set opt($count,1,mod) 1
-
-	set optlist { _check vect opacity display_shape display_cat display_topo display_dir \
-				display_attr type_point type_line type_boundary type_centroid \
-				type_area type_face color _use_color fcolor _use_fcolor lcolor \
-				rdmcolor sqlcolor icon size lwidth layer lfield attribute \
-				xref yref lsize cat where _use_where qmap qsave qoverwrite \
-				minreg maxreg}
-                  
-    foreach key $optlist {
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-    GmVector::legend $count
-
-	# create files in tmp diretory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-    
-}
-
-###############################################################################
-
-proc GmVector::set_option { node key value } {
-    variable opt
- 
-    set id [GmTree::node_id $node]
-    set opt($id,1,$key) $value
-
-    GmVector::legend $id
-}
-
-###############################################################################
-
-# select vector map from list and put its name in layer node
-proc GmVector::select_map { id } {
-    set m [GSelect vector title [G_msg "Vector map"] parent "."]
-    if { $m != "" } { 
-        set GmVector::opt($id,1,vect) $m
-        GmTree::autonamel $m
-    }
-}
-
-# select vector for output map from v.extract
-proc GmVector::select_qmap { id } {
-    set m [GSelect vector title [G_msg "Vector output map"] parent "."]
-    if { $m != "" } { 
-        set GmVector::opt($id,1,qmap) $m
-        GmTree::autonamel $m
-    }
-}
-
-###############################################################################
-# show attribute columns in output window
-proc GmVector::show_columns { id } {
-	variable opt
-	set mapname $opt($id,1,vect)
-	set layernum $opt($id,1,layer)
-	set cmd "v.info -c map=$mapname layer=$layernum"		
-	run_panel $cmd
-}
-
-###############################################################################
-# show attribute data in output window
-proc GmVector::show_data { id } { 
-	variable opt
-	set mapname $opt($id,1,vect)
-	set layernum $opt($id,1,layer)
-	if {![catch {open "|v.db.connect map=$mapname layer=$layernum -g" r} vdb]} {
-		set vectdb [read $vdb]
-		if {[catch {close $vdb} error]} {
-			GmLib::errmsg $error
-		}
-
-		set vdblist [split $vectdb " "]
-		set tbl [lindex $vdblist 1]
-		set db [lindex $vdblist 3]
-		set drv [lindex $vdblist 4]
-		set cmd "db.select table=$tbl database=$db driver=$drv"
-		run_panel $cmd
-	}
-}
-
-###############################################################################
-# show vector info in output window
-proc GmVector::show_info { id } {
-	variable opt
-	set mapname $opt($id,1,vect)
-	set layernum $opt($id,1,layer)
-	set cmd "v.info map=$mapname layer=$layernum"		
-	run_panel $cmd
-}
-
-###############################################################################
-# select point symbols
-proc GmVector::select_symbol { id } {
-    variable opt
-    set i [GSelect symbol title [G_msg "Vector point symbol"] parent "."]
-    if { $i != "" } {
-        set GmVector::opt($id,1,icon) $i
-    }
-}
-
-###############################################################################
-
-# display and set vector options
-proc GmVector::options { id frm } {
-    variable opt
-    global bgcolor
-    global iconpath
-    
-    set mapname ""    
-
-    # Panel heading
-    set row [ frame $frm.heading ]
-    Label $row.a -text [G_msg "Display vector maps"] \
-    	-fg MediumBlue
-    pack $row.a -side left
-    pack $row -side top -fill both -expand yes
-
-	#opacity
-	set row [ frame $frm.opc]
-	Label $row.a -text [G_msg "Opaque "]
-	scale $row.b -from 1.0 -to 0.0 -showvalue 1  \
-		-orient horizontal -length 300 -resolution 0.01 -fg "#656565"\
-		-variable GmVector::opt($id,1,opacity) 
-	Label $row.c -text [G_msg "Transparent"]
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes	
-	
-    # vector name
-    set row [ frame $frm.name ]
-    Label $row.a -text [G_msg "Vector map:"]
-    Button $row.b -image [image create photo -file "$iconpath/element-vector.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-        -helptext [G_msg "vector map to display"] \
-		-command "GmVector::select_map $id"
-    Entry $row.c -width 35 -text "$opt($id,1,vect)" \
-		-textvariable GmVector::opt($id,1,vect) 
-    Label $row.d -text ""
-    Button $row.e -text [G_msg "Vector Info"] \
-		-image [image create photo -file "$iconpath/gui-rv.info.gif"] \
-		-command "GmVector::show_info $id" \
-		-background $bgcolor \
-		-helptext [G_msg "Vector Info"]
-    Label $row.f -text ""
-    Button $row.g -text [G_msg "Help"] \
-		-image [image create photo -file "$iconpath/gui-help.gif"] \
-		-command "spawn g.manual --q d.vect" \
-		-background $bgcolor \
-		-helptext [G_msg "Help"]
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-	
-    # display
-    set row [ frame $frm.disp ]
-    Label $row.a -text [G_msg "Display: "]
-    checkbutton $row.b -text [G_msg "Shapes "] -variable GmVector::opt($id,1,display_shape) \
-                -command "GmVector::legend $id"  
-    checkbutton $row.c -text [G_msg "Categories "] -variable GmVector::opt($id,1,display_cat) \
-                -command "GmVector::legend $id"  
-    checkbutton $row.d -text [G_msg "Topology "] -variable GmVector::opt($id,1,display_topo) \
-                -command "GmVector::legend $id"  
-    checkbutton $row.e -text [G_msg "Line directions "] -variable GmVector::opt($id,1,display_dir) \
-                -command "GmVector::legend $id" 
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # type
-    set row [ frame $frm.type ]
-    Label $row.a -text "            "
-    checkbutton $row.b -text [G_msg "Points "] -variable GmVector::opt($id,1,type_point) \
-                -command "GmVector::legend $id"
-    checkbutton $row.c -text [G_msg "Lines "] -variable GmVector::opt($id,1,type_line) \
-                -command "GmVector::legend $id"
-    checkbutton $row.d -text [G_msg "Boundaries "] -variable GmVector::opt($id,1,type_boundary) \
-                -command "GmVector::legend $id"
-    checkbutton $row.e -text [G_msg "Areas "] -variable GmVector::opt($id,1,type_area) \
-                -command "GmVector::legend $id"
-    checkbutton $row.f -text [G_msg "Centroids "] -variable GmVector::opt($id,1,type_centroid)\
-                -command "GmVector::legend $id"
-    checkbutton $row.g -text [G_msg "Faces "] -variable GmVector::opt($id,1,type_face) \
-                -command "GmVector::legend $id"
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-
-    # points
-    set row [ frame $frm.icon ]  
-    Label $row.a -text [G_msg "Point symbols:"]
-    Button $row.b -text [G_msg "Icon"] \
-            -command "GmVector::select_symbol $id" 
-    Entry $row.c -width 15 -text "$opt($id,1,icon)" \
-        	-textvariable GmVector::opt($id,1,icon) 
-    Label $row.d -text [G_msg "   Size"]
-    SpinBox $row.e -range {1 50 1} -textvariable GmVector::opt($id,1,size) \
-                   -width 2 -helptext [G_msg "Icon size"] -modifycmd "GmVector::legend $id" 
-    pack $row.a $row.b $row.c $row.d $row.e -side left
-    pack $row -side top -fill both -expand yes
-
-    # lines
-    set row [ frame $frm.color ]
-    Label $row.a -text [G_msg "Draw lines:"] 
-    checkbutton $row.b -variable GmVector::opt($id,1,_use_color) \
-                -command "GmVector::legend $id"
-    Label $row.c -text [G_msg "Color"] 
-    SelectColor $row.d  -type menubutton -variable GmVector::opt($id,1,color) \
-               -command "GmVector::legend $id"
-    Label $row.e -text [G_msg "   Width"]
-    SpinBox $row.f -range {0 50 1} -textvariable GmVector::opt($id,1,lwidth) \
-                   -width 2 -helptext [G_msg "Line width"] \
-                   -modifycmd "GmVector::legend $id"
-    Label $row.g -text [G_msg "(pixels) "]
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-
-    # fills
-    set row [ frame $frm.multicolor ]
-    Label $row.a -text [G_msg "Fill areas:"] 
-    checkbutton $row.b -variable GmVector::opt($id,1,_use_fcolor) \
-                -command "GmVector::legend $id"
-    Label $row.c -text [G_msg "Color"] 
-    SelectColor $row.d -type menubutton -variable GmVector::opt($id,1,fcolor) \
-                -command "GmVector::legend $id"
-    Label $row.e -text "  " 
-    checkbutton $row.f -text [G_msg "Random colors "] -variable GmVector::opt($id,1,rdmcolor) \
-                -command "GmVector::legend $id"
-    checkbutton $row.g -text [G_msg "GRASSRGB column colors"] -variable GmVector::opt($id,1,sqlcolor) \
-                -command "GmVector::legend $id"
-    pack $row.a $row.b $row.c $row.d $row.e $row.f $row.g -side left
-    pack $row -side top -fill both -expand yes
-
-    # labels
-    set row [ frame $frm.label1 ]
-    Label $row.a -text [G_msg "Label vectors:"] 
-    checkbutton $row.b -text [G_msg "label"] -variable GmVector::opt($id,1,display_attr) \
-                -command "GmVector::legend $id"
-    Label $row.c -text [G_msg " Text color"] 
-    SelectColor $row.d -type menubutton -variable GmVector::opt($id,1,lcolor) \
-                -command "GmVector::legend $id"
-    Label $row.e -text [G_msg "   Text size"] 
-    SpinBox $row.f -range {1 50 1} -textvariable GmVector::opt($id,1,lsize) \
-                   -width 2 -helptext [G_msg "text size"] \
-                   -modifycmd "GmVector::legend $id"
-    pack $row.a $row.b $row.c $row.d $row.e $row.f -side left
-    pack $row -side top -fill both -expand yes
-
-	# label alighment
-    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) \
-		-values {"left" "center" "right"} \
-		-modifycmd "GmVector::legend $id"
-    ComboBox $row.c -label [G_msg "   Justification"] \
-    	-width 6  -textvariable GmVector::opt($id,1,yref) \
-		-values {"top" "center" "bottom"} \
-		-modifycmd "GmVector::legend $id"
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # labels layer and attribute column
-    set row [ frame $frm.label3 ]
-    LabelEntry $row.a -label [G_msg "     Layer for labels"] \
-                -textvariable GmVector::opt($id,1,lfield) -width 3 
-    LabelEntry $row.b -label [G_msg "   Attribute col for labels"] \
-                -textvariable GmVector::opt($id,1,attribute) -width 23
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # query
-    set row [ frame $frm.query1 ]
-    Label $row.a -text [G_msg "Query vectors for display: "] 
-    LabelEntry $row.b -label [G_msg "layer for query"] \
-                -textvariable GmVector::opt($id,1,layer) -width 3
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-	# query cat
-    set row [ frame $frm.query2 ]
-    Label $row.a -text "    " 
-    LabelEntry $row.b -label [G_msg "Query cat values"] \
-                -textvariable GmVector::opt($id,1,cat) \
-               -width 40
-    pack $row.a $row.b -side left
-    pack $row -side top -fill both -expand yes
-
-    # sql query
-    set row [ frame $frm.where ]
-    Label $row.a -text "    " 
-    checkbutton $row.b -variable GmVector::opt($id,1,_use_where) \
-		-command "GmVector::legend $id"
-    LabelEntry $row.c -label [G_msg "Use SQL query"] \
-		-textvariable GmVector::opt($id,1,where) \
-		-width 40
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-    
-	#show columns and data
-	set row [ frame $frm.columns ]
-    Label $row.a -text [G_msg "    Show attribute columns"] 
-    Button $row.b -text [G_msg "columns"] \
-            -image [image create photo -file "$iconpath/db-columns.gif"] \
-            -command "GmVector::show_columns $id" \
-            -background $bgcolor -borderwidth 1\
-            -helptext [G_msg "Show columns"]
-    Label $row.c -text [G_msg "      Show attribute data"] 
-    Button $row.d -text [G_msg "data"] \
-            -image [image create photo -file "$iconpath/db-values.gif"] \
-            -command "GmVector::show_data $id" \
-            -background $bgcolor  -borderwidth 1\
-            -helptext [G_msg "Show data"]
-    pack $row.a $row.b $row.c $row.d -side left
-    pack $row -side top -fill both -expand yes
-
-	# save query to new vector file
-	set row [ frame $frm.qsave ]
-    Label $row.a -text "    " 
-    checkbutton $row.b -text [G_msg "Save displayed objects to new vector file "] \
-                -variable GmVector::opt($id,1,qsave) 
-    checkbutton $row.c -text [G_msg "Overwrite existing"] \
-                -variable GmVector::opt($id,1,qoverwrite) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # save query vector name
-    set row [ frame $frm.qname ]
-    Label $row.a -text [G_msg "     New vector"] 
-    Button $row.b -image [image create photo -file "$iconpath/element-vector.gif"] \
-        -highlightthickness 0 -takefocus 0 -relief raised -borderwidth 1  \
-		-command "GmVector::select_qmap $id" \
-		-helptext [G_msg "Select existing vector for saving queried objects"]
-    Entry $row.c -width 40 -text "$opt($id,1,qmap)" \
-          -textvariable GmVector::opt($id,1,qmap) 
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-
-    # display only in limited region size range
-    set row [ frame $frm.region ]
-    Label $row.a -text [G_msg "Display when avg. region dimension is"]
-    LabelEntry $row.b -label ">" -textvariable GmVector::opt($id,1,minreg) \
-                -width 8
-    LabelEntry $row.c -label [G_msg " or <"] -textvariable GmVector::opt($id,1,maxreg) \
-                -width 8
-    pack $row.a $row.b $row.c -side left
-    pack $row -side top -fill both -expand yes
-}
-
-###############################################################################
-# save layer in workspace file
-proc GmVector::save { tree depth node } {
-    variable opt
-    variable optlist
-    
-    set id [GmTree::node_id $node]
-
-    foreach key $optlist {
-        GmTree::rc_write $depth "$key $opt($id,1,$key)"
-    } 
-}
-
-###############################################################################
-
-# append vector maps to display list for NVIZ display
-proc GmVector::addvect {node} {
-    variable opt
-    variable tree
-    global mon
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-    
-    if { ! ( $opt($id,1,_check) ) } { return } 
-
-	set vect $opt($id,1,vect)
-	
-	return $vect
-}
-
-# set vector type for NVIZ display
-proc GmVector::vecttype { vect } {
-	global devnull
-
-	set string ""
-	set points 0
-	set rest ""
-
-	if {![catch {open "|v.info map=$vect 2> $devnull" r} rv]} {
-		set vinfo [read $rv]
-		if {[catch {close $rv} error]} {
-			GmLib::errmsg $error
-		}
-
-		if { $vinfo == "" } {return}
-		regexp {points:       (\d*)} $vinfo string points
-		if { $points > 0} {
-			set vecttype "points"
-		} else {
-			set vecttype "lines"
-		}
-	
-		return $vecttype
-
-	} else {
-		puts $rv
-		return
-	}
-
-
-}
-
-###############################################################################
-
-# display vector map and output to graphic file for compositing
-proc GmVector::display { node mod } {
-    global mon
-    variable optlist
-    variable lfile 
-    variable lfilemask
-    variable opt
-    variable tree
-    variable dup
-    variable count
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    # If we are told dirty (for zoom) force dirty
-    # Don't remove a dirty from a previous unrendered zoom
-    if {$mod} {set opt($id,1,mod) 1}
-
-    if { $opt($id,1,vect) == "" } { return } 
-
-    if { !$opt($id,1,display_shape) && !$opt($id,1,display_cat) &&
-         !$opt($id,1,display_topo)  && !$opt($id,1,display_dir) &&
-         !$opt($id,1,display_attr) } { return } 
-
-    if { !$opt($id,1,type_point) && !$opt($id,1,type_line) &&
-         !$opt($id,1,type_boundary)  && !$opt($id,1,type_centroid) && 
-         !$opt($id,1,type_area) && !$opt($id,1,type_face) } { return } 
-
-    set cmd "d.vect map=$opt($id,1,vect)"
-    set cmd2 "v.extract input=$opt($id,1,vect) output=$opt($id,1,qmap)"
-
-    # color
-    if { $opt($id,1,rdmcolor) } { append cmd " -c" }
-    if { $opt($id,1,sqlcolor) } { append cmd " -a" }
-    set color [GmLib::color $opt($id,1,color)]
-    set fcolor [GmLib::color $opt($id,1,fcolor)]
-    set lcolor [GmLib::color $opt($id,1,lcolor)]
-
-    if { $opt($id,1,_use_color) } { append cmd " color=$color" } { append cmd " color=none" }
-    append cmd " lcolor=$lcolor" 
-
-    if { $opt($id,1,_use_fcolor) } { append cmd " fcolor=$fcolor" } { append cmd " fcolor=none" }
-
-    # display
-    set dlist [list]
-    foreach d { shape cat topo dir } {
-       if { $opt($id,1,display_$d) } { lappend dlist $d }
-    }
-    if { $opt($id,1,display_attr) && $opt($id,1,attribute) != "" } { lappend dlist attr }
-    
-    set display [join $dlist , ]
-    append cmd " display=$display"
-
-    # type
-    set tlist [list]
-    foreach t { point line boundary centroid area face } {
-       if { $opt($id,1,type_$t) } { lappend tlist $t }
-    }
-    set type [join $tlist , ]
-    append cmd " type=$type"
-    append cmd2 " type=$type"
-
-    append cmd " icon=$opt($id,1,icon) size=$opt($id,1,size)" 
-
-    if { $opt($id,1,lwidth) != 1 } { 
-        append cmd " width=$opt($id,1,lwidth)" 
-    } 
-
-
-    if { $opt($id,1,layer) != "" } { 
-        append cmd " layer=$opt($id,1,layer)" 
-        append cmd2 " layer=$opt($id,1,layer)" 
-    } 
-    if { $opt($id,1,attribute) != "" && $opt($id,1,display_attr) } { 
-        append cmd " {att=$opt($id,1,attribute)}" 
-    } 
-    append cmd " lsize=$opt($id,1,lsize)" 
-    
-    append cmd " xref=$opt($id,1,xref) yref=$opt($id,1,yref)"
-
-    if { $opt($id,1,lfield) != "" } { 
-        append cmd " llayer=$opt($id,1,lfield)" 
-    } 
-    if { $opt($id,1,cat) != "" } { 
-        append cmd " cat=$opt($id,1,cat)" 
-        append cmd2 " list=$opt($id,1,cat)"
-    } 
-    if { $opt($id,1,where) != "" && $opt($id,1,_use_where) } { 
-        append cmd " {where=$opt($id,1,where)}" 
-        append cmd2 " {where=$opt($id,1,where)}" 
-    } 
-    if { $opt($id,1,minreg) != "" } { 
-        append cmd " minreg=$opt($id,1,minreg)" 
-    } 
-    if { $opt($id,1,maxreg) != "" } { 
-        append cmd " maxreg=$opt($id,1,maxreg)" 
-    } 
-
-    if { $opt($id,1,qoverwrite) == 1 } { 
-        append cmd2 " --o" 
-    }
-
-	# use v.extract to save queried vector - will not go into redraw
-    if { $opt($id,1,qsave) == 1 && $opt($id,1,qmap) != "" } {
-    	run_panel $cmd2
-    }
-
-	# Decide whether to run, run command, and copy files to temp
-	GmCommonLayer::display_command [namespace current] $id $cmd
-}
-
-
-###############################################################################
-
-# get selected vector map (used for query)
-proc GmVector::mapname { node } {
-    variable opt
-    variable tree
-    global mon
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-
-    if { $opt($id,1,vect) == "" } { return ""} 
-
-    set mapname $opt($id,1,vect)
-	return $mapname
-}
-
-###############################################################################
-# digitize selected map (v.digit) and show currently displayed maps as background
-proc GmVector::WorkOnVector { node mod } {
-    variable opt
-    variable bg
-    variable tree
-    global mon
-    global env
-    
-    set tree($mon) $GmTree::tree($mon)
-    set id [GmTree::node_id $node]
-
-    if { ! ( $opt($id,1,_check) ) } { return } 
-
-    if { $opt($id,1,vect) == "" } { return } 
-    
-    if {[GmLib::element_exists "vector" $opt($id,1,vect)]} {
-        set cmd [list v.digit "map=$opt($id,1,vect)"]
-    } else { 
-        set cmd [list v.digit -n "map=$opt($id,1,vect)"]
-    }
-
-     set bg_command [GmGroup::vdigit_display "vector:$id"]
-     if {$bg_command != ""} {
-     	append cmd " {bgcmd=$bg_command}"
-     }
-
-    spawn_panel $cmd
-}
-
-###############################################################################
-# duplicate currently selected vector node
-proc GmVector::duplicate { tree parent node id } {
-    variable optlist
-    variable lfile
-    variable lfilemask
-    variable opt
-    variable count
-	variable dup
-	
-    set node "vector:$count"
-	set dup($count) 1
-
-    set frm [ frame .vectoricon$count]
-    set check [checkbutton $frm.check \
-		-variable GmVector::opt($count,1,_check) \
-		-height 1 -padx 0 -width 0]
-    set can [ canvas $frm.c -width $GmTree::legend_width \
-                     -height $GmTree::legend_height -borderwidth 0 ]
-    set opt($count,1,_legend) $can
-    pack $check $can -side left
-
-    bind $can <ButtonPress-1> "GmTree::selectn $tree $node"
-
-	#insert new layer
-	if {[$tree selection get] != "" } {
-		set sellayer [$tree index [$tree selection get]]
-    } else { 
-    	set sellayer "end" 
-    }
-
-	if { $opt($id,1,vect) == ""} {
-	    $tree insert $sellayer $parent $node \
-		-text      "vector $count" \
-		-window    $frm \
-		-drawcross auto
-	} else {
-	    $tree insert $sellayer $parent $node \
-		-text      "$opt($id,1,vect)" \
-		-window    $frm \
-		-drawcross auto
-	} 
-	
-	set opt($count,1,opacity) $opt($id,1,opacity)
-
-	set optlist { _check vect display_shape display_cat display_topo display_dir \
-				display_attr type_point type_line type_boundary type_centroid \
-				type_area type_face color _use_color fcolor _use_fcolor lcolor \
-				rdmcolor sqlcolor icon size lwidth layer lfield attribute \
-				xref yref lsize cat where _use_where qmap qsave qoverwrite \
-				minreg maxreg minreg maxreg}
-                  
-    foreach key $optlist {
-    	set opt($count,1,$key) $opt($id,1,$key)
-		set opt($count,0,$key) $opt($count,1,$key)
-    } 
-
-    GmVector::legend $count
-	set id $count
-	
-	# create files in tmp directory for layer output
-	set mappid [pid]
-	if {[catch {set lfile($count) [exec g.tempfile pid=$mappid]} error]} {
-		GmLib::errmsg $error [G_msg "Error creating tempfile"]
-	}
-	set lfilemask($count) $lfile($count)
-	append lfile($count) ".ppm"
-	append lfilemask($count) ".pgm"
-
-    incr count
-    return $node
-}