- Timestamp:
- Apr 24, 2008 11:30:56 AM (16 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/resultviewer.tcl
r844 r997 44 44 private variable _dataslots "" ;# list of all data objects in this widget 45 45 } 46 46 47 47 itk::usual ResultViewer { 48 48 keep -background -foreground -cursor -font … … 239 239 set mode "contour" 240 240 if {![info exists _mode2widget($mode)]} { 241 241 set mesh [$dataobj mesh] 242 242 set fmt [expr {("" != $mesh) ? "vtk" : "heightmap"}] 243 243 set w $itk_interior.contour … … 245 245 set _mode2widget($mode) $w 246 246 } 247 247 } 248 248 3D { 249 249 set mode "field3D" … … 414 414 return [Rappture::Curve ::#auto $xmlobj $path] 415 415 } 416 416 histogram { 417 417 return [Rappture::Histogram ::#auto $xmlobj $path] 418 418 } -
trunk/gui/scripts/sequence.tcl
r894 r997 23 23 24 24 public method value {pos} 25 public method label {pos} 25 26 public method index {pos} 26 27 public method size {} … … 29 30 private variable _xmlobj "" ;# ref to lib obj with sequence data 30 31 private variable _dataobjs ;# maps index => data object 32 private variable _labels ;# maps index => labels 31 33 private variable _indices ;# list of sorted index values 32 34 private variable _hints ;# cache of hints stored in XML … … 51 53 } 52 54 55 # check for an element about.label stanza 56 set elelabel [$xmlobj get $path.$name.about.label] 57 53 58 set ctype "" 54 59 set _dataobjs($index) "" 60 set _labels($index) "" 55 61 foreach cname [$_xmlobj children $name] { 56 62 set type [$xmlobj element -as type $path.$name.$cname] … … 60 66 continue 61 67 } 68 about { 69 # ignore this 70 continue 71 } 62 72 curve { 63 73 set obj [Rappture::Curve ::#auto $xmlobj $path.$name.$cname] … … 100 110 if {$type == $ctype} { 101 111 lappend _dataobjs($index) $obj 112 set _labels($index) $elelabel 102 113 } else { 103 114 itcl::delete object $obj … … 172 183 173 184 # ---------------------------------------------------------------------- 185 # USAGE: label <pos> 186 # 187 # Returns the label for the element as position <pos> in the 188 # list of all elements. Here, <pos> runs from 0 to size-1. 189 # ---------------------------------------------------------------------- 190 itcl::body Rappture::Sequence::label {pos} { 191 set i [lindex [lindex $_indices $pos] 0] 192 return $_labels($i) 193 } 194 195 # ---------------------------------------------------------------------- 174 196 # USAGE: index <pos> 175 197 # -
trunk/gui/scripts/sequenceresult.tcl
r976 r997 115 115 } 116 116 pack $itk_component(indexValue) -side left 117 118 # add an element.about.label stanza 119 itk_component add eleLabel { 120 label $itk_component(info).elabel -padx 10 121 } 122 pack $itk_component(eleLabel) -side left 117 123 118 124 itk_component add options { … … 538 544 } 539 545 540 set val [$itk_component(dial) get -format label current] 541 $itk_component(indexValue) configure -text "= $val" 542 set _pos [lsearch -glob $_indices $val*] 546 # if the indexLabel is empty, don't show indexValue 547 if {"" != [$_topmost hints indexlabel]} { 548 set val [$itk_component(dial) get -format label current] 549 $itk_component(indexValue) configure -text "= $val" 550 set _pos [lsearch -glob $_indices $val*] 551 } 552 553 # populate the label for this element 554 $itk_component(eleLabel) configure -text "[$_topmost label $_pos]" 543 555 544 556 $viewer delete
Note: See TracChangeset
for help on using the changeset viewer.