home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
definedial.tcl
< prev
next >
Wrap
Text File
|
1996-05-29
|
4KB
|
196 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)definedial.tcl 1.14
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)definedial.tcl 1.14 22 Dec 1995 Copyright 1994 Westmount Technology
# Start user added include file section
# End user added include file section
Class DefineDialog : {NoteBkDialog} {
constructor
method destructor
method load
method save
method toInterface
method fromInterface
method determineSpecLevel
method setPossibleScope
method checkLevelChanged
method levelChanged
method popUp
method objScope
method objName
method objReadOnly
method objVisible
attribute curObject
attribute curObjectActiveLevel
}
constructor DefineDialog {class this name} {
set this [NoteBkDialog::constructor $class $this $name]
# Start constructor user section
$this createInterface
$this okPressed {%this save 1}
$this applyNowPressed {%this save 0}
$this curObjectActiveLevel -1
$this modal 1
$this autoPopDown 0
# End constructor user section
return $this
}
method DefineDialog::destructor {this} {
# Start destructor user section
# End destructor user section
}
method DefineDialog::load {this object} {
$this curObject $object
$this clearInterface
$this objScope [$object scope]
$this objVisible [$object visible]
$this objReadOnly [$object readOnly]
$this objName [$object displayName]
$this setPossibleScope
$this checkLevelChanged
set spec [$object objSpec]
while {![lempty $spec]} {
$this toInterface [lvarpop spec] [lvarpop spec]
}
$this title "[$object type] '[$object displayName]'"
$this popUp
}
method DefineDialog::save {this popDown} {
set spec [$this fromInterface]
if {$spec == ""} {
# something was wrong in the specification
# do not save
return 0
}
set obj [$this curObject]
$obj scope [$this objScope]
$obj visible [$this objVisible]
$obj readOnly [$this objReadOnly]
$obj displayName [$this objName]
$obj objSpec $spec
$obj updateView
[.main editorArea] isChanged 1
if {$popDown == 1} {
$this popDown
}
return 1
}
method DefineDialog::toInterface {this key value} {
}
method DefineDialog::fromInterface {this} {
return ""
}
method DefineDialog::determineSpecLevel {this scope} {
set index 0
if {[[.main editorArea] _level] == "user"} {
return "user"
}
foreach i $scope {
if {$i == "*" || [llength $i] != 1} {
break
}
incr index
}
return $icaseLevel($index)
}
method DefineDialog::setPossibleScope {this} {
}
method DefineDialog::checkLevelChanged {this} {
set level 0
foreach i [$this objScope] {
if [lempty $i] {
break;
}
incr level
}
if {$level != [$this curObjectActiveLevel]} {
$this levelChanged $level
$this curObjectActiveLevel $level
}
}
method DefineDialog::levelChanged {this newLevel} {
}
method DefineDialog::popUp {this} {
$this NoteBkDialog::popUp
}
method DefineDialog::objScope {this args} {
if {$args == ""} {
return ""
} else {
# set nothing
}
}
method DefineDialog::objName {this args} {
if {$args == ""} {
return "Unknown"
} else {
# set nothing
}
}
method DefineDialog::objReadOnly {this args} {
if {$args == ""} {
return 0
} else {
# set nothing
}
}
method DefineDialog::objVisible {this args} {
if {$args == ""} {
return {1 1 1 1 1}
} else {
# set nothing
}
}
# Do not delete this line -- regeneration end marker