Changeset 1140


Ignore:
Timestamp:
Sep 3, 2008, 4:40:48 PM (16 years ago)
Author:
gah
Message:

small fixes to xylegend

Location:
trunk/gui/scripts
Files:
4 edited

Legend:

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

    r785 r1140  
     1
    12# ----------------------------------------------------------------------
    23#  COMPONENT: Panes - creates a series of adjustable panes
  • trunk/gui/scripts/sequenceresult.tcl

    r1135 r1140  
    289289itcl::body Rappture::SequenceResult::download {option args} {
    290290    if { ![winfo exists $itk_component(area).viewer] } {
    291         return ""; # No data, no viewer, no download.
     291        return "";      # No data, no viewer, no download.
    292292    }
    293293    switch $option {
  • trunk/gui/scripts/xylegend.tcl

    r1137 r1140  
    101101    set controls $itk_component(controls)
    102102    grid $itk_component(controls) -column 0 -row 1 -sticky nsew
     103    grid columnconfigure $itk_component(hull) 0 -weight 1
    103104    grid rowconfigure $itk_component(hull) 1 -weight 0
    104105    grid rowconfigure $itk_component(hull) 0 -weight 1
     
    370371        }
    371372        2 {
    372             foreach n { hide show toggle difference } {
     373            foreach n { hide show toggle difference average } {
    373374                $itk_component(controls).$n configure -state normal
    374375            }
    375376        }
    376377        default {
    377             foreach n { hide show toggle } {
     378            foreach n { hide show toggle average } {
    378379                $itk_component(controls).$n configure -state normal
    379380            }
  • trunk/gui/scripts/xyresult.tcl

    r1133 r1140  
    923923            # for dealing with xy line plots
    924924            set elem $info(name)
    925             foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     925
     926            # Some elements are generated dynamically and therefore will
     927            # not have a curve object associated with them.
     928            set mapx [$g element cget $elem -mapx]
     929            set mapy [$g element cget $elem -mapy]
     930            if {[info exists _elem2curve($elem)]} {
     931                foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     932            }
    926933
    927934            # search again for an exact point -- this time don't interpolate
    928935            set tip ""
     936            array unset info
    929937            if {[$g element closest $x $y info -interpolate no]
    930938                  && $info(name) == $elem} {
    931                 set x [$g axis transform $mapx $info(x)]
    932                 set y [$g axis transform $mapy $info(y)]
    933 
    934                 if {[info exists _elem2curve($elem)]} {
    935                     set curve $_elem2curve($elem)
    936                     #set tip [$curve hints tooltip]
    937                     set tip [$g element cget $elem -label]
    938                     if {[info exists info(y)]} {
    939                         set val [_axis format y dummy $info(y)]
    940                         set units [$curve hints yunits]
    941                         append tip "\n$val$units"
    942 
    943                         if {[info exists info(x)]} {
    944                             set val [_axis format x dummy $info(x)]
    945                             set units [$curve hints xunits]
    946                             append tip " @ $val$units"
    947                         }
    948                     }
    949                     set tip [string trim $tip]
    950                 }
     939
     940                set x [$g axis transform $mapx $info(x)]
     941                set y [$g axis transform $mapy $info(y)]
     942               
     943                if {[info exists _elem2curve($elem)]} {
     944                    set curve $_elem2curve($elem)
     945                    set yunits [$curve hints yunits]
     946                    set xunits [$curve hints xunits]
     947                } else {
     948                    set xunits ""
     949                    set yunits ""
     950                }
     951                set tip [$g element cget $elem -label]
     952                set yval [_axis format y dummy $info(y)]
     953                append tip "\n$yval$yunits"
     954                set xval [_axis format x dummy $info(x)]
     955                append tip " @ $xval$xunits"
     956                set tip [string trim $tip]
    951957            }
    952958            set state 1
     
    954960            # for dealing with xy scatter plot
    955961            set elem $info(name)
    956             foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
    957 
    958             # search again for an exact point -- this time don't interpolate
     962
     963            # Some elements are generated dynamically and therefore will
     964            # not have a curve object associated with them.
     965            set mapx [$g element cget $elem -mapx]
     966            set mapy [$g element cget $elem -mapy]
     967            if {[info exists _elem2curve($elem)]} {
     968                foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
     969            }
     970
    959971            set tip ""
    960             if {$info(name) == $elem} {
    961                 set x [$g axis transform $mapx $info(x)]
    962                 set y [$g axis transform $mapy $info(y)]
    963 
    964                 if {[info exists _elem2curve($elem)]} {
    965                     set curve $_elem2curve($elem)
    966                     #set tip [$curve hints tooltip]
    967                     set tip [$g element cget $elem -label]
    968                     if {[info exists info(y)]} {
    969                         set val [_axis format y dummy $info(y)]
    970                         set units [$curve hints yunits]
    971                         append tip "\n$val$units"
    972 
    973                         if {[info exists info(x)]} {
    974                             set val [_axis format x dummy $info(x)]
    975                             set units [$curve hints xunits]
    976                             append tip " @ $val$units"
    977                         }
    978                     }
    979                     set tip [string trim $tip]
    980                 }
    981             }
     972            set x [$g axis transform $mapx $info(x)]
     973            set y [$g axis transform $mapy $info(y)]
     974               
     975            if {[info exists _elem2curve($elem)]} {
     976                set curve $_elem2curve($elem)
     977                set yunits [$curve hints yunits]
     978                set xunits [$curve hints xunits]
     979            } else {
     980                set xunits ""
     981                set yunits ""
     982            }
     983            set tip [$g element cget $elem -label]
     984            set yval [_axis format y dummy $info(y)]
     985            append tip "\n$yval$yunits"
     986            set xval [_axis format x dummy $info(x)]
     987            append tip " @ $xval$xunits"
     988            set tip [string trim $tip]
    982989            set state 1
    983990        } else {
     
    10011008        set _hilite(elem) $elem
    10021009
    1003         if 0 {
    1004         set dlist [$g element show]
    1005         set i [lsearch -exact $dlist $elem]
    1006         if {$i >= 0} {
    1007             set dlist [lreplace $dlist $i $i]
    1008             lappend dlist $elem
    1009             $g element show $dlist
    1010         }
     1010        set mapx [$g element cget $elem -mapx]
     1011        set mapy [$g element cget $elem -mapy]
     1012        if {[info exists _elem2curve($elem)]} {
     1013            foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
    10111014        }
    1012         foreach {mapx mapy} [_getAxes $_elem2curve($elem)] break
    1013 
    10141015        set allx [$g x2axis use]
    10151016        if {[llength $allx] > 0} {
     
    16091610    switch -- ${what} {
    16101611        "activate" {
    1611             pack $itk_component(legend)
     1612            pack $itk_component(legend) -expand yes -fill both
    16121613            after idle [list focus $itk_component(legend)]
    16131614        }
Note: See TracChangeset for help on using the changeset viewer.