Ignore:
Timestamp:
Apr 5, 2012, 1:37:35 PM (13 years ago)
Author:
mmc
Message:

Fixed the "Clear" button on the ResultSet? so that you can either
"Clear All" or "Clear One" result. This is nice when you have
generated a lot of results and you want to get rid of a bad one.
Removed the "Parameters..." button and popup. That's almost useless.
We need something like a table that lets you view all datasets and
turn them on/off. The simple "Clear One" sort of works for now.

Fixed the Balloon widget to have a -background option. The newer
style for Rappture going forward will be to use a solid color
(like black) for the balloon background and set the borderwidth
to zero.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/analyzer.tcl

    r2783 r2943  
    5555    public method reset {{when -eventually}}
    5656    public method load {xmlobj}
    57     public method clear {}
     57    public method clear {{xmlobj ""}}
    5858    public method download {option args}
    5959
     
    641641
    642642# ----------------------------------------------------------------------
    643 # USAGE: clear
    644 #
    645 # Discards all results previously loaded into the analyzer.
    646 # ----------------------------------------------------------------------
    647 itcl::body Rappture::Analyzer::clear {} {
    648     foreach obj $_runs {
    649         itcl::delete object $obj
    650     }
    651     set _runs ""
    652 
    653     $itk_component(resultset) clear
    654 
    655     # reset the size of the controls area
    656     set ht [winfo height $itk_component(results)]
    657     set cntlht [$itk_component(resultset) size -controlarea]
    658     set frac [expr {double($cntlht)/$ht}]
    659     $itk_component(results) fraction end $frac
    660 
    661     foreach label [array names _label2page] {
    662         set page $_label2page($label)
    663         destroy $page.rviewer
    664         #$page.rviewer clear
    665     }
    666     $itk_component(resultselector) value ""
    667     $itk_component(resultselector) choices delete 0 end
    668     catch {unset _label2page}
    669     catch {unset _label2desc}
    670     set _plotlist ""
    671 
    672     $itk_component(resultselector) choices insert end --- "---"
    673     $itk_component(resultselector) choices insert end \
    674         @download [Rappture::filexfer::label download]
    675     set _lastlabel ""
     643# USAGE: clear ?<xmlobj>?
     644#
     645# Discards one or more results previously loaded into the analyzer.
     646# If an <xmlobj> is specified, then that one result is cleared.
     647# Otherwise, all results are cleared.
     648# ----------------------------------------------------------------------
     649itcl::body Rappture::Analyzer::clear {{xmlobj ""}} {
     650    if {$xmlobj ne ""} {
     651        set i [lsearch -exact $_runs $xmlobj]
     652        if {$i >= 0} {
     653            itcl::delete object $xmlobj
     654            set _runs [lreplace $_runs $i $i]
     655
     656            # delete this result from all viewers
     657            foreach label [array names _label2page] {
     658                set page $_label2page($label)
     659                $page.rviewer clear $xmlobj
     660            }
     661        }
     662    } else {
     663        # clear everything
     664        foreach obj $_runs {
     665            itcl::delete object $obj
     666        }
     667        set _runs ""
     668    }
     669
     670    if {[llength $_runs] == 0} {
     671        # reset the size of the controls area
     672        set ht [winfo height $itk_component(results)]
     673        set cntlht [$itk_component(resultset) size -controlarea]
     674        set frac [expr {double($cntlht)/$ht}]
     675        $itk_component(results) fraction end $frac
     676
     677        foreach label [array names _label2page] {
     678            set page $_label2page($label)
     679            destroy $page.rviewer
     680        }
     681        $itk_component(resultselector) value ""
     682        $itk_component(resultselector) choices delete 0 end
     683        catch {unset _label2page}
     684        catch {unset _label2desc}
     685        set _plotlist ""
     686
     687        $itk_component(resultselector) choices insert end --- "---"
     688        $itk_component(resultselector) choices insert end \
     689            @download [Rappture::filexfer::label download]
     690        set _lastlabel ""
     691    }
    676692
    677693    #
Note: See TracChangeset for help on using the changeset viewer.