- Timestamp:
- Sep 25, 2005, 10:11:43 PM (19 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/radiodial.tcl
r64 r67 234 234 } 235 235 set _current $newval 236 237 after cancel [itcl::code $this _redraw] 238 after idle [itcl::code $this _redraw] 239 event generate $itk_component(hull) <<Value>> 240 236 241 return $_current 237 242 } -
trunk/gui/scripts/resultset.tcl
r64 r67 14 14 option add *ResultSet.width 4i widgetDefault 15 15 option add *ResultSet.height 4i widgetDefault 16 option add *ResultSet.missingData skip widgetDefault 16 17 option add *ResultSet.toggleBackground gray widgetDefault 17 18 option add *ResultSet.toggleForeground white widgetDefault … … 28 29 itk_option define -textfont textFont Font "" 29 30 itk_option define -boldfont boldFont Font "" 31 itk_option define -missingdata missingData MissingData "" 30 32 itk_option define -clearcommand clearCommand ClearCommand "" 31 33 itk_option define -settingscommand settingsCommand SettingsCommand "" … … 413 415 grid $w -row $_counter -column 1 -sticky ew 414 416 bind $w <<Value>> \ 415 [itcl::code $_dispatcher event -after 100 !settings ]417 [itcl::code $_dispatcher event -after 100 !settings column $col widget $w] 416 418 set _col2widget($col) $w 417 419 … … 566 568 # 567 569 _doSettings $plist 568 } else { 570 } elseif {$itk_option(-missingdata) == "skip"} { 571 # 572 # No data for these settings. Try leaving the next 573 # column open, then the next, and so forth, until 574 # we find some data. 575 # 576 array set eventdata $args 577 if {[info exists eventdata(column)]} { 578 set changed $eventdata(column) 579 set allcols [lrange [$_results column names] 1 end] 580 set i [lsearch -exact $allcols $changed] 581 set search [concat \ 582 [lrange $allcols [expr {$i+1}] end] \ 583 [lrange $allcols 0 [expr {$i-1}]] \ 584 ] 585 set nsearch [llength $search] 586 587 set tweak(widget) "" 588 set tweak(value) "" 589 for {set i 0} {$i < $nsearch} {incr i} { 590 set format $eventdata(column) 591 set tuple [$eventdata(widget) get current] 592 for {set j [expr {$i+1}]} {$j < $nsearch} {incr j} { 593 set col [lindex $search $j] 594 set w $_col2widget($col) 595 lappend format $col 596 lappend tuple [$w get current] 597 } 598 set ilist [$_results find -format $format -- $tuple] 599 if {[llength $ilist] > 0} { 600 set col [lindex $search $i] 601 set tweak(widget) $_col2widget($col) 602 set first [lindex $ilist 0] 603 set tweak(value) [$_results get -format $col -- $first] 604 break 605 } 606 } 607 608 # set the value to the next valid result 609 if {$tweak(widget) != ""} { 610 $tweak(widget) current $tweak(value) 611 } 612 } 613 614 } elseif {$itk_option(-missingdata) == "prompt"} { 569 615 # prompt the user to simulate these settings 570 616 _doPrompt on … … 631 677 $_dispatcher event -idle !settings 632 678 } 679 680 # ---------------------------------------------------------------------- 681 # OPTION: -missingdata 682 # ---------------------------------------------------------------------- 683 itcl::configbody Rappture::ResultSet::missingdata { 684 set opts {prompt skip} 685 if {[lsearch -exact $opts $itk_option(-missingdata)] < 0} { 686 error "bad value \"$itk_option(-missingdata)\": should be [join $opts {, }]" 687 } 688 }
Note: See TracChangeset
for help on using the changeset viewer.