Ignore:
Timestamp:
May 13, 2006 1:13:19 PM (18 years ago)
Author:
mmc
Message:

Added a new <enable> parameter to all inputs. Controls can now be
enabled/disabled based on the status of other controls. If a group
is disabled, it disappears entirely. If a parameter is enabled to
a hard-coded "off" value, then it acts like a hidden (secret)
parameter.

File:
1 edited

Legend:

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

    r115 r437  
    1515itcl::class Rappture::BooleanEntry {
    1616    inherit itk::Widget
     17
     18    itk_option define -state state State "normal"
    1719
    1820    constructor {owner path args} { # defined below }
     
    141143itcl::body Rappture::BooleanEntry::tooltip {} {
    142144    set str [$_owner xml get $_path.about.description]
    143     append str "\n\nEnter a boolean value (1/0, on/off, yes/no, true/false)"
     145    append str "\n\nClick to turn on/off"
    144146    return [string trim $str]
    145147}
     
    154156    event generate $itk_component(hull) <<Value>>
    155157}
     158
     159# ----------------------------------------------------------------------
     160# CONFIGURATION OPTION: -state
     161# ----------------------------------------------------------------------
     162itcl::configbody Rappture::BooleanEntry::state {
     163    set valid {normal disabled}
     164    if {[lsearch -exact $valid $itk_option(-state)] < 0} {
     165        error "bad value \"$itk_option(-state)\": should be [join $valid {, }]"
     166    }
     167    $itk_component(switch) configure -state $itk_option(-state)
     168}
Note: See TracChangeset for help on using the changeset viewer.