home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
checkbrobj.tcl
< prev
next >
Wrap
Text File
|
1997-02-27
|
3KB
|
129 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)checkbrobj.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)checkbrobj.tcl /main/titanic/2 27 Feb 1997 Copyright 1994 Westmount Technology
# Start user added include file section
require classmaker.tcl
# End user added include file section
Class CheckBrObject : {BrowsObject} {
constructor
method destructor
method updateView
method newCheckValue
method define
attribute group
attribute configLevel
attribute checkValue
attribute prevCheckValues
}
constructor CheckBrObject {class this name} {
set this [BrowsObject::constructor $class $this $name]
# Start constructor user section
$this activated "$this define"
# End constructor user section
return $this
}
method CheckBrObject::destructor {this} {
# Start destructor user section
# End destructor user section
}
method CheckBrObject::updateView {this} {
set grpDesc ""
if [info exists groupArray([$this group])] {
set grpDesc "$groupArray([$this group])"
}
$this details "\"[$this configLevel]\" [$this checkValue] \"$grpDesc\""
}
method CheckBrObject::newCheckValue {this value} {
if {$value == [$this checkValue]} {return}
set prev [lindex [$this prevCheckValues] 0]
set curLevel [[ClientContext::global] currentLevel]
if {$value == "previous"} {
set value [lindex $prev 0]
if {$value == ""} {
return
}
}
if {$prev != "" && [lindex $prev 0] == $value &&
[$this configLevel] == $curLevel} {
# previous value matches the new value, 'remove' current
$this prevCheckValues [lrange [$this prevCheckValues] 1 end]
$this checkValue [lindex $prev 0]
$this configLevel [lindex $prev 1]
} else {
# 'make' new object, or change value
if {[$this configLevel] == $curLevel} {
$this checkValue $value
} else {
# save previous checkvalue, and configLevel
$this prevCheckValues "\{[$this checkValue] \"[$this configLevel]\"\} [$this prevCheckValues]"
$this checkValue $value
$this configLevel $curLevel
}
}
$this updateView
#[$this view] sortit
$this makeVisible
}
method CheckBrObject::define {this} {
if [[[$this view] checkDialog] readOnly] {
# no define if readOnly
return
}
set number [[[$this view] checkDialog] number]
set box .main.chckObjDlg$number
if {! [isCommand $box]} {
ClassMaker::extend TemplateDialog ChckObjDlg {CheckBrObject}
interface ChckObjDlg $box {
DlgColumn DC {
NamedGroup nameNG {
DlgRow DR {
spaceType EVEN
Label L {
text "Check value"
}
VerRadioGroup checkValueVRG {
entrySet {warning default error off previous}
}
}
}
}
}
$box okPressed {
set value [%this.DC.nameNG.DR.checkValueVRG selected]
[%this CheckBrObject] newCheckValue $value
}
$box helpPressed {.main helpOnName checkConfigValueDialog}
$box modal 1
}
$box CheckBrObject $this
$box title "Group: [$this label]"
set details [$this details]
$box.DC.nameNG.DR.checkValueVRG selected [lindex $details 1]
$box.DC.nameNG label "Description: [lindex $details 2]"
$box popUp
}
# Do not delete this line -- regeneration end marker