home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
cbpropdefi.tcl
< prev
next >
Wrap
Text File
|
1996-06-11
|
2KB
|
87 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)cbpropdefi.tcl /main/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cbpropdefi.tcl /main/2 11 Jun 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
require "propifdefs.tcl"
# End user added include file section
Class CBPropDefinition : {PropDefinition} {
constructor
method destructor
method promoter
method initDefaultValue
method getDefaultValue
method getDefaultValueFromEntrySet
attribute defaultValue
}
constructor CBPropDefinition {class this} {
set this [PropDefinition::constructor $class $this]
# Start constructor user section
$this initDefaultValue
# End constructor user section
return $this
}
method CBPropDefinition::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CBPropDefinition::promoter {this} {
$this initDefaultValue
}
selfPromoter PropDefinition {this} {
CBPropDefinition promote $this
}
method CBPropDefinition::initDefaultValue {this} {
$this defaultValue [$this getDefaultValue]
}
method CBPropDefinition::getDefaultValue {this} {
set ifClass [$this ifClass]
set ifOptions [$this ifOptions]
if {$ifClass == "" || $ifOptions == ""} {
return ""
}
global hasEntrySet defIndex
if {[info exists defIndex($ifClass)]} {
set defIdx $defIndex($ifClass)
if {[info exists hasEntrySet($ifClass)]} {
return [$this getDefaultValueFromEntrySet \
$ifOptions $defIdx]
}
return "$defIdx"
}
# Handle very special case
if {$ifClass == "RWAccessRow"} {
set def [$this getDefaultValueFromEntrySet $ifOptions 0]
return "${def}-$def"
}
return ""
}
method CBPropDefinition::getDefaultValueFromEntrySet {this ifOptions defIdx} {
set optList [concat $ifOptions]
set idx [lsearch -exact $optList -entrySet]
if {$idx != -1} {
incr idx
return [lindex [lindex $optList $idx] $defIdx]
}
return ""
}
# Do not delete this line -- regeneration end marker