Changeset 3513 for trunk/gui/scripts
- Timestamp:
- Mar 16, 2013, 12:28:44 PM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/analyzer.tcl
r3330 r3513 355 355 356 356 # tool can run on "manual" (default) or "auto" 357 set cntl [ $tool xml get tool.control]357 set cntl [string trim [$tool xml get tool.control]] 358 358 if {"" == $cntl} { 359 set cntl [ $tool xml get tool.control.type]359 set cntl [string trim [$tool xml get tool.control.type]] 360 360 } 361 361 if {"" != $cntl} { … … 503 503 itcl::body Rappture::Analyzer::load {xmlobj} { 504 504 # only show the last result? then clear first 505 if {[ $_tool xml get tool.analyzer] == "last"} {505 if {[string trim [$_tool xml get tool.analyzer]] == "last"} { 506 506 clear 507 507 } -
trunk/gui/scripts/booleanentry.tcl
r3330 r3513 55 55 56 56 # if the control has an icon, plug it in 57 set icon [ $_owner xml get $path.about.icon]57 set icon [string trim [$_owner xml get $path.about.icon]] 58 58 if {$icon != ""} { 59 59 itk_component add icon { … … 80 80 -interactcommand [itcl::code $this _log] 81 81 } 82 set color [ $_owner xml get $path.about.color]82 set color [string trim [$_owner xml get $path.about.color]] 83 83 if {$color != ""} { 84 84 $itk_component(switch) configure -oncolor $color … … 93 93 # Assign the default value to this widget, if there is one. 94 94 # 95 set str [ $_owner xml get $path.default]95 set str [string trim [$_owner xml get $path.default]] 96 96 if {"" != $str} { 97 97 $itk_component(switch) value $str -
trunk/gui/scripts/choiceentry.tcl
r3330 r3513 193 193 $_owner notify add $this $cntl [itcl::code $this _rebuild] 194 194 195 set label [ string trim [$_owner xml get $_path.$cname.about.label]]195 set label [$_owner xml get $_path.$cname.about.label] 196 196 if {"" == $label} { 197 197 set label "%type #%n" … … 226 226 # 227 227 set val [string trim [$_owner xml get $_path.$cname.value]] 228 set str [ string trim [$_owner xml get $_path.$cname.about.label]]228 set str [$_owner xml get $_path.$cname.about.label] 229 229 if {"" == $val} { 230 230 set val $str … … 276 276 # ---------------------------------------------------------------------- 277 277 itcl::body Rappture::ChoiceEntry::_tooltip {} { 278 set tip [ string trim [$_owner xml get $_path.about.description]]278 set tip [$_owner xml get $_path.about.description] 279 279 280 280 # get the description for the current choice, if there is one -
trunk/gui/scripts/controls.tcl
r3330 r3513 169 169 } 170 170 control { 171 set label [$_owner xml get $path.label] 172 if {"" == $label} { set label "Simulate" } 173 set service [$_owner xml get $path.service] 171 set label [string trim [$_owner xml get $path.label]] 172 if {"" == $label} { 173 set label "Simulate" 174 } 175 set service [string trim [$_owner xml get $path.service]] 174 176 button $w -text $label -command [list $service run] 175 177 } … … 266 268 set _name2info($name-enable) $enable 267 269 268 set hidden [ $_owner xml get $_name2info($name-path).hide]270 set hidden [string trim [$_owner xml get $_name2info($name-path).hide]] 269 271 if { $hidden != "" } { 270 272 set _name2info($name-enable) [expr !$hidden] -
trunk/gui/scripts/imageentry.tcl
r3330 r3513 108 108 } 109 109 110 # Don't trim this string. It make be important. 110 111 set str [$_owner xml get $path.current] 111 112 if {[string length $str] == 0} { … … 174 175 # 175 176 set bytes $_data 176 set fmt [ $_owner xml get $_path.convert]177 set fmt [string trim [$_owner xml get $_path.convert]] 177 178 if {"" != $fmt && "" != $_imh} { 178 179 if {"pgm" == $fmt} { set fmt "ppm -grayscale" } -
trunk/gui/scripts/integerentry.tcl
r3330 r3513 60 60 61 61 # if there are min/max values, plug them in. 62 set min [ $_owner xml get $path.min]62 set min [string trim [$_owner xml get $path.min]] 63 63 if {"" != $min} { 64 64 $itk_component(spinner) configure -minvalue $min 65 65 } 66 66 67 set max [ $_owner xml get $path.max]67 set max [string trim [$_owner xml get $path.max]] 68 68 if {"" != $max} { 69 69 $itk_component(spinner) configure -maxvalue $max … … 71 71 72 72 # if there is a color, use it for the min/max spectrum 73 set color [ $_owner xml get $path.about.color]73 set color [string trim [$_owner xml get $path.about.color]] 74 74 if {$color != "" && $min != "" && $max != ""} { 75 75 # For compatibility. If only one color use white for min … … 78 78 } 79 79 $itk_component(spinner) configure \ 80 -spectrum [Rappture::Spectrum :: #auto $color]80 -spectrum [Rappture::Spectrum ::\#auto $color] 81 81 } 82 82 83 83 # if the control has an icon, plug it in 84 set str [ $_owner xml get $path.about.icon]84 set str [string trim [$_owner xml get $path.about.icon]] 85 85 if {$str != ""} { 86 86 $itk_component(spinner) configure -image \ … … 93 93 # Assign the default value to this widget, if there is one. 94 94 # 95 set str [$_owner xml get $path.default] 96 if {"" != $str != ""} { $itk_component(spinner) value $str } 95 set str [string trim [$_owner xml get $path.default]] 96 if {"" != $str != ""} { 97 $itk_component(spinner) value $str 98 } 97 99 } 98 100 … … 158 160 set str [$_owner xml get $_path.about.description] 159 161 160 set min [ $_owner xml get $_path.min]161 set max [ $_owner xml get $_path.max]162 set min [string trim [$_owner xml get $_path.min]] 163 set max [string trim [$_owner xml get $_path.max]] 162 164 163 165 if {$min != "" || $max != ""} { -
trunk/gui/scripts/loader.tcl
r3512 r3513 303 303 # ---------------------------------------------------------------------- 304 304 itcl::body Rappture::Loader::label {} { 305 set label [ $_owner xml get $_path.about.label]305 set label [string trim [$_owner xml get $_path.about.label]] 306 306 if {"" == $label} { 307 307 set label "Example" -
trunk/gui/scripts/main.tcl
r3330 r3513 159 159 # automatic ticket submission for job failures 160 160 # ---------------------------------------------------------------------- 161 set val [ $tool xml get tool.reportJobFailures]161 set val [string trim [$tool xml get tool.reportJobFailures]] 162 162 if { "" != $val} { 163 163 if {[catch {Rappture::bugreport::shouldReport jobfailures $val} result]} { … … 256 256 257 257 foreach comp $phases { 258 set title [ $tool xml get $comp.about.label]258 set title [string trim [$tool xml get $comp.about.label]] 259 259 if {$title == ""} { 260 260 set title "Input #auto" … … 323 323 } 324 324 } 325 set type [ $tool xml get tool.control]325 set type [string trim [$tool xml get tool.control]] 326 326 if {$type == ""} { 327 set type [ $tool xml get tool.control.type]327 set type [string trim [$tool xml get tool.control.type]] 328 328 } 329 329 set arrangement [$win.pager cget -arrangement] -
trunk/gui/scripts/note.tcl
r3330 r3513 69 69 eval itk_initialize $args 70 70 71 _setContents [ $_owner xml get $_path.contents]72 set w [ $_owner xml get $_path.width]71 _setContents [string trim [$_owner xml get $_path.contents]] 72 set w [string trim [$_owner xml get $_path.width]] 73 73 if { $w != "" } { 74 74 $itk_component(html) configure -width $w 75 75 } 76 set h [ $_owner xml get $_path.height]76 set h [string trim [$_owner xml get $_path.height]] 77 77 if { $h != "" } { 78 78 $itk_component(html) configure -height $h -
trunk/gui/scripts/periodicelemententry.tcl
r3330 r3513 52 52 53 53 set defval [string trim [$_owner xml get $_path.default]] 54 # Active and inactive are lists. Don't need to trim. 54 55 set active [$_owner xml get $_path.active] 55 56 set inactive [$_owner xml get $_path.inactive] … … 114 115 # Query the value and return. 115 116 # 116 set how [ $_owner xml get $_path.returnvalue]117 set how [string trim [$_owner xml get $_path.returnvalue]] 117 118 switch -- $how { 118 119 weight - number - name - symbol - all { … … 134 135 # ---------------------------------------------------------------------- 135 136 itcl::body Rappture::PeriodicElementEntry::label {} { 136 set label [ $_owner xml get $_path.about.label]137 set label [string trim [$_owner xml get $_path.about.label]] 137 138 if {"" == $label} { 138 139 set label "Element" … … 172 173 # ---------------------------------------------------------------------- 173 174 itcl::body Rappture::PeriodicElementEntry::_tooltip {} { 174 set tip [ string trim [$_owner xml get $_path.about.description]]175 set tip [$_owner xml get $_path.about.description] 175 176 176 177 # get the description for the current element, if there is one -
trunk/gui/scripts/service.tcl
r3330 r3513 54 54 # Load up the tool description from the <interface> file. 55 55 # 56 set intf [ $_owner xml get $path.interface]56 set intf [string trim [$_owner xml get $path.interface]] 57 57 if {"" == $intf} { 58 58 puts "can't find <interface> description for tool at $path" … … 63 63 set xmlobj [Rappture::library $intf] 64 64 set installdir [file dirname $intf] 65 set _tool [Rappture::Tool :: #auto $xmlobj $installdir]66 set _control [ $_tool xml get tool.control]65 set _tool [Rappture::Tool ::\#auto $xmlobj $installdir] 66 set _control [string trim [$_tool xml get tool.control]] 67 67 68 68 # … … 83 83 set ppath $path.$dir.$cname 84 84 85 set spath [ $_owner xml get $ppath.path]85 set spath [string trim [$_owner xml get $ppath.path]] 86 86 if {"" == $spath} { 87 87 error "missing <path> at $ppath" … … 92 92 show { 93 93 puts "show: $spath" 94 set tpath [$_owner xml get $ppath.to]95 if {"" == $tpath && $dir == "input"} {96 error "missing <to> at $ppath"97 }98 set obj [$_tool xml element -as object $spath]99 puts " => $obj"100 lappend _show($dir) $obj101 set _obj2path($obj) $spath102 103 if {$dir == "input"} {104 puts "link: $tpath => $spath"105 $_owner notify add $this $tpath \106 [itcl::code $this _link $tpath $spath]107 }94 set tpath [string trim [$_owner xml get $ppath.to]] 95 if {"" == $tpath && $dir == "input"} { 96 error "missing <to> at $ppath" 97 } 98 set obj [$_tool xml element -as object $spath] 99 puts " => $obj" 100 lappend _show($dir) $obj 101 set _obj2path($obj) $spath 102 103 if {$dir == "input"} { 104 puts "link: $tpath => $spath" 105 $_owner notify add $this $tpath \ 106 [itcl::code $this _link $tpath $spath] 107 } 108 108 } 109 109 link { 110 set tpath [$_owner xml get $ppath.to]111 if {"" == $tpath} {112 error "missing <to> at $ppath"113 }114 if {"" == [$_owner xml element $tpath]} {115 error "bad <to> path \"$tpath\" at $ppath"116 }117 if {$dir == "input"} {118 puts "link: $tpath => $spath"119 $_owner notify add $this $tpath \120 [itcl::code $this _link $tpath $spath]121 } else {122 puts "path2path: $spath => $tpath"123 set _path2path($spath) $tpath124 }110 set tpath [string trim [$_owner xml get $ppath.to]] 111 if {"" == $tpath} { 112 error "missing <to> at $ppath" 113 } 114 if {"" == [$_owner xml element $tpath]} { 115 error "bad <to> path \"$tpath\" at $ppath" 116 } 117 if {$dir == "input"} { 118 puts "link: $tpath => $spath" 119 $_owner notify add $this $tpath \ 120 [itcl::code $this _link $tpath $spath] 121 } else { 122 puts "path2path: $spath => $tpath" 123 set _path2path($spath) $tpath 124 } 125 125 } 126 set {127 if {"" == [$_owner xml element $ppath.value]} {126 set { 127 if {"" == [$_owner xml element $ppath.value]} { 128 128 error "missing <value> at $ppath" 129 129 } -
trunk/gui/scripts/textentry.tcl
r3330 r3513 83 83 $_dispatcher dispatch $this !layout "[itcl::code $this _layout]; list" 84 84 85 set _size [ $_owner xml get $path.size]86 87 set hints [ $_owner xml get $path.about.hints]88 set icon [ $_owner xml get $path.about.icon]85 set _size [string trim [$_owner xml get $path.size]] 86 87 set hints [string trim [$_owner xml get $path.about.hints]] 88 set icon [string trim [$_owner xml get $path.about.icon]] 89 89 if {[string length $icon] > 0} { 90 90 set _icon [image create photo -data $icon] … … 103 103 eval itk_initialize $args 104 104 105 # Don't trim the text default value. Assume that any leading/trailing 106 # whitespace is wanted. 105 107 set str [$_owner xml get $path.default] 106 108 if {"" != $str} {
Note: See TracChangeset
for help on using the changeset viewer.