home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
propifcomb.tcl
< prev
next >
Wrap
Text File
|
1997-02-21
|
3KB
|
87 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)propifcomb.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)propifcomb.tcl /main/titanic/3 21 Feb 1997 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 ifOpts [$def ifOptions]
set elem [$this ifElement]
set key2 [[$this textDef] name]
set value [$propContainer getPropertyValue $key]
if {$value == ""} {
set value [PropIfElement::defaultValue $class $ifOpts]
} 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 ifOpts [$def ifOptions]
set value [$elem $valueMethod($class)]
set defVal [PropIfElement::defaultValue $class $ifOpts]
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