home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)propifcomb.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)propifcomb.tcl /main/hindenburg/2 17 Dec 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
-
- require "propifelem.tcl"
-
- # End user added include file section
-
- require "propinterf.tcl"
-
- Class PropIfCombo : {PropInterface} {
- method destructor
- constructor
- method getProperties
- method setProperties
- attribute extraValue
- attribute textDef
- attribute selectIf
- }
-
- method PropIfCombo::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this PropInterface::destructor
- }
-
- constructor PropIfCombo {class this guiParent propDef} {
- set this [PropInterface::constructor $class $this]
- set box [PropIfElement new $guiParent [lindex [$propDef memberSet] 0]]
- eval $this config -definition $propDef \
- -ifElement [$box ifElement] \
- -textDef [lindex [$propDef memberSet] 1] \
- -selectIf $box [$propDef ifOptions]
- return $this
- }
-
- method PropIfCombo::getProperties {this propContainer} {
- global valueMethod
- set def [[$this selectIf] definition]
- set key [$def name]
- set class [$def ifClass]
- set elem [$this ifElement]
- set key2 [[$this textDef] name]
- set value [$propContainer getPropertyValue $key]
- if {$value == ""} {
- set value [PropIfElement::defaultValue $class $elem]
- } elseif {$value == [$this extraValue]} {
- set value [$propContainer getPropertyValue $key2]
- }
- $elem $valueMethod($class) $value
- $elem sensitive [expr [$propContainer isPropertyEditable $key] && \
- [$propContainer isPropertyEditable $key2]]
- }
-
- method PropIfCombo::setProperties {this propContainer} {
- global valueMethod
- set def [[$this selectIf] definition]
- set elem [$this ifElement]
- set class [$def ifClass]
- set value [$elem $valueMethod($class)]
- set defVal [PropIfElement::defaultValue $class $elem]
- set prop [$def name]
- set textDef [$this textDef]
- foreach entry [$elem entrySet] {
- if {$entry == $value} {
- $propContainer changeProperty $prop $value $defVal
- $propContainer removeProperty $textDef
- return
- }
- }
- $propContainer changeProperty $prop [$this extraValue] $defVal
- $propContainer changeProperty [$textDef name] $value ""
- }
-
- # Do not delete this line -- regeneration end marker
-
-