home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
rwaccessro.tcl
< prev
next >
Wrap
Text File
|
1997-02-21
|
3KB
|
93 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)rwaccessro.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)rwaccessro.tcl /main/titanic/3 21 Feb 1997 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} {
set ifOpts [[$this definition] ifOptions]
if {$value == ""} {
set value [PropIfElement::defaultValue OptionMenu $ifOpts]
}
$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 ifOpts [[$this definition] ifOptions]
set def [PropIfElement::defaultValue OptionMenu $ifOpts]
$propContainer changeProperty $key "[$this getValue]" "${def}-$def"
}
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