home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
witemuiobj.tcl
< prev
next >
Wrap
Text File
|
1996-11-07
|
4KB
|
148 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)witemuiobj.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)witemuiobj.tcl /main/titanic/2 7 Nov 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "browsuiobj.tcl"
Class WItemUiObj : {BrowsUiObj} {
constructor
method destructor
method definedItems
method initializeInfo
method moveDefinition
}
global WItemUiObj::uiClass
set WItemUiObj::uiClass "WorkItems"
constructor WItemUiObj {class this name} {
set this [BrowsUiObj::constructor $class $this $name]
# Start constructor user section
$this uiName "<defined items>"
$this uiText "defined items"
# End constructor user section
return $this
}
method WItemUiObj::destructor {this} {
# Start destructor user section
# End destructor user section
$this BrowsUiObj::destructor
}
proc WItemUiObj::associations {} {
return {definedItems}
}
proc WItemUiObj::childTypes {assoc} {
if {[lsearch -exact "[WItemUiObj::associations]" "$assoc"] == -1} {
return ""
}
set childTypes [BrowserProcs::childTypes $assoc]
case "$childTypes" in {
{DefinedItem} {
return "${BrowserProcs::itemTypes}"
}
{default} {
return "$childTypes"
}
}
}
method WItemUiObj::definedItems {this} {
set definedItems ""
foreach item [[$this parent] definedItems] {
if {"[$item scope]" == "scopePhaseRef"} continue
lappend definedItems $item
}
return $definedItems
}
proc WItemUiObj::infoProperties {} {
return [BrowserProcs::infoProperties]
}
method WItemUiObj::initializeInfo {this dummy} {
$this BrowsUiObj::initializeInfo $dummy
$this setInfo Text "[$this uiText] of [[$this parent] getInfo Text]"
}
method WItemUiObj::moveDefinition {this} {
set sysVList ""
set crntSysV [$this getParent SystemVersion]
set crntSysType [[$crntSysV system] type]
foreach sysV [[$this getParent PhaseVersion] getChildSet systemVersions] {
if {"$sysV" == "$crntSysV"} continue
if {"$crntSysType" != "[[$sysV system] type]"} continue
lappend sysVList $sysV
}
if [lempty $sysVList] {
wmtkinfo \
"There are no other [$crntSysV getInfo Type]s to move\
definitions to within the current PhaseVersion"
return
}
set typeSpec [getObjectSpec [$wmttoolObj objectHdlr] \
SystemVersion [$crntSysV getInfo Type] \
]
if {"$typeSpec" != ""} {
set icon [$typeSpec smallIcon]
} else {
set icon ""
}
set headerSpecList {
{Name 25 ascii {increasing 1}}
{Version 25 ascii {increasing 2}}
{Status 14 ascii {increasing 3}}
}
set objectSpecList ""
foreach sysV $sysVList {
lappend objectSpecList [list $icon \
[$sysV name] \
[$sysV versionName] \
[$sysV status] \
]
}
require "browsviewd.tcl"
set box $wmttoolObj.moveDefinition
ClassMaker::extend BrowsViewDialog MoveDefinitionBrowsViewDialog dbObj
MoveDefinitionBrowsViewDialog new $box \
-title "Move Definition" \
-message "Select [$crntSysV getInfo Type] to move definition(s) to" \
-headerSpecList $headerSpecList \
-objectSpecList $objectSpecList \
-objectList $sysVList \
-dbObj [$this parent] \
-cancelPressed {%this delete} \
-okPressed {
set dbObj [%this dbObj]
set confV [$dbObj getParent ConfigVersion]
set sysV [[lindex [[%this view] selectedSet] 0] object]
set script " $sysV removeUnusedDeclarations"
foreach obj [$wmttoolObj selectedObjSet] {
append script " ;"
append script " $dbObj moveDefinition $obj $confV $sysV"
}
$wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
}
[$box view] selectionPolicy BROWSE
$box popUp
}
# Do not delete this line -- regeneration end marker