home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
propifclas.tcl
< prev
next >
Wrap
Text File
|
1997-09-23
|
5KB
|
178 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)propifclas.tcl /main/titanic/7
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)propifclas.tcl /main/titanic/7 23 Sep 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "propifgrou.tcl"
Class PropIfClassLib : {PropIfGroup} {
method destructor
constructor
method getProperties
method setProperties
method updateOptionMenus
attribute assocKind
attribute operation
}
method PropIfClassLib::destructor {this} {
# Start destructor user section
# End destructor user section
$this PropIfParent::destructor
}
constructor PropIfClassLib {class this guiParent propDef} {
set guiPage [NoteBkPage new $guiParent.[$propDef name]Page \
-label [$propDef longName]]
set this [PropIfGroup::constructor $class $this $guiPage $propDef]
$this ifElement $guiPage
foreach {attrName value} [$propDef ifOptions] {
if {$attrName == "-assocKind"} {
$this assocKind $value
}
}
[[[$this childSet] index 0] ifElement] config \
-entrySet default \
-selected default \
-allowResize 1 \
-selectionChanged "$this updateOptionMenus"
[[[$this childSet] index 1] ifElement] config \
-entrySet default \
-selected default \
-allowResize 1
return $this
}
method PropIfClassLib::getProperties {this propContainer} {
$this operation ""
if {[$this assocKind] == "normalStart"} {
set mult_kind [[$propContainer holderComp] getProperty "mult_kind_start"]
set constraint [[$propContainer holderComp] getProperty "constraint_start"]
} else {
set mult_kind [[$propContainer holderComp] getProperty "mult_kind_end"]
set constraint [[$propContainer holderComp] getProperty "constraint_end"]
}
if {[$this assocKind] == "qualified"} {
if {$mult_kind == "many"} {
if {$constraint == "\{ordered\}"} {
$this operation "OSetDict"
} else {
$this operation "SetDict"
}
} else {
$this operation "Dict"
}
} else {
if {$mult_kind == "many"} {
if {$constraint == "\{ordered\}"} {
$this operation "OSet"
} else {
$this operation "Set"
}
} else {
$this operation "Ptr"
}
}
set libNameSelected [$propContainer getPropertyValue "assoc_impl"]
if {$libNameSelected == ""} {
set libNameSelected "default"
}
set strategySelected [$propContainer getPropertyValue "assoc_strategy"]
if {$strategySelected == ""} {
set strategySelected "default"
}
set libNameMenu [[[$this childSet] index 0] ifElement]
set strategyMenu [[[$this childSet] index 1] ifElement]
$libNameMenu entrySet $libNameSelected
$libNameMenu selected $libNameSelected
$strategyMenu entrySet $strategySelected
$strategyMenu selected $strategySelected
$this updateOptionMenus
[$this childSet] foreach child {
set elem [$child ifElement]
$elem sensitive [expr [$propContainer isPropertyEditable "assoc_impl"] && \
[$propContainer isPropertyEditable "assoc_strategy"]]
}
}
method PropIfClassLib::setProperties {this propContainer} {
set libNameMenu [[[$this childSet] index 0] ifElement]
set strategyMenu [[[$this childSet] index 1] ifElement]
set libNameSelect [$libNameMenu selected]
set strategySelect [$strategyMenu selected]
$propContainer changeProperty "assoc_impl" $libNameSelect "default"
$propContainer changeProperty "assoc_strategy" $strategySelect "default"
}
method PropIfClassLib::updateOptionMenus {this} {
global cplusplusClassLib
set cplusplusClassLib(default) {
Ptr default None
Set default None
OSet default None
Dict default None
SetDict default None
OSetDict default None
}
set libNameMenu [[[$this childSet] index 0] ifElement]
set strategyMenu [[[$this childSet] index 1] ifElement]
set libNameSelected [$libNameMenu selected]
set strategySelected [$strategyMenu selected]
set libNameList [array names cplusplusClassLib]
if {[lsearch -exact $libNameList "default"] == -1} {
lappend libNameList "default"
}
if {[lsearch -exact $libNameList $libNameSelected] == -1} {
lappend libNameList $libNameSelected
}
set strategyList {}
if {[$this operation] == "" ||
![info exists cplusplusClassLib($libNameSelected)]} {
lappend strategyList $strategySelected
} else {
foreach {operation strategy action} \
$cplusplusClassLib($libNameSelected) {
if {$operation == [$this operation]} {
lappend strategyList $strategy
}
}
}
if {[lsearch -exact $strategyList "default"] == -1} {
lappend strategyList "default"
}
if {[lsearch -exact $strategyList $strategySelected] == -1} {
set strategySelected "default"
}
$libNameMenu entrySet [lsort $libNameList]
$libNameMenu selected $libNameSelected
$strategyMenu entrySet [lsort $strategyList]
$strategyMenu selected $strategySelected
}
# Do not delete this line -- regeneration end marker