- Timestamp:
- May 14, 2013 2:33:30 PM (11 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/analyzer.tcl
r3523 r3647 50 50 itk_option define -notebookpage notebookPage NotebookPage "" 51 51 52 constructor {tool args} { # defined below } 53 destructor { # defined below } 52 constructor {tool args} { 53 # defined below 54 } 55 destructor { 56 # defined below 57 } 54 58 55 59 public method simulate {args} … … 101 105 102 106 # use this to store all simulation results 103 set _resultset [Rappture::ResultSet :: #auto]107 set _resultset [Rappture::ResultSet ::\#auto] 104 108 $_resultset notify add $this [itcl::code $this _fixResultSet] 105 109 … … 119 123 pack $itk_component(simbg) -expand yes -fill both 120 124 121 set simtxt [ $tool xml get tool.action.label]125 set simtxt [string trim [$tool xml get tool.action.label]] 122 126 if {"" == $simtxt} { 123 127 set simtxt "Simulate" … … 341 345 -font $itk_option(-boldtextfont) 342 346 343 set mesg [ $tool xml get tool.title]347 set mesg [string trim [$tool xml get tool.title]] 344 348 if {"" != $mesg} { 345 349 $itk_component(toolinfo) insert end $mesg title … … 347 351 } 348 352 349 set mesg [ $tool xml get tool.about]353 set mesg [string trim [$tool xml get tool.about]] 350 354 if {"" != $mesg} { 351 355 $itk_component(toolinfo) insert end $mesg … … 506 510 clear 507 511 } 508 509 512 $_resultset add $xmlobj 510 513 … … 999 1002 set details "" 1000 1003 foreach {path val} $settings { 1001 set str [ $_tool xml get $path.about.label]1004 set str [string trim [$_tool xml get $path.about.label]] 1002 1005 if {"" == $str} { 1003 1006 set str [$_tool xml element -as id $path] -
trunk/gui/scripts/booleanentry.tcl
r3635 r3647 145 145 # ---------------------------------------------------------------------- 146 146 itcl::body Rappture::BooleanEntry::label {} { 147 set label [ $_owner xml get $_path.about.label]147 set label [string trim [$_owner xml get $_path.about.label]] 148 148 if {"" == $label} { 149 149 set label "Boolean" … … 161 161 # ---------------------------------------------------------------------- 162 162 itcl::body Rappture::BooleanEntry::tooltip {} { 163 set str [ $_owner xml get $_path.about.description]163 set str [string trim [$_owner xml get $_path.about.description]] 164 164 append str "\n\nClick to turn on/off" 165 return [string trim $str]165 return $str 166 166 } 167 167 -
trunk/gui/scripts/choiceentry.tcl
r3513 r3647 136 136 # ---------------------------------------------------------------------- 137 137 itcl::body Rappture::ChoiceEntry::label {} { 138 set label [ $_owner xml get $_path.about.label]138 set label [string trim [$_owner xml get $_path.about.label]] 139 139 if {"" == $label} { 140 140 set label "Choice" … … 193 193 $_owner notify add $this $cntl [itcl::code $this _rebuild] 194 194 195 set label [$_owner xml get $_path.$cname.about.label] 195 set label \ 196 [string trim [$_owner xml get $_path.$cname.about.label]] 196 197 if {"" == $label} { 197 198 set label "%type #%n" … … 208 209 set subst(%id) [$_owner xml element -as id $leading.$ccname] 209 210 foreach detail [$_owner xml children $leading.$ccname] { 210 set subst(%$detail) [$_owner xml get $leading.$ccname.$detail] 211 set subst(%$detail) \ 212 [$_owner xml get $leading.$ccname.$detail] 211 213 } 212 214 set str [string map [array get subst] $label] … … 226 228 # 227 229 set val [string trim [$_owner xml get $_path.$cname.value]] 228 set str [ $_owner xml get $_path.$cname.about.label]230 set str [string trim [$_owner xml get $_path.$cname.about.label]] 229 231 if {"" == $val} { 230 232 set val $str … … 276 278 # ---------------------------------------------------------------------- 277 279 itcl::body Rappture::ChoiceEntry::_tooltip {} { 278 set tip [ $_owner xml get $_path.about.description]280 set tip [string trim [$_owner xml get $_path.about.description]] 279 281 280 282 # get the description for the current choice, if there is one … … 283 285 set desc "" 284 286 if {$path != ""} { 285 set desc [ $_owner xml get $path.about.description]287 set desc [string trim [$_owner xml get $path.about.description]] 286 288 } 287 289 -
trunk/gui/scripts/controls.tcl
r3642 r3647 577 577 foreach name $showing { 578 578 set wv $_name2info($name-value) 579 $wv configure -heading no 580 581 set label [$wv component heading cget -text] 582 if {"" == $label} { 583 set label "Group #$gn" 584 } 585 set _name2info($name-label) $label 586 $_tabs insert end $name -text $label \ 587 -activebackground $itk_option(-background) \ 588 -window $_frame -fill both 589 590 incr gn 579 if { [winfo class $wv] == "GroupEntry" } { 580 $wv configure -heading no 581 set label [$wv component heading cget -text] 582 if {"" == $label} { 583 set label "Group #$gn" 584 } 585 set _name2info($name-label) $label 586 $_tabs insert end $name -text $label \ 587 -activebackground $itk_option(-background) \ 588 -window $_frame -fill both 589 incr gn 591 590 } 592 591 -
trunk/gui/scripts/drawingentry.tcl
r3636 r3647 264 264 # ---------------------------------------------------------------------- 265 265 itcl::body Rappture::DrawingEntry::label {} { 266 set label [ $_owner xml get $_path.about.label]266 set label [string trim [$_owner xml get $_path.about.label]] 267 267 if {$label eq ""} { 268 268 set label "Drawing" -
trunk/gui/scripts/gauge.tcl
r3642 r3647 139 139 } 140 140 141 itk_component add spindn { 142 button $itk_component(spinner).down -image [Rappture::icon intminus] \ 143 -borderwidth 1 -relief raised -highlightthickness 0 \ 144 -command [itcl::code $this bump -1] 145 } { 146 usual 147 ignore -borderwidth -highlightthickness 148 rename -background -buttonbackground buttonBackground Background 149 } 150 pack $itk_component(spindn) -side left -expand yes -fill both 151 141 152 itk_component add spinup { 142 153 button $itk_component(spinner).up -image [Rappture::icon intplus] \ … … 148 159 rename -background -buttonbackground buttonBackground Background 149 160 } 150 pack $itk_component(spinup) -side left -expand yes -fill both 151 152 itk_component add spindn { 153 button $itk_component(spinner).down -image [Rappture::icon intminus] \ 154 -borderwidth 1 -relief raised -highlightthickness 0 \ 155 -command [itcl::code $this bump -1] 156 } { 157 usual 158 ignore -borderwidth -highlightthickness 159 rename -background -buttonbackground buttonBackground Background 160 } 161 pack $itk_component(spindn) -side right -expand yes -fill both 162 161 pack $itk_component(spinup) -side right -expand yes -fill both 163 162 164 163 itk_component add presets { … … 214 213 # response about min and max values in familiar units. 215 214 # 216 set newval [set nv [ lindex $args 0]]215 set newval [set nv [string trim [lindex $args 0]]] 217 216 set units $itk_option(-units) 218 217 if {"" != $units} { -
trunk/gui/scripts/groupentry.tcl
r3330 r3647 64 64 65 65 $itk_component(heading) configure \ 66 -text [ $_owner xml get $_path.about.label]66 -text [string trim [$_owner xml get $_path.about.label]] 67 67 Rappture::Tooltip::for $itk_component(heading) \ 68 [ $_owner xml get $_path.about.description]68 [string trim [$_owner xml get $_path.about.description]] 69 69 70 70 itk_component add outline { … … 121 121 # ---------------------------------------------------------------------- 122 122 itcl::body Rappture::GroupEntry::tooltip {} { 123 return [ $_owner xml get $_path.about.description]123 return [string trim [$_owner xml get $_path.about.description]] 124 124 } 125 125 -
trunk/gui/scripts/imageentry.tcl
r3513 r3647 191 191 # ---------------------------------------------------------------------- 192 192 itcl::body Rappture::ImageEntry::label {} { 193 set label [ $_owner xml get $_path.about.label]194 return [string trim $label]193 set label [string trim [$_owner xml get $_path.about.label]] 194 return $label 195 195 } 196 196 … … 204 204 # ---------------------------------------------------------------------- 205 205 itcl::body Rappture::ImageEntry::tooltip {} { 206 set str [ $_owner xml get $_path.about.description]207 return [string trim $str]206 set str [string trim [$_owner xml get $_path.about.description]] 207 return $str 208 208 } 209 209 -
trunk/gui/scripts/integerentry.tcl
r3513 r3647 142 142 # ---------------------------------------------------------------------- 143 143 itcl::body Rappture::IntegerEntry::label {} { 144 set label [ $_owner xml get $_path.about.label]144 set label [string trim [$_owner xml get $_path.about.label]] 145 145 if {"" == $label} { 146 146 set label "Integer" … … 158 158 # ---------------------------------------------------------------------- 159 159 itcl::body Rappture::IntegerEntry::tooltip {} { 160 set str [$_owner xml get $_path.about.description] 161 160 set str [string trim [$_owner xml get $_path.about.description]] 162 161 set min [string trim [$_owner xml get $_path.min]] 163 162 set max [string trim [$_owner xml get $_path.max]] -
trunk/gui/scripts/loader.tcl
r3513 r3647 94 94 set newfile "" 95 95 foreach comp [$_owner xml children -type new $path] { 96 set name [string trim [$_owner xml get $path.$comp]]96 set name [string trim [$_owner xml get $path.$comp]] 97 97 set fname [file join $fdir examples $name] 98 98 … … 136 136 continue 137 137 } 138 set label [ $_owner xml get $topath.about.label]139 set desc [$_owner xml get $topath.about.description]138 set label [string trim [$_owner xml get $topath.about.label]] 139 set desc [string trim [$_owner xml get $topath.about.description]] 140 140 lappend _uppath $topath $label $desc 141 141 } … … 164 164 set _dnpath2state($this-$frompath) [expr {$i == 0}] 165 165 166 set label [ $_owner xml get $frompath.about.label]166 set label [string trim [$_owner xml get $frompath.about.label]] 167 167 checkbutton $inner.cb$i -text $label \ 168 168 -variable ::Rappture::Loader::_dnpath2state($this-$frompath) … … 239 239 240 240 set _copyfrom [string trim [$_owner xml get $path.copy.from]] 241 set _copyto [string trim [$_owner xml get $path.copy.to]]241 set _copyto [string trim [$_owner xml get $path.copy.to]] 242 242 243 243 # … … 401 401 # ---------------------------------------------------------------------- 402 402 itcl::body Rappture::Loader::_tooltip {} { 403 set str [ $_owner xml get $_path.about.description]403 set str [string trim [$_owner xml get $_path.about.description]] 404 404 405 405 # get the description for the current choice, if there is one -
trunk/gui/scripts/main.tcl
r3513 r3647 196 196 # ---------------------------------------------------------------------- 197 197 Rappture::MainWin .main -borderwidth 0 198 .main configure -title [ $tool xml get tool.title]198 .main configure -title [string trim [$tool xml get tool.title]] 199 199 wm withdraw .main 200 200 wm protocol .main WM_DELETE_WINDOW {Rappture::Logger::cleanup; exit} -
trunk/gui/scripts/numberentry.tcl
r3511 r3647 55 55 foreach pre [$_owner xml children -type preset $path] { 56 56 set value [string trim [$_owner xml get $path.$pre.value]] 57 set label [ $_owner xml get $path.$pre.label]57 set label [string trim [$_owner xml get $path.$pre.label]] 58 58 lappend presets $value $label 59 59 } … … 146 146 return 147 147 } 148 set newval [ lindex $args 0]148 set newval [string trim [lindex $args 0]] 149 149 $itk_component(gauge) value $newval 150 150 return $newval … … 167 167 # ---------------------------------------------------------------------- 168 168 itcl::body Rappture::NumberEntry::label {} { 169 set label [ $_owner xml get $_path.about.label]169 set label [string trim [$_owner xml get $_path.about.label]] 170 170 if {"" == $label} { 171 171 set label "Number" … … 183 183 # ---------------------------------------------------------------------- 184 184 itcl::body Rappture::NumberEntry::tooltip {} { 185 set str [$_owner xml get $_path.about.description]185 set str [string trim [$_owner xml get $_path.about.description]] 186 186 187 187 set units [string trim [$_owner xml get $_path.units]] 188 set min [string trim [$_owner xml get $_path.min]]189 set max [string trim [$_owner xml get $_path.max]]188 set min [string trim [$_owner xml get $_path.min]] 189 set max [string trim [$_owner xml get $_path.max]] 190 190 191 191 if {$units != "" || $min != "" || $max != ""} { -
trunk/gui/scripts/periodicelemententry.tcl
r3513 r3647 53 53 set defval [string trim [$_owner xml get $_path.default]] 54 54 # Active and inactive are lists. Don't need to trim. 55 set active [ $_owner xml get $_path.active]56 set inactive [ $_owner xml get $_path.inactive]55 set active [string trim [$_owner xml get $_path.active]] 56 set inactive [string trim [$_owner xml get $_path.inactive]] 57 57 # 58 58 # Create the widget and configure it properly based on other … … 173 173 # ---------------------------------------------------------------------- 174 174 itcl::body Rappture::PeriodicElementEntry::_tooltip {} { 175 set tip [ $_owner xml get $_path.about.description]175 set tip [string trim [$_owner xml get $_path.about.description]] 176 176 177 177 # get the description for the current element, if there is one 178 178 set str [$itk_component(element) element get -all] 179 179 if {$_path != ""} { 180 set desc [ $_owner xml get $_path.about.description]180 set desc [string trim [$_owner xml get $_path.about.description]] 181 181 } 182 182 -
trunk/gui/scripts/spinint.tcl
r3642 r3647 67 67 pack $itk_component(controls) -side right 68 68 69 itk_component add down { 70 button $itk_component(controls).spindn \ 71 -image [Rappture::icon intminus] \ 72 -borderwidth 1 -relief raised -highlightthickness 0 \ 73 -command [itcl::code $this bump down] 74 } { 75 usual 76 ignore -borderwidth -highlightthickness 77 rename -background -buttonbackground buttonBackground Background 78 } 79 pack $itk_component(down) -side left -expand yes -fill both 80 69 81 itk_component add up { 70 82 button $itk_component(controls).spinup \ … … 77 89 rename -background -buttonbackground buttonBackground Background 78 90 } 79 pack $itk_component(up) -side left -expand yes -fill both 80 81 itk_component add down { 82 button $itk_component(controls).spindn \ 83 -image [Rappture::icon intminus] \ 84 -borderwidth 1 -relief raised -highlightthickness 0 \ 85 -command [itcl::code $this bump down] 86 } { 87 usual 88 ignore -borderwidth -highlightthickness 89 rename -background -buttonbackground buttonBackground Background 90 } 91 pack $itk_component(down) -side right -expand yes -fill both 91 pack $itk_component(up) -side right -expand yes -fill both 92 92 93 93 eval itk_initialize $args -
trunk/gui/scripts/textentry.tcl
r3636 r3647 86 86 87 87 set hints [string trim [$_owner xml get $path.about.hints]] 88 set icon [string trim [$_owner xml get $path.about.icon]]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/trailing106 # whitespace is wanted.107 set str [ $_owner xml get $path.default]105 # Trimming for now. May need a <verbatim> flag to indicate to leave 106 # the string alone. 107 set str [string trim [$_owner xml get $path.default]] 108 108 if {"" != $str} { 109 109 value $str … … 165 165 # ---------------------------------------------------------------------- 166 166 itcl::body Rappture::TextEntry::label {} { 167 set label [ $_owner xml get $_path.about.label]167 set label [string trim [$_owner xml get $_path.about.label]] 168 168 if {"" == $label} { 169 169 set label "String" … … 181 181 # ---------------------------------------------------------------------- 182 182 itcl::body Rappture::TextEntry::tooltip {} { 183 set str [ $_owner xml get $_path.about.description]184 return [string trim $str]183 set str [string trim [$_owner xml get $_path.about.description]] 184 return $str 185 185 } 186 186
Note: See TracChangeset
for help on using the changeset viewer.