Ignore:
Timestamp:
Jul 16, 2005, 2:31:32 PM (19 years ago)
Author:
mmc
Message:

Lots of changes to support Huckel-IV:

  • Support for embedded <tool> declarations
  • New <integer> entry
  • Support for numbers and structures as output elements
  • Atom numbers/symbols in MoleculeViewer?
File:
1 edited

Legend:

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

    r13 r22  
    1414    inherit itk::Widget
    1515
    16     constructor {xmlobj path args} { # defined below }
     16    constructor {owner path args} { # defined below }
    1717
    1818    public method value {args}
     
    2323    protected method _newValue {}
    2424
    25     private variable _xmlobj ""   ;# XML containing description
     25    private variable _owner ""    ;# thing managing this control
    2626    private variable _path ""     ;# path in XML to this number
    2727}
     
    3737# CONSTRUCTOR
    3838# ----------------------------------------------------------------------
    39 itcl::body Rappture::BooleanEntry::constructor {xmlobj path args} {
    40     if {![Rappture::library isvalid $xmlobj]} {
    41         error "bad value \"$xmlobj\": should be Rappture::library"
     39itcl::body Rappture::BooleanEntry::constructor {owner path args} {
     40    if {[catch {$owner isa Rappture::ControlOwner} valid] != 0 || !$valid} {
     41        error "bad object \"$owner\": should be Rappture::ControlOwner"
    4242    }
    43     set _xmlobj $xmlobj
     43    set _owner $owner
    4444    set _path $path
    4545
     
    5454    bind $itk_component(switch) <<Value>> [itcl::code $this _newValue]
    5555
    56     set color [$xmlobj get $path.about.color]
     56    set color [$_owner xml get $path.about.color]
    5757    if {$color != ""} {
    5858        $itk_component(switch) configure -oncolor $color
     
    6060
    6161    # if the control has an icon, plug it in
    62     set str [$xmlobj get $path.about.icon]
     62    set str [$_owner xml get $path.about.icon]
    6363    if {$str != ""} {
    6464        $itk_component(switch) configure -onimage \
     
    7171    # Assign the default value to this widget, if there is one.
    7272    #
    73     set str [$xmlobj get $path.default]
     73    set str [$_owner xml get $path.default]
    7474    if {"" != $str != ""} { $itk_component(switch) value $str }
    7575}
     
    118118# ----------------------------------------------------------------------
    119119itcl::body Rappture::BooleanEntry::label {} {
    120     set label [$_xmlobj get $_path.about.label]
     120    set label [$_owner xml get $_path.about.label]
    121121    if {"" == $label} {
    122122        set label "Boolean"
     
    134134# ----------------------------------------------------------------------
    135135itcl::body Rappture::BooleanEntry::tooltip {} {
    136     set str [$_xmlobj get $_path.about.description]
     136    set str [$_owner xml get $_path.about.description]
    137137
    138     set units [$_xmlobj get $_path.units]
    139     set min [$_xmlobj get $_path.min]
    140     set max [$_xmlobj get $_path.max]
     138    set units [$_owner xml get $_path.units]
     139    set min [$_owner xml get $_path.min]
     140    set max [$_owner xml get $_path.max]
    141141
    142142    if {$units != "" || $min != "" || $max != ""} {
Note: See TracChangeset for help on using the changeset viewer.