home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
rwaccessro.tcl
< prev
next >
Wrap
Text File
|
1996-12-17
|
3KB
|
92 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)rwaccessro.tcl /main/hindenburg/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)rwaccessro.tcl /main/hindenburg/2 17 Dec 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
require "propifelem.tcl"
# End user added include file section
require "propinterf.tcl"
Class RWAccessRow : {PropInterface} {
method destructor
constructor
method getProperty
method getProperties
method setProperties
method setValue
method getValue
attribute writeAcc
attribute readAcc
}
method RWAccessRow::destructor {this} {
# Start destructor user section
# End destructor user section
$this PropInterface::destructor
}
constructor RWAccessRow {class this guiParent propDef} {
set this [PropInterface::constructor $class $this]
set grp [NamedGroup new $guiParent.[$propDef name]Group \
-verStretchFactor 0 -label [$propDef longName]]
set row [DlgRow new $grp.[$propDef name]Row]
set rcol [DlgColumn new $row.[$propDef name]ReadColumn]
set wcol [DlgColumn new $row.[$propDef name]WriteColumn]
Label new $rcol.OptMnuLab -text Read
Label new $wcol.OptMnuLab -text Write
$this config -definition $propDef -ifElement $grp \
-readAcc [eval OptionMenu new $rcol.OptMnu [$propDef ifOptions]] \
-writeAcc [eval OptionMenu new $wcol.OptMnu [$propDef ifOptions]]
return $this
}
method RWAccessRow::getProperty {this elm value sensitive} {
if {$value == ""} {
set value [PropIfElement::defaultValue "OptionMenu" $elm]
}
$elm selected $value
$elm sensitive $sensitive
}
method RWAccessRow::getProperties {this propContainer} {
set key [[$this definition] name]
set value [$propContainer getPropertyValue $key]
set sensitive [$propContainer isPropertyEditable $key]
$this setValue $value $sensitive
}
method RWAccessRow::setProperties {this propContainer} {
set key [[$this definition] name]
set rDef [PropIfElement::defaultValue "OptionMenu" [$this readAcc]]
set wDef [PropIfElement::defaultValue "OptionMenu" [$this writeAcc]]
$propContainer changeProperty $key "[$this getValue]" "${rDef}-$wDef"
}
method RWAccessRow::setValue {this value {sensitive 1}} {
set rVal ""
set wVal ""
if {"$value" != ""} {
set sep [string last "-" $value]
set rVal [string range $value 0 [expr $sep - 1]]
set wVal [string range $value [expr $sep + 1] end]
}
$this getProperty [$this readAcc] $rVal $sensitive
$this getProperty [$this writeAcc] $wVal $sensitive
}
method RWAccessRow::getValue {this} {
return "[[$this readAcc] selected]-[[$this writeAcc] selected]"
}
# Do not delete this line -- regeneration end marker