home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)cbpropcont.tcl 1.5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)cbpropcont.tcl 1.5 14 Mar 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "propcontai.tcl"
-
- Class CBPropContainer : {PropContainer} {
- constructor
- method destructor
- method existPropertyHolder
- method loadProperties
- method quitProperties
- method getPropertyValue
- method isPropertyEditable
- method addSpecificPropDef
- method fillPropInfoMethod
- method startLabel
- method endLabel
- method getPropInfoMethod
- method setPropInfoMethod
- method removePropInfoMethod
- attribute holderComp
- attribute holderItemProperties
- attribute propInfoMethod
- }
-
- constructor CBPropContainer {class this} {
- set this [PropContainer::constructor $class $this]
- $this propInfoMethod [Dictionary new]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method CBPropContainer::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this PropContainer::destructor
- }
-
- method CBPropContainer::existPropertyHolder {this} {
- if {[[$this holderItemProperties] isNil]} {
- return 0
- }
- return 1
- }
-
- method CBPropContainer::loadProperties {this} {
- # Not applicable !!
- }
-
- method CBPropContainer::quitProperties {this} {
- # Not applicable !!
- }
-
- method CBPropContainer::getPropertyValue {this name} {
- set info [$this [$this getPropInfoMethod $name]]
- if {![$info isNil]} {
- return [$info getPropertyValue $name]
- }
- return ""
- }
-
- method CBPropContainer::isPropertyEditable {this name} {
- return 0
- }
-
- method CBPropContainer::addSpecificPropDef {this def propInfoMethod} {
- $this addPropDefinition $def
- $this fillPropInfoMethod $def $propInfoMethod
- }
-
- method CBPropContainer::fillPropInfoMethod {this def propInfoMethod} {
- $this setPropInfoMethod [$def name] $propInfoMethod
- foreach member [$def memberSet] {
- $this fillPropInfoMethod $member $propInfoMethod
- }
- }
-
- method CBPropContainer::startLabel {this} {
- set holderComp [$this holderComp]
- if {![$holderComp isA Connector]} {
- return Start
- }
- set startComp [$holderComp from]
- set startItem [Component::getItem $startComp $LT_NAME]
- if {[$startItem isNil] || [$startItem name] == ""} {
- # need long name here !!
- return [$startComp type]
- }
- return [$startItem name]
- }
-
- method CBPropContainer::endLabel {this} {
- set holderComp [$this holderComp]
- if {![$holderComp isA Connector]} {
- return End
- }
- set endComp [$holderComp to]
- set endItem [Component::getItem $endComp $LT_NAME]
- if {[$endItem isNil] || [$endItem name] == ""} {
- # need long name here !!
- return [$endComp type]
- }
- return [$endItem name]
- }
-
- # Do not delete this line -- regeneration end marker
-
- method CBPropContainer::getPropInfoMethod {this name} {
- return [[$this propInfoMethod] set $name]
- }
-
- method CBPropContainer::setPropInfoMethod {this name newPropInfoMethod} {
- [$this propInfoMethod] set $name $newPropInfoMethod
- }
-
- method CBPropContainer::removePropInfoMethod {this name} {
- [$this propInfoMethod] unset $name
- }
-
-