Ignore:
Timestamp:
Jul 18, 2008 11:57:18 AM (16 years ago)
Author:
mmh
Message:

Rewritten color range code for integers and numbers.
examples/canvas rewritten.
examples/zoo/[integer|number]2 added

File:
1 edited

Legend:

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

    r437 r1075  
    8282    set max [$_owner xml get $path.max]
    8383    if {"" != $max} { $itk_component(gauge) configure -maxvalue $max }
    84 
     84   
    8585    if {$class == "Rappture::Gauge" && "" != $min && "" != $max} {
    86         set color [$_owner xml get $path.color]
    87         if {$color == ""} {
    88             set color blue
    89         }
    90         if {$units != ""} {
    91             set min [Rappture::Units::convert $min -to $units -units off]
    92             set max [Rappture::Units::convert $max -to $units -units off]
    93         }
    94         $itk_component(gauge) configure \
    95             -spectrum [Rappture::Spectrum ::#auto [list \
    96                 $min white $max $color] -units $units]
     86        set color [$_owner xml get $path.about.color]
     87        if {$color == ""} {
     88            # deprecated.  Color should be in "about"
     89            set color [$_owner xml get $path.color]
     90        }
     91        if {$color != ""}  {
     92            if {$units != ""} {
     93                set min [Rappture::Units::convert $min -to $units -units off]
     94                set max [Rappture::Units::convert $max -to $units -units off]
     95            }
     96            # For compatibility. If only one color use white for min
     97            if {[llength $color] == 1} {
     98                set color [list $min white $max $color]
     99            }
     100            $itk_component(gauge) configure \
     101                -spectrum [Rappture::Spectrum ::#auto $color -units $units]
     102        }
    97103    }
    98104
Note: See TracChangeset for help on using the changeset viewer.