home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
defstoredi.tcl
< prev
next >
Wrap
Text File
|
1997-03-14
|
9KB
|
318 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)defstoredi.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)defstoredi.tcl /main/titanic/2 14 Mar 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "definedial.tcl"
Class DefStoreDialog : {DefineDialog} {
method destructor
constructor
method createInterface
method clearInterface
method sensitive
method setPossibleScope
method objScope
method objReadOnly
method cancelled
method getPhase
method setPhase
method removePhase
attribute sPage
attribute phase
}
method DefStoreDialog::destructor {this} {
# Start destructor user section
# End destructor user section
$this DefineDialog::destructor
}
constructor DefStoreDialog {class this name} {
set this [DefineDialog::constructor $class $this $name]
return $this
}
method DefStoreDialog::createInterface {this} {
#indentation of this function is 4 spaces to make it easier to read
# read phases file
$this phase [Dictionary new]
getPhases
$this cancelPressed "$this cancelled"
# create "storage" page
set page $this.storageNBP
interface NoteBkPage $page {
label Storage
DlgRow NG {
DlgColumn DC {
NamedGroup NG1 {
verStretchFactor 0
label Scope
DlgColumn DC {
Label L1 { text Project }
SingleLineText projectSLT {}
Label L2 { text Configuration }
SingleLineText configSLT {}
NamedGroup NG1 {
label Phase
DlgRow DR {}
}
NamedGroup NG2 {
label System
DlgRow DR {
DlgColumn DC {
CheckButton SysCB {
label system
}
CheckButton DocCB {
label document
}
}
}
}
}
}
NamedGroup NG2 {
verStretchFactor 0
DlgRow DR {
CheckButton readOnlyCB {
label "Read Only"
}
}
}
}
}
}
$this sPage $page.NG.DC
set count 0
set phasesRow [$this sPage].NG1.DC.NG1.DR
foreach phase ${BrowserProcs::phases} {
set phaseType [lindex $phase 1]
if [[$this phase] exists "$phaseType"] continue
if {[expr $count % 2] == 0} {
set DC [DlgColumn new $phasesRow.DC$count]
}
$this setPhase "$phaseType" \
[CheckButton new $DC.CB$count -label "$phaseType"]
incr count 1
}
$page lowered "$this checkLevelChanged"
}
method DefStoreDialog::clearInterface {this} {
# clean page "Storage"
[$this sPage].NG1.DC.projectSLT text ""
[$this sPage].NG1.DC.configSLT text ""
foreach CB [[$this phase] values] {
$CB state 0
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB state 0
[$this sPage].NG1.DC.NG2.DR.DC.DocCB state 0
[$this sPage].NG2.DR.readOnlyCB state 0
}
method DefStoreDialog::sensitive {this args} {
if {[llength $args] == 0} {
return [[$this sPage].NG1.DC.projectSLT]
} else {
set sensitive [lindex $args 0]
}
[$this sPage].NG1.DC.projectSLT sensitive $sensitive
[$this sPage].NG1.DC.configSLT sensitive $sensitive
foreach CB [[$this phase] values] {
$CB sensitive $sensitive
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive $sensitive
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive $sensitive
[$this sPage].NG2.DR.readOnlyCB sensitive $sensitive
return $sensitive
}
method DefStoreDialog::setPossibleScope {this} {
[$this sPage].NG1.DC.projectSLT sensitive 0
[$this sPage].NG1.DC.configSLT sensitive 0
foreach CB [[$this phase] values] {
$CB sensitive 0
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive 0
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive 0
case "[[.main editorArea] _level]" in {
{corporate user} {
[$this sPage].NG1.DC.projectSLT sensitive 1
[$this sPage].NG1.DC.configSLT sensitive 1
foreach CB [[$this phase] values] {
$CB sensitive 1
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive 1
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive 1
}
{project} {
[$this sPage].NG1.DC.configSLT sensitive 1
foreach CB [[$this phase] values] {
$CB sensitive 1
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive 1
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive 1
}
{config} {
foreach CB [[$this phase] values] {
$CB sensitive 1
}
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive 1
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive 1
}
{phase} {
[$this sPage].NG1.DC.NG2.DR.DC.SysCB sensitive 1
[$this sPage].NG1.DC.NG2.DR.DC.DocCB sensitive 1
}
{system} {
# nothing can be changed (always this specific system)
}
}
}
method DefStoreDialog::objScope {this args} {
#indentation of this function is 4 spaces to make it easier to read
if {$args == ""} {
set scope "\{[[$this sPage].NG1.DC.projectSLT text]\}"
set scope "$scope \{[[$this sPage].NG1.DC.configSLT text]\}"
set phase {}
set phaseCount 0
[$this phase] foreach phaseType CB {
if [$CB state] {
lappend phase "$phaseType"
incr phaseCount
}
}
if {$phaseCount == [[$this phase] size]} {
set phase "*"
}
set scope "$scope \{$phase\}"
set system {}
set systemCount 0
if [[$this sPage].NG1.DC.NG2.DR.DC.SysCB state] {
lappend system [[$this sPage].NG1.DC.NG2.DR.DC.SysCB label]
incr systemCount
}
if [[$this sPage].NG1.DC.NG2.DR.DC.DocCB state] {
lappend system [[$this sPage].NG1.DC.NG2.DR.DC.DocCB label]
incr systemCount
}
if {$systemCount == 2} {
set system "*"
}
set scope "$scope \{$system\}"
set retScope ""
set scopeLength -1
set index 0
foreach i $scope {
if {[llength $i] > 1} {
if {$retScope == ""} {
set retScope "\{$i\}"
} else {
set retScope "$retScope \{$i\}"
}
set scopeLength $index
} elseif [lempty $i] {
# no spec means "*"
set retScope "$retScope *"
} else {
if {$retScope == ""} {
set retScope "$i"
} else {
set retScope "$retScope $i"
}
set scopeLength $index
}
incr index
}
return [lrange $retScope 0 $scopeLength]
} else {
set argc 0
set args [lvarpop args]
foreach i $args {
if {$argc == 0} {
[$this sPage].NG1.DC.projectSLT text $i
}
if {$argc == 1} {
[$this sPage].NG1.DC.configSLT text $i
}
if {$argc == 2} {
if {[lsearch $i "\\*"] != -1} {
foreach CB [[$this phase] values] {
$CB state 1
}
} else {
[$this phase] foreach phaseType CB {
if {[lsearch $i "$phaseType"] != -1} {
$CB state 1
}
}
}
}
if {$argc == 3} {
if {[lsearch $i "\\*"] != -1} {
[$this sPage].NG1.DC.NG2.DR.DC.SysCB state 1
[$this sPage].NG1.DC.NG2.DR.DC.DocCB state 1
continue
} else {
set obj [$this sPage].NG1.DC.NG2.DR.DC.SysCB
if {[lsearch $i [$obj label]] != -1} {
$obj state 1
}
set obj [$this sPage].NG1.DC.NG2.DR.DC.DocCB
if {[lsearch $i [$obj label]] != -1} {
$obj state 1
}
}
}
incr argc
}
}
}
method DefStoreDialog::objReadOnly {this args} {
if {$args == ""} {
return [[$this sPage].NG2.DR.readOnlyCB state]
} else {
[$this sPage].NG2.DR.readOnlyCB state $args
}
}
method DefStoreDialog::cancelled {this} {
# if cancelled, and the object was redefined, remove the object
if {[[$this curObject] redefined] == 1} {
[$this curObject] delete
}
}
# Do not delete this line -- regeneration end marker
method DefStoreDialog::getPhase {this phaseType} {
return [[$this phase] set $phaseType]
}
method DefStoreDialog::setPhase {this phaseType newPhase} {
[$this phase] set $phaseType $newPhase
}
method DefStoreDialog::removePhase {this phaseType} {
[$this phase] unset $phaseType
}