[GRASS-SVN] r30955 - grass/trunk/gui/tcltk/gis.m
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Apr 12 14:32:41 EDT 2008
Author: marisn
Date: 2008-04-12 14:32:36 -0400 (Sat, 12 Apr 2008)
New Revision: 30955
Modified:
grass/trunk/gui/tcltk/gis.m/gmlib.tcl
grass/trunk/gui/tcltk/gis.m/gmtree.tcl
grass/trunk/gui/tcltk/gis.m/legend.tcl
grass/trunk/gui/tcltk/gis.m/maplabels.tcl
grass/trunk/gui/tcltk/gis.m/rastnums.tcl
grass/trunk/gui/tcltk/gis.m/vector.tcl
Log:
Some fixes for digitization start from gis.m; Fixed font selection for gis.m raster legend (ticket #79); gis.m PS labels now works with @mapset
Modified: grass/trunk/gui/tcltk/gis.m/gmlib.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/gmlib.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/gmlib.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -19,7 +19,7 @@
namespace eval GmLib {
- global array filename # mon
+ global array filename ;# mon
}
Modified: grass/trunk/gui/tcltk/gis.m/gmtree.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/gmtree.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/gmtree.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -18,9 +18,9 @@
variable legend_height 20
variable legend_width 30
variable treeht 6
- global array tree # mon
- global array filename # mon
- variable array pg # mon
+ global array tree ;# mon
+ global array filename ;# mon
+ variable array pg ;# mon
}
@@ -1143,7 +1143,7 @@
#digitize
proc GmTree::vedit { } {
variable tree
- global options
+ global options env
global mon
if { [array size GmTree::tree] < 1 } {
@@ -1158,14 +1158,26 @@
}
set type [GmTree::node_type $sel]
+ set id [GmTree::node_id $sel]
switch $type {
raster {
- Gm::xmon term r.digit
+ if { $GmRaster::opt($id,1,map) == "" } {
+ tk_messageBox -type ok -icon warning -message [G_msg "Selected raster layer is empty"]
+ return
+ }
+ unset env(GRASS_RENDER_IMMEDIATE)
+ guarantee_xmon
+ term r.digit
+ set env(GRASS_RENDER_IMMEDIATE) "TRUE"
return
}
vector {
- GmVector::WorkOnVector $sel 0
+ if { $GmVector::opt($id,1,vect) == "" } {
+ tk_messageBox -type ok -icon warning -message [G_msg "Selected vector layer is empty"]
+ return
+ }
+ GmVector::WorkOnVector $sel 0
}
default {
tk_messageBox -type ok -icon warning -message [G_msg "You can digitize raster or vector maps only"]
Modified: grass/trunk/gui/tcltk/gis.m/legend.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/legend.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/legend.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -117,7 +117,7 @@
if {$GmLegend::opt($id,1,font) != "" } {
set Gm::dfont $GmLegend::opt($id,1,font)
}
- Gm:DefaultFont dlegend
+ Gm::defaultfont dlegend
tkwait variable Gm::dfont
set GmLegend::opt($id,1,font) $Gm::dfont
set Gm::dfont ""
Modified: grass/trunk/gui/tcltk/gis.m/maplabels.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/maplabels.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/maplabels.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -312,8 +312,9 @@
set can($mon) $MapCanvas::can($mon)
if {[string match {*[@]*} $opt($id,1,labels)]} {
- set tmp [string range $opt($id,1,labels) 0 [expr [string first "@" $opt($id,1,labels)] - 1] ]
- set labelpath "$env(GISDBASE)/$env(LOCATION_NAME)/PERMANENT/paint/labels/$tmp"
+ 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)"
}
@@ -321,7 +322,10 @@
if { ! ( $opt($id,1,_check) ) } { return }
# open the v.label file for reading
- catch {set labelfile [open $labelpath r]}
+ 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 } {
Modified: grass/trunk/gui/tcltk/gis.m/rastnums.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/rastnums.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/rastnums.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -114,7 +114,7 @@
if {$GmRnums::opt($id,1,font) != "" } {
set Gm::dfont $GmRnums::opt($id,1,font)
}
- Gm:DefaultFont drastnum
+ Gm::defaultfont drastnum
tkwait variable Gm::dfont
set GmRnums::opt($id,1,font) $Gm::dfont
set Gm::dfont ""
Modified: grass/trunk/gui/tcltk/gis.m/vector.tcl
===================================================================
--- grass/trunk/gui/tcltk/gis.m/vector.tcl 2008-04-12 15:20:05 UTC (rev 30954)
+++ grass/trunk/gui/tcltk/gis.m/vector.tcl 2008-04-12 18:32:36 UTC (rev 30955)
@@ -745,7 +745,7 @@
set cmd [list v.digit -n "map=$opt($id,1,vect)"]
}
- set bg_command [GmGroup::vdigit_display "root" "vector:$id"]
+ set bg_command [GmGroup::vdigit_display "vector:$id"]
if {$bg_command != ""} {
append cmd " {bgcmd=$bg_command}"
}
More information about the grass-commit
mailing list