home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
opencdmdlg.tcl
< prev
next >
Wrap
Text File
|
1996-11-22
|
3KB
|
127 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)opencdmdlg.tcl /main/hindenburg/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)opencdmdlg.tcl /main/hindenburg/3 22 Nov 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "browsviewd.tcl"
Class OpenCdmDlg : {BrowsViewDialog} {
constructor
method destructor
method open
method popUp
attribute editable
attribute cdm
attribute confV
attribute phaseV
attribute sysV
}
constructor OpenCdmDlg {class this name} {
set this [BrowsViewDialog::constructor $class $this $name]
# Start constructor user section
$this config \
-message "Select CAD to open" \
-headerSpecList {
{Name 25 ascii {increasing 2}}
{System 20 ascii {increasing 1}}
{Version 20 ascii {increasing 3}}
{Status 14 ascii {increasing 4}}
} \
-cancelPressed {%this delete} \
-okPressed {
%this open [[lindex [[%this view] selectedSet] 0] object]
%this delete
}
[$this view] selectionPolicy BROWSE
# End constructor user section
return $this
}
method OpenCdmDlg::destructor {this} {
# Start destructor user section
# End destructor user section
$this BrowsViewDialog::destructor
}
method OpenCdmDlg::open {this cad} {
if {[$cad getInfo "In Corporate"] == "Yes" ||
[$cad getInfo Status] != "working"} {
set action showFile
} else {
set action editFile
}
set confV [$this confV]
set phaseV [$this phaseV]
set sysV [[$cad system] selectedVersion $confV]
$cad $action $confV $phaseV $sysV
}
method OpenCdmDlg::popUp {this} {
set cdm [$this cdm]
if {"[$this confV]" == ""} {
$this confV [$cdm getParent ConfigVersion]
}
if {"[$this phaseV]" == ""} {
$this phaseV [$cdm getParent PhaseVersion]
}
if {"[$this sysV]" == ""} {
$this sysV [$cdm getParent SystemVersion]
}
set item [[$cdm file] item]
[$this sysV] getDecompositions \
$item [$this confV] decompComponents cad decompSystems decompFiles
set nrOfFiles [llength $decompFiles]
if {$nrOfFiles == 0} {
return [list 0 "No CAD's exist in which class '[$item name]' occurs"]
}
if {$nrOfFiles == 1} {
$this open [lindex $decompFiles 0]
return {0 ""}
}
set typeSpec [getObjectSpec [.main objectHdlr] Graph cad]
if {"$typeSpec" != ""} {
set icon [$typeSpec smallIcon]
} else {
set icon ""
}
set objectSpecList ""
foreach decompFile $decompFiles {
lappend objectSpecList [list $icon \
[[$decompFile file] qualifiedName :] \
[[$decompFile system] name] \
[$decompFile versionName] \
[$decompFile status] \
]
}
if [$this editable] {
set title "Edit"
} else {
set title "Show"
}
append title " CDM"
$this config \
-title $title \
-objectSpecList $objectSpecList \
-objectList $decompFiles
$this BrowsViewDialog::popUp
return 1
}
# Do not delete this line -- regeneration end marker