[GRASS-SVN] r35733 - grass/trunk/visualization/nviz/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 2 12:59:45 EST 2009
Author: cmbarton
Date: 2009-02-02 12:59:45 -0500 (Mon, 02 Feb 2009)
New Revision: 35733
Modified:
grass/trunk/visualization/nviz/scripts/colorPopup.tcl
grass/trunk/visualization/nviz/scripts/nviz2.2_script
grass/trunk/visualization/nviz/scripts/panel_main.tcl
grass/trunk/visualization/nviz/scripts/panel_sdiff.tcl
grass/trunk/visualization/nviz/scripts/widgets.tcl
Log:
Updating NVIZ in GRASS 7 with TclTk fixes made in the GRASS 6 line when TclTk was removed from GRASS 7 (about a month ago).
Modified: grass/trunk/visualization/nviz/scripts/colorPopup.tcl
===================================================================
--- grass/trunk/visualization/nviz/scripts/colorPopup.tcl 2009-02-01 22:34:07 UTC (rev 35732)
+++ grass/trunk/visualization/nviz/scripts/colorPopup.tcl 2009-02-02 17:59:45 UTC (rev 35733)
@@ -1,212 +1,31 @@
# mkColorPopup w name color
#
-# Create a dialog box with sliders and buttons to adjust current color
+# Replaced legacy custom dialog box which no longer works on Mac with aqua (and maybe other platforms?)
+# with native color picker called from tk_chooseColor widget
#
+# Kept old function name and arguments to avoid having to change call in many different modules
+#
# Arguments:
-# w - Name to use for new top-level window.
+# w - Name to use for new top-level window (no longer used)
# name - Label for ColorPopup
# color - CurrentColor
+# mode - Made window modal (no longer used)
global CurrColor
-proc mkColorPopup {w name {color "#000000"} {mode 0}} {
+proc mkColorPopup {w {name "Choose color"} {color "#000000"} {mode 0}} {
global CurrColor
-
- catch {destroy $w}
- toplevel $w -class Dialog
- wm title $w "Select Color"
- wm iconname $w "Color"
- wm geometry $w 300x450
- wm minsize $w 50 100
- wm resizable $w false false
-
- set tmp [tcl_to_rgb $color]
- set r [expr ($tmp&0xff0000)>>16]
- set g [expr ($tmp&0x00ff00)>>8]
- set b [expr ($tmp&0x0000ff)]
-
- set tmp $color
-
- # Create two frames in the main window. The top frame will hold the
- # sliders that interactively change color and the bottom one will hold
- # the buttons for predefined color.
-
- frame $w.top -relief raised -border 1
- frame $w.bot -relief raised -border 1
- pack $w.top $w.bot -side top -fill both -expand yes
-
- # Note that these sliders are now floating sliders since tk4.0
- # supports these. This means that color values should be
- # specified in the range 0.0-1.0. For ease of use, most routines
- # just convert from 00-FF to 0.0-1.0.
- frame $w.top.left
- Nv_mkColorScale $w.top.left Red $r red $w.top.color
- Nv_mkColorScale $w.top.left Green $g green $w.top.color
- Nv_mkColorScale $w.top.left Blue $b blue $w.top.color
-
- # ACS One line: without next line, the scales and $w.top.color are set to white next time
- # after a color button (not sliders) has been used, regardless $color. Don't know why
- setScales $w.top.left $color
- pack $w.top.left.red $w.top.left.green $w.top.left.blue -side top -expand 1
- set CurrColor $color
- label $w.top.color -bg $color -width 5
- pack $w.top.left -side left -expand 1
- pack $w.top.color -side left -padx 10 -pady 10 -fill both -expand yes
+ set CurrColor [tk_chooseColor -initialcolor $color -title $name]
- tkwait visibility $w
-
- frame $w.bot.buttonframe
- button $w.bot.buttonframe.ok -text OK -command "destroy $w" -bd 1
- button $w.bot.buttonframe.cancel -bd 1 \
- -text Cancel -command "set CurrColor $tmp; destroy $w"
- label $w.bot.buttonframe.label -text $name
- pack $w.bot.buttonframe.label -side left -expand yes -padx 10
- pack $w.bot.buttonframe.cancel $w.bot.buttonframe.ok -side right -expand 1
- pack $w.bot.buttonframe -side bottom -fill x
- mkColorButtons $w.bot.bf $w.top.left $w.top.color
- pack $w.bot.bf -padx 3 -pady 6 -side top -expand 1
- bind $w <Any-Enter> [list focus $w]
- focus $w
-
- # If the caller desires, make everything else wait until a color
- # has been selected or this popup has been dismissed.
- if {$mode} {grab $w}
-
- tkwait window $w
+ if {$CurrColor==""} {set CurrColor #000000}
return $CurrColor
}
-proc mkColorButtons { B S L } {
- global CurrColor
-
- frame $B
- set clist [mkColorList]
-
- for {set i 0; set k 0} {$i < 9 } {incr i} {
- # make frame to hold buttons in this row
- frame $B.f$i
- for {set j 0} {$j < 5 } {incr j; incr k} {
- set color [lindex $clist $k]
- button $B.f$i.$j -bg $color \
- -activeforeground $color \
- -activebackground $color \
- -width 0 -height 0 \
- -highlightthickness 1 \
- -padx 7 -pady 0 \
- -command "setScales $S $color; $L config -bg $color; set CurrColor $color"
- pack $B.f$i.$j -side top -expand 1
- }
- pack $B.f$i -side left
- }
-}
-
-proc getColorfromScales {S} {
-
- # Have to convert colors back to #XXXXXX since that is what
- # everyone else expects
- set r [expr int([$S.red.scale get] * 255.0)]
- set g [expr int([$S.green.scale get] * 255.0)]
- set b [expr int([$S.blue.scale get] * 255.0)]
-
- set r [hexval $r]
- set g [hexval $g]
- set b [hexval $b]
-
- return #$r$g$b
-}
-
-
-
-
-proc setLabelfromScales {S L args} {
- global CurrColor
-
- # Convert back to #XXXXXX
- set r [expr int([$S.red.scale get] * 255.0)]
- set g [expr int([$S.green.scale get] * 255.0)]
- set b [expr int([$S.blue.scale get] * 255.0)]
-
- set r [hexval $r]
- set g [hexval $g]
- set b [hexval $b]
-
- $L config -bg #$r$g$b
- set CurrColor #$r$g$b
-}
-
-proc setScales {S c} {
- set color [tcl_to_rgb $c]
- set r [expr ($color&0xff0000)>>16]
- set g [expr ($color&0x00ff00)>>8]
- set b [expr ($color&0x0000ff)]
-
- $S.red.scale set [expr ($r + 0.0)/255.0]
- $S.green.scale set [expr ($g + 0.0)/255.0]
- $S.blue.scale set [expr ($b + 0.0)/255.0]
-}
-
-proc mkColorList {} {
-
- set ramp 0
- set colorlist {}
- set maxval ff
- set minval 00
- for {set r 4; set i 0} {$r < 16} {incr r 5} {
- for {set g 4} {$g < 16} {incr g 5} {
- for {set b 4} {$b < 16 && $i < 40} {incr b 5} {
- set tmpr [hexval [expr $r/15.0*255]]
- set tmpg [hexval [expr $g/15.0*255]]
- set tmpb [hexval [expr $b/15.0*255]]
- set color #$tmpr$tmpg$tmpb
- set colorlist [concat $colorlist $color]
- incr i
- }
- if {$ramp == 0} {
- set colorlist [concat $colorlist #ff0000 #00ffff]
- incr ramp 2
- incr i 2
- } elseif {$ramp < 10} {
- set tmpg [hexval [expr $ramp/9.0*255]]
- set color #$maxval$tmpg$minval
- set colorlist [concat $colorlist $color]
- incr ramp
- incr i
-
- set tmpg [hexval [expr (1.0 - $ramp/9.0)*255]]
- set color #$minval$tmpg$maxval
- set colorlist [concat $colorlist $color]
- incr ramp
- incr i
-
- } elseif {$ramp < 16} {
- set tmpb [hexval [expr ($ramp-10)/7.0*255]]
- set color #$maxval$maxval$tmpb
- set colorlist [concat $colorlist $color]
- incr ramp
- incr i
- set tmpb [hexval [expr (1.0 - ($ramp-10)/7.0)*255]]
- set color #$minval$minval$tmpb
- set colorlist [concat $colorlist $color]
- incr ramp
- incr i
- }
- }
- }
- for {set gray 0} {$gray < 5} {incr gray} {
- set g [hexval [expr (1.0 - $gray/4.0)*255]]
- set color #$g$g$g
- set colorlist [concat $colorlist $color]
- }
-
-
- return $colorlist
-
-}
-
proc hexval { n } {
+ # this proc might be used by some other modules
set n [expr int($n)]
if {$n > 15} {
@@ -215,39 +34,10 @@
return [format "0%x" $n]
}
-##########################################################################
-# procedure to make sliders
-##########################################################################
-proc Nv_mkColorScale { P {name " "} {curr 200}\
- {color ""} {chip ""}} {
- set S $P.$color
- frame $S
- frame $S.f
-
- # Make a global variable shared by this scale and its entry
- global $S.val
-
- set $S.val [expr ($curr + 0.0)/255.0]
-
- scale $S.scale -from 0.0 -length 140 -showvalue 0 -orient h \
- -digits 3 -resolution 0.01 -tickinterval 0 -to 1.0 -width 13 \
- -command "setLabelfromScales $P $chip " \
- -activebackground gray80 -background gray90 -bg $color \
- -variable $S.val
-
- label $S.f.label -text $name
- $S.scale set $curr
- entry $S.f.entry -width 5 -borderwidth 2 -relief sunken -textvariable $S.val
- bind $S.f.entry <Return> "set $S.val [$S.f.entry get]"
- pack $S.scale $S.f -side top
- pack $S.f.label $S.f.entry -side left
-
- return $S
-}
-
-
proc tcl_to_rgb {c} {
+ # this proc is used by some other modules
+
regsub # $c 0x newcolor
return $newcolor
}
Modified: grass/trunk/visualization/nviz/scripts/nviz2.2_script
===================================================================
--- grass/trunk/visualization/nviz/scripts/nviz2.2_script 2009-02-01 22:34:07 UTC (rev 35732)
+++ grass/trunk/visualization/nviz/scripts/nviz2.2_script 2009-02-02 17:59:45 UTC (rev 35733)
@@ -8,7 +8,7 @@
# Major update of GUI Nov 2006, Michael Barton, Arizona State University
#
##########################################################################
-# COPYRIGHT: (C) 1999 - 2006 by Michael Barton and the GRASS Development Team
+# COPYRIGHT: (C) 1999 - 2008 by Michael Barton and the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
@@ -63,7 +63,7 @@
set Nv_(TOP) ".middle.draw"
set Nv_(APP) "."
set Nv_(P_AREA) ".middle.panelarea.panels"
-set Nv_(PAREA) ".middle.panelarea"
+set Nv_(PAREA) ".middle.panelarea"
set Nv_(AREA) ".top"
set Nv_(CALLED_SET_FOCUS) no
set Nv_(CurrSurf) 0
@@ -71,6 +71,7 @@
set Nv_(CurrSite) 0
set Nv_(CurrSdiff) 0
set Nv_(CurrVol) 0
+set Nv_(hidemenus) 1
# Some quick code to initialize the CurrSurf, CurrVect and CurrSite variables
set temp [Nget_surf_list]
@@ -185,37 +186,32 @@
###################################
-# Procedure to hide menus
+# Procedure to hide or reveal panels
###################################
-proc hide_menus {} {
- global Nv_ bit_map_path
+proc hide_menus { } {
+ global Nv_
+ global bit_map_path
+
+ if {$Nv_(hidemenus) == "1" } {
+ set Nv_(hidemenus) 0
+ $Nv_(PAREA).canvas configure -width 0
+ $Nv_(PAREA).f1.b1 configure -bitmap @$bit_map_path/right \
+ -width 12 -height 18 -command "hide_menus"
+ help $Nv_(PAREA).f1.b1 balloon "Show Panels"
+ #$Nv_(AREA).menu.config.m entryconfigure 1 -label "Show Panels" -command "show_menus"
+ } else {
+ set Nv_(hidemenus) 1
+ $Nv_(PAREA).canvas configure -width [winfo width $Nv_(P_AREA)]
+ $Nv_(PAREA).f1.b1 configure -bitmap @$bit_map_path/left \
+ -width 12 -height 18 -command "hide_menus"
+ help $Nv_(PAREA).f1.b1 balloon "Hide Panels"
+ #$Nv_(AREA).menu.config.m entryconfigure 1 -label "Hide Panels" -command "hide_menus"
+ }
+ update
- $Nv_(PAREA).canvas configure -width 0
- $Nv_(PAREA).f1.b1 configure -bitmap @$bit_map_path/right \
- -width 8 -height 12 -command "show_menus"
-
- help $Nv_(PAREA).f1.b1 balloon "Show Panels"
-
- $Nv_(AREA).menu.config.m entryconfigure 1 -label "Show Panels" -command "show_menus"
-
}
-###################################
-# Procedure to reveal menus
-###################################
-proc show_menus {} {
- global Nv_ bit_map_path
- $Nv_(PAREA).canvas configure -width [winfo width $Nv_(P_AREA)]
- $Nv_(PAREA).f1.b1 configure -bitmap @$bit_map_path/left \
- -width 8 -height 12 -command "hide_menus"
-
- help $Nv_(PAREA).f1.b1 balloon "Hide Panels"
-
- $Nv_(AREA).menu.config.m entryconfigure 1 -label "Hide Panels" -command "hide_menus"
-}
-
-
###########################################################################
# add key bindings so that menu shortcut keys can be used
###########################################################################
@@ -238,7 +234,7 @@
wm sizefrom . user
#Use three base frames
- frame .top -relief flat -bd 0
+ frame $Nv_(AREA) -relief flat -bd 0
frame .middle -relief flat -bd 0
frame .bottom -relief flat -bd 0
@@ -258,8 +254,8 @@
pack $Nv_(PAREA) -side left -fill y -expand no
#togl canvas
- frame .middle.draw -relief groove -bd 2
- pack .middle.draw -side left -fill both -expand yes
+ frame $Nv_(TOP) -relief groove -bd 2
+ pack $Nv_(TOP) -side left -fill both -expand yes
entry .bottom.entry -relief sunken -state disabled \
-background #FFFFFF -textvariable Nv_(text)
@@ -267,29 +263,29 @@
set cwidth [exec $src_boot/bin/g.gisenv X3D_WIDTH]
set cheight [exec $src_boot/bin/g.gisenv X3D_HEIGHT]
-
+
if {$cwidth > 0 && $cheight > 0} {
- togl .middle.draw.canvas -rgba true -double true -depth true \
+ togl $Nv_(TOP).canvas -rgba true -double true -depth true \
-width $cwidth -height $cheight
- pack .middle.draw.canvas -side top -expand no
+ pack $Nv_(TOP).canvas -side top -expand no
} elseif {$cwidth == "" && $cheight > 0} {
- togl .middle.draw.canvas -rgba true -double true -depth true \
+ togl $Nv_(TOP).canvas -rgba true -double true -depth true \
-height $cheight
- pack .middle.draw.canvas -side top -fill x -expand yes
+ pack $Nv_(TOP).canvas -side top -fill x -expand yes
} elseif {$cheight == "" && $cwidth > 0} {
- togl .middle.draw.canvas -rgba true -double true -depth true \
+ togl $Nv_(TOP).canvas -rgba true -double true -depth true \
-width $cwidth
- pack .middle.draw.canvas -side top -fill y -expand yes
+ pack $Nv_(TOP).canvas -side top -fill y -expand yes
} else {
#nothing set
set constrained 1
- togl .middle.draw.canvas -rgba true -double true -depth true
- pack .middle.draw.canvas -side top -fill both -expand yes
+ togl $Nv_(TOP).canvas -rgba true -double true -depth true
+ pack $Nv_(TOP).canvas -side top -fill both -expand yes
}
- bind .middle.draw.canvas <Expose> {Nv_expose %W}
- bind .middle.draw.canvas <Configure> {set Nv_(height) %h}
- set tags [bindtags .middle.draw.canvas]
+ bind $Nv_(TOP).canvas <Expose> {Nv_expose %W}
+ bind $Nv_(TOP).canvas <Configure> {set Nv_(height) %h}
+ set tags [bindtags $Nv_(TOP).canvas]
# the Togl widget can't be redrawn until the main panel has been created
# update
@@ -300,7 +296,7 @@
#Moved the following packing here to satisfy some TCL versions
#Prevents minimized GUI
#top frame for menubar
- pack .top -side top -fill x -expand no
+ pack $Nv_(AREA) -side top -fill x -expand no
#middle frame for menus and togl canvas
pack .middle -side top -fill both -expand yes
#botom frame for statusbar
@@ -313,24 +309,25 @@
# make panel area
###########################################################################
canvas $Nv_(PAREA).canvas -yscrollcommand "$Nv_(PAREA).f1.scrolly set" \
- -borderwidth 2 -relief sunken
+ -borderwidth 2 -relief sunken
frame $Nv_(PAREA).f1 -borderwidth 0 -relief flat
- scrollbar $Nv_(PAREA).f1.scrolly -command "$Nv_(PAREA).canvas yview"
+ scrollbar $Nv_(PAREA).f1.scrolly -command "$Nv_(PAREA).canvas yview"
+ bind all <MouseWheel> {$Nv_(PAREA).canvas yview scroll [expr -1 * %D] units}
button $Nv_(PAREA).f1.b1 -bitmap @$bit_map_path/left \
- -width 8 -height 12 -command "hide_menus"
+ -width 12 -height 18 -command "hide_menus"
help $Nv_(PAREA).f1.b1 balloon "Hide Panels"
+
frame $Nv_(P_AREA) -relief flat
-
# DEBUG
if {$DEBUG} {puts "panel area made"}
###########################################################################
# make menubar
###########################################################################
- frame $Nv_(AREA).menu -relief flat -borderwidth 1
- pack $Nv_(AREA).menu -side top -fill x -expand no
+ frame $Nv_(AREA).menu -relief flat -borderwidth 0
+ #pack $Nv_(AREA).menu -side top -fill x -expand no
pack $Nv_(PAREA).canvas -side top -fill both -expand yes
pack $Nv_(PAREA).f1 -side left -before $Nv_(PAREA).canvas -fill y
@@ -346,19 +343,20 @@
$Nv_(PAREA).canvas create window 0 0 -window $Nv_(P_AREA) -anchor nw
bind $Nv_(P_AREA) <Configure> "set_scrollsize"
- pack [Nv_mkMenu $Nv_(AREA).menu.help Help \
+ set helpmenu [Nv_mkMenu $Nv_(AREA).menu.help "Help " \
{"NVIZ Help" "About NVIZ" "NVIZ - Bugs / ToDo"} \
{0 0 0} \
- {"nviz_browse nviz_toc.html" "nviz_browse nviz_desc.html" "nviz_browse bugs_todo.html"} ] \
- -side right -fill none -expand no -anchor e
+ {"nviz_browse nviz_toc.html" "nviz_browse nviz_desc.html" "nviz_browse bugs_todo.html"} ]
+# #pack $helpmenu -side right -fill none -expand yes -anchor e
+
# DEBUG
if {$DEBUG} {puts "Help menu made"}
- set leftmenu [frame $Nv_(AREA).menu.left -relief flat -bd 0]
+ #set Nv_(AREA).menu [frame $Nv_(AREA).menu.left -relief flat -bd 0]
# file menu
- set filemenu [Nv_mkMenu $leftmenu.file File \
+ set filemenu [Nv_mkMenu $Nv_(AREA).menu.file "File " \
{"Load State ..." "Save State ..." \
"" \
"Set Canvas Size ..."
@@ -379,7 +377,7 @@
"Separator" \
"reset_Nviz" "Nv_close_scripting ; exit ; puts"}]
- pack $filemenu -side left -fill x -expand no
+# pack $filemenu -side left -fill x -expand no
# DEBUG
@@ -392,17 +390,17 @@
# DEBUG
if {$DEBUG} {puts "disabled made"}
- pack [Nv_mkConfigMenu $leftmenu.config] -side left -fill x -expand no
+# pack [Nv_mkConfigMenu $Nv_(AREA).menu.config] -side left -fill x -expand no
- pack [Nv_mkPanelMenu $leftmenu.panel] -side left -fill x -expand no
+# pack [Nv_mkPanelMenu $Nv_(AREA).menu.panel] -side left -fill x -expand no
# DEBUG
if {$DEBUG} {puts "scripting menu 0 made"}
# Make a menu entry for scripting
- menubutton $leftmenu.scripting -text Scripting \
- -menu $leftmenu.scripting.m -underline 0
- set scriptingmenu [menu $leftmenu.scripting.m]
+ set scriptingbtn [menubutton $Nv_(AREA).menu.scripting -text "Scripting " \
+ -menu $Nv_(AREA).menu.scripting.m -underline 0 ]
+ set scriptingmenu [menu $Nv_(AREA).menu.scripting.m]
$scriptingmenu add checkbutton -label "On" \
-onvalue 1 -offvalue 0 -variable ScriptState \
@@ -432,18 +430,21 @@
$scriptingmenu add command -label "Script Tools" \
-underline 1 -command {exec nviz -f $default_panel_path/script_tools -q &}
- pack $leftmenu.scripting -side left -fill x -expand no
+ set configmenu [Nv_mkConfigMenu $Nv_(AREA).menu.config]
+ set panelmenu [Nv_mkPanelMenu $Nv_(AREA).menu.panel]
+ pack $helpmenu -side right -fill none -expand no -anchor e
+ pack $filemenu $configmenu $panelmenu $scriptingbtn -side left -fill none -expand no -anchor w
# DEBUG
if {$DEBUG} {puts "scripting menu made"}
- pack $leftmenu -side left -fill x -expand no
+ pack $Nv_(AREA).menu -side left -fill x -expand yes
+ tk_menuBar $Nv_(AREA).menu
+ #tk_menuBar $Nv_(AREA).menu $filemenu $Nv_(AREA).menu.panel \
+ #$scriptingbtn
- tk_menuBar $Nv_(AREA).menu $Nv_(AREA).menu.file $Nv_(AREA).menu.panel \
- $Nv_(AREA).menu.scripting
-
set Nv_(Q) [Q_init 2]
#pack $Nv_(AREA).menu.wait_pls -side left -fill x -expand yes
@@ -456,8 +457,12 @@
# DEBUG
if {$DEBUG} {puts "menubar made"}
- focus $Nv_(AREA).menu
+ raise .bottom
+ raise .middle
+ raise $Nv_(AREA)
+ focus -force $Nv_(AREA).menu
+
return $BASE
}
@@ -627,7 +632,7 @@
############################################################################
# procedure to make PANEL pulldown menu
###########################################################################
-proc Nv_mkPanelMenu { P { name Visualize } } {
+proc Nv_mkPanelMenu { P { name "Visualize " } } {
global Nv_ DEBUG
menubutton $P -text $name -menu $P.m -underline 0
@@ -660,7 +665,7 @@
############################################################################
# procedure to make CONFIG pulldown menu
###########################################################################
-proc Nv_mkConfigMenu { P { name Appearance } } {
+proc Nv_mkConfigMenu { P { name "Appearance " } } {
global Nv_ DEBUG
menubutton $P -text $name -menu $P.m -underline 0
@@ -669,7 +674,7 @@
if {$DEBUG} {puts "Nv_mkConfigMenu 1"}
set j 0
- $P.m add command -label "Hide Panels" -command hide_menus
+ $P.m add command -label "Hide Panels" -command "hide_menus"
$P.m add separator
foreach i $Nv_(config) {
@@ -702,15 +707,13 @@
global Nv_
global BGColor
-# if [$W islinked] then {
if {$Nv_(First)} then {
init_graphics
set Nv_(First) 0
} else {
- Nbackground $BGColor
+ Nbackground $BGColor
Nquick_draw
}
-# }
}
proc save_3dview { dummy } {
@@ -807,10 +810,10 @@
button .canvas_size.f2.b1 -text "Close" \
-command {
if {$constrained} {
- pack $Nv_(TOP).canvas -side top -fill both -expand yes
+ pack $Nv_(TOP).canvas -side top -fill both -expand yes
} else {
- $Nv_(TOP).canvas configure -width $cwidth -height $cheight
- pack $Nv_(TOP).canvas -side top -expand no -fill none
+ $Nv_(TOP).canvas configure -width $cwidth -height $cheight
+ pack $Nv_(TOP).canvas -side top -expand no -fill none
#Need Nset_viewport to make sure reshape is called
Nset_viewport $cwidth $cheight
}
@@ -888,13 +891,13 @@
# Go through each of the panels one at a time and force them to open
# This should update them all so they display correctly
foreach i $Nv_(config) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
foreach i $Nv_(panels) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
Nv_closeAllPanels
@@ -919,32 +922,32 @@
set tmp_list $Nv_(panels)
lappend tmp_list main
foreach i $Nv_(panels) {
- set cmd_name "Nviz_$i"
- append cmd_name "_reset"
- if {[catch {$cmd_name} error_code] != 0} then {
- puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
- }
+ set cmd_name "Nviz_$i"
+ append cmd_name "_reset"
+ if {[catch {$cmd_name} error_code] != 0} then {
+ puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
+ }
}
foreach i $Nv_(config) {
- set cmd_name "Nviz_$i"
- append cmd_name "_reset"
- if {[catch {$cmd_name} error_code] != 0} then {
- puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
- }
+ set cmd_name "Nviz_$i"
+ append cmd_name "_reset"
+ if {[catch {$cmd_name} error_code] != 0} then {
+ puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
+ }
}
# Go through each of the panels one at a time and force them to open
# This should update them all so they display correctly
foreach i $Nv_(panels) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
foreach i $Nv_(config) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
Nv_closeAllPanels
@@ -964,31 +967,31 @@
set tmp_list $Nv_(panels)
lappend tmp_list main
foreach i $tmp_list {
- set cmd_name "Nviz_$i"
- append cmd_name "_reset"
- if {[catch {$cmd_name} error_code] != 0} then {
- puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
- }
+ set cmd_name "Nviz_$i"
+ append cmd_name "_reset"
+ if {[catch {$cmd_name} error_code] != 0} then {
+ puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
+ }
}
foreach i $Nv_(config) {
- set cmd_name "Nviz_$i"
- append cmd_name "_reset"
- if {[catch {$cmd_name} error_code] != 0} then {
- puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
- }
+ set cmd_name "Nviz_$i"
+ append cmd_name "_reset"
+ if {[catch {$cmd_name} error_code] != 0} then {
+ puts "Diagnostic: $error_code -- Reset procedure for panel $i may not be defined"
+ }
}
# Go through each of the panels one at a time and force them to open
# This should update them all so they display correctly
foreach i $Nv_(panels) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
foreach i $Nv_(config) {
- Nv_openPanel $i
- update
+ Nv_openPanel $i
+ update
}
Nv_closeAllPanels
@@ -1006,12 +1009,12 @@
# append ".nviz" extension to the filename if it doesn't already have one
if { [string compare [file extension $new_file] ".nviz"] != 0 } then {
- append new_file ".nviz"
+ append new_file ".nviz"
}
if {[catch {set file_hook [open $new_file w]} error_code] != 0} then {
- display_error "While opening file: $error_code"
- return
+ display_error "While opening file: $error_code"
+ return
}
# Show that we are busy
@@ -1020,11 +1023,11 @@
# Now call each of the panels one at a time and pass the
# file hook so that each panel can write out its state
foreach i $Nv_(panelstate) {
- set cmd_name "Nviz_$i"
- append cmd_name "_save"
- if {[catch {$cmd_name $file_hook} error_code] != 0} then {
- puts "Diagnostic: $error_code -- Save procedure for panel $i may not be defined"
- }
+ set cmd_name "Nviz_$i"
+ append cmd_name "_save"
+ if {[catch {$cmd_name $file_hook} error_code] != 0} then {
+ puts "Diagnostic: $error_code -- Save procedure for panel $i may not be defined"
+ }
}
# Finally, close the file and exit
@@ -1046,7 +1049,7 @@
Nset_cancel_func update
# and start the ball rolling...
-Nv_makeGUI .top
+Nv_makeGUI $Nv_(AREA)
# Center the view on initialization
look_center
@@ -1074,13 +1077,12 @@
# Automatically load state file from command line
# *********************************************************************
if {[catch {set NvizLoadState}] == 0} then {
+ global Nv_
-global Nv_
+ appBusy
+ load_state_aux $NvizLoadState
-appBusy
-load_state_aux $NvizLoadState
-
-appNotBusy
+ appNotBusy
}
if {$DEBUG} {puts "Finished loading, call draw all"}
Modified: grass/trunk/visualization/nviz/scripts/panel_main.tcl
===================================================================
--- grass/trunk/visualization/nviz/scripts/panel_main.tcl 2009-02-01 22:34:07 UTC (rev 35732)
+++ grass/trunk/visualization/nviz/scripts/panel_main.tcl 2009-02-02 17:59:45 UTC (rev 35733)
@@ -130,12 +130,12 @@
menubutton $BASE.redrawf.f11.m1 -menu $BASE.redrawf.f11.m1.m \
-text "Main features..." -underline 0 -justify left \
-indicator on -anchor center -relief raised -bd 1
- help $BASE.redrawf.f11.m1 balloon "Select main draw features"
+ #help $BASE.redrawf.f11.m1 balloon "Select main draw features"
menubutton $BASE.redrawf.f11.m2 -menu $BASE.redrawf.f11.m2.m \
-text "Decorations..." -underline 0 -justify left \
-indicator on -anchor center -relief raised -bd 1
- help $BASE.redrawf.f11.m2 balloon "Select misc. draw features"
+ #help $BASE.redrawf.f11.m2 balloon "Select misc. draw features"
menu $BASE.redrawf.f11.m1.m
Modified: grass/trunk/visualization/nviz/scripts/panel_sdiff.tcl
===================================================================
--- grass/trunk/visualization/nviz/scripts/panel_sdiff.tcl 2009-02-01 22:34:07 UTC (rev 35732)
+++ grass/trunk/visualization/nviz/scripts/panel_sdiff.tcl 2009-02-02 17:59:45 UTC (rev 35733)
@@ -121,7 +121,7 @@
set name [Nget_current sdiff]
if {$name == 0} {
- set name "none selected"
+ set name "None selected "
} else {
set n [lsearch $list $name]
set list [lreplace $list $n $n]
Modified: grass/trunk/visualization/nviz/scripts/widgets.tcl
===================================================================
--- grass/trunk/visualization/nviz/scripts/widgets.tcl 2009-02-01 22:34:07 UTC (rev 35732)
+++ grass/trunk/visualization/nviz/scripts/widgets.tcl 2009-02-02 17:59:45 UTC (rev 35733)
@@ -420,7 +420,7 @@
}
incr j
}
-
+
return $P
}
@@ -593,7 +593,7 @@
set name [Nget_current $type]
if {[llength $list] == 0} {
- set name "None Loaded"
+ set name "None Loaded "
} else {
set n [lsearch $list $name]
set list [lreplace $list $n $n]
More information about the grass-commit
mailing list