home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
cobrenable.tcl
< prev
next >
Wrap
Text File
|
1997-10-10
|
3KB
|
133 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)cobrenable.tcl /main/titanic/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)cobrenable.tcl /main/titanic/4 10 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "enablepage.tcl"
Class CoBrEnablePage : {EnablePage} {
constructor
method destructor
method createInterface
method clearInterface
method sensitive
method fromInterface
method toInterface
}
constructor CoBrEnablePage {class this name} {
set this [EnablePage::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method CoBrEnablePage::destructor {this} {
# Start destructor user section
# End destructor user section
$this EnablePage::destructor
}
method CoBrEnablePage::createInterface {this} {
interface DlgRow $this.NG.DC.DR {
DlgColumn DC {
Label L { text "Selection count"}
OptionMenu selCountOM {
entrySet { "don't care" 0 1 many }
}
}
DlgColumn DC {
Label L { text "Check enable on"}
VerRadioGroup checkOn {
entrySet { "Nothing" "Selection change"
"Level change"}
}
}
}
interface DlgRow $this.NG.DC.DR {
DlgColumn DC {
Label L { text "Script for extra checking" }
MultiLineText enableMLT { }
}
}
}
method CoBrEnablePage::clearInterface {this} {
[$this if].selCountOM selected "don't care"
[$this if].checkOn selected "Nothing"
[$this if].enableMLT text ""
}
method CoBrEnablePage::sensitive {this args} {
if {[llength $args] == 0} {
return [[$this if].selCountOM sensitive]
} else {
set sensitive [lindex $args 0]
}
[$this if].selCountOM sensitive $sensitive
[$this if].checkOn sensitive $sensitive
[$this if].enableMLT sensitive $sensitive
return $sensitive
}
method CoBrEnablePage::fromInterface {this} {
set spec ""
set enableScript [[$this if].enableMLT text]
if ![CommandPage::checkBraces $enableScript] {
wmtkerror "Brace mismatch in enableScript"
return ""
}
set selCount [[$this if].selCountOM selected]
if {$selCount != "don't care"} {
lappend spec selCount $selCount
}
set checkOn [[$this if].checkOn selected]
if {$checkOn == "Selection change"} {
lappend spec checkOn selectionChange
} elseif {$checkOn == "Level change"} {
lappend spec checkOn levelChange
}
if {$enableScript != ""} {
lappend spec enableScript $enableScript
}
return $spec
}
method CoBrEnablePage::toInterface {this key value} {
if {$key == "selCount"} {
[$this if].selCountOM selected $value
}
if {$key == "checkOn"} {
if {$value == "levelChange"} {
[$this if].checkOn selected "Level change"
} elseif {$value == "selectionChange"} {
[$this if].checkOn selected "Selection change"
}
}
if {$key == "enableScript"} {
regsub -all "\n\t\t\t" $value "\n" value
[$this if].enableMLT text [string trim $value]
}
}
# Do not delete this line -- regeneration end marker