home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
menudefine.tcl
< prev
next >
Wrap
Text File
|
1997-10-23
|
4KB
|
149 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)menudefine.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)menudefine.tcl /main/titanic/2 23 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "defstoredi.tcl"
Class MenuDefineDialog : {DefStoreDialog} {
constructor
method destructor
method createInterface
method clearInterface
method sensitive
method save
method objVisible
}
constructor MenuDefineDialog {class this name} {
set this [DefStoreDialog::constructor $class $this $name]
# Start constructor user section
$this helpPressed \
".main helpOnName menuProp\[\[$this currentPage] label]Page"
# End constructor user section
return $this
}
method MenuDefineDialog::destructor {this} {
# Start destructor user section
# End destructor user section
$this DefStoreDialog::destructor
}
method MenuDefineDialog::createInterface {this} {
$this DefStoreDialog::createInterface
# add the visibility stuff
interface NamedGroup [$this sPage].visibleNG {
verStretchFactor 0
label Visible
DlgColumn DC {
CheckButton corporateCB { label Corporate}
CheckButton projectCB { label Project}
CheckButton configCB { label Configuration}
CheckButton phaseCB { label Phase}
CheckButton systemCB { label System}
}
}
}
method MenuDefineDialog::clearInterface {this} {
$this DefStoreDialog::clearInterface
[$this sPage].visibleNG.DC.corporateCB state 1
[$this sPage].visibleNG.DC.projectCB state 1
[$this sPage].visibleNG.DC.configCB state 1
[$this sPage].visibleNG.DC.phaseCB state 1
[$this sPage].visibleNG.DC.systemCB state 1
}
method MenuDefineDialog::sensitive {this args} {
$this DefStoreDialog::sensitive $args
if {[llength $args] == 0} {
return [[$this sPage].visibleNG.DC.corporateCB sensitive]
} else {
set sensitive [lindex $args 0]
}
[$this sPage].visibleNG.DC.corporateCB sensitive $sensitive
[$this sPage].visibleNG.DC.projectCB sensitive $sensitive
[$this sPage].visibleNG.DC.configCB sensitive $sensitive
[$this sPage].visibleNG.DC.phaseCB sensitive $sensitive
[$this sPage].visibleNG.DC.systemCB sensitive $sensitive
return $sensitive
}
method MenuDefineDialog::save {this popDown} {
if {![[$this curObject] editable]} {
if {$popDown == 1} {
$this popDown
}
return
}
set newLevel [$this determineSpecLevel [$this objScope]]
set error [[$this curObject] check [$this objScope] [$this objVisible]\
$newLevel [[$this curObject] parent]]
if {$error != ""} {
wmtkerror "$error : object not saved"
} else {
if {[$this DefineDialog::save $popDown] == 1} {
# reset redefined attribute
[$this curObject] redefined 0
}
}
}
method MenuDefineDialog::objVisible {this args} {
if {$args == ""} {
set vis "[[$this sPage].visibleNG.DC.corporateCB state]"
set vis "$vis [[$this sPage].visibleNG.DC.projectCB state]"
set vis "$vis [[$this sPage].visibleNG.DC.configCB state]"
set vis "$vis [[$this sPage].visibleNG.DC.phaseCB state]"
set vis "$vis [[$this sPage].visibleNG.DC.systemCB state]"
return $vis
} else {
set count 0
set args [lvarpop args]
foreach i $args {
if {$count == 0} {
[$this sPage].visibleNG.DC.corporateCB state $i
}
if {$count == 1} {
[$this sPage].visibleNG.DC.projectCB state $i
}
if {$count == 2} {
[$this sPage].visibleNG.DC.configCB state $i
}
if {$count == 3} {
[$this sPage].visibleNG.DC.phaseCB state $i
}
if {$count == 4} {
[$this sPage].visibleNG.DC.systemCB state $i
}
incr count
}
}
}
# Do not delete this line -- regeneration end marker