home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
custfvuiob.tcl
< prev
next >
Wrap
Text File
|
1996-11-08
|
7KB
|
246 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)custfvuiob.tcl /main/hindenburg/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)custfvuiob.tcl /main/hindenburg/3 8 Nov 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
require "browsuiobj.tcl"
Class CustFVUiObj : {BrowsUiObj} {
constructor
method destructor
method addCustomFileV
method customFileVersions
method deselectObjects
method initializeInfo
method newObjects
method printObjects
method removeObjects
method selectObject
}
global CustFVUiObj::uiClass
set CustFVUiObj::uiClass "CustomFileVersions"
constructor CustFVUiObj {class this name} {
set this [BrowsUiObj::constructor $class $this $name]
# Start constructor user section
$this uiName "<customization files>"
$this uiText "customization file versions"
# End constructor user section
return $this
}
method CustFVUiObj::destructor {this} {
# Start destructor user section
# End destructor user section
$this BrowsUiObj::destructor
}
method CustFVUiObj::addCustomFileV {this} {
foreach childType [CustFVUiObj::customFileVersionNames] {
set customFileList($childType) 1
}
foreach customFileV [$this getChildSet customFileVersions] {
set customFile [$customFileV customFile]
set name [$customFile name]
set type [$customFile type]
if {"$type" != ""} {
append name ".$type"
}
if [info exists customFileList($name)] {
unset customFileList($name)
}
}
if [info exists customFileList] {
set entrySet [lsort [array names customFileList]]
} else {
set entrySet ""
}
require "editseldia.tcl"
set box $wmttoolObj.newCustfileV
ClassMaker::extend EditSelDialog NewCustfileVEditSelDialog dbObj
NewCustfileVEditSelDialog new $box \
-title "New Customization File Version" \
-message "Customization File:" \
-entrySet $entrySet \
-dbObj [$this getParent CustomLevelVersion] \
-okPressed {
set file [%this text]
set selection [splitFileName $file]
set name [lindex $selection 0]
set type [lindex $selection 1]
set script "global CustFVUiObj:custFV"
append script " ;"
append script " set CustFVUiObj:custFV \[CustFileUtilities::make \
[%this dbObj] [list $name] [list $type] \
\]"
require "custfileut.tcl"
$wmttoolObj startCommand tcl \
"$script" "" \
"Creating customization file version '$file'" \
{1 0} 1
%this delete
} \
-editPressed {
if [info exists CustFVUiObj:custFV] {
${CustFVUiObj:custFV} editFile
}
}
$box popUp
}
proc CustFVUiObj::associations {} {
return {customFileVersions}
}
proc CustFVUiObj::childTypes {assoc} {
if {[lsearch -exact "[CustFVUiObj::associations]" "$assoc"] == -1} {
return ""
}
set childTypes [BrowserProcs::childTypes $assoc]
case "$childTypes" in {
{CustomFileVersion} {
return {
mnu objtype opendefs openlocs pnl propdefs proplocs
roundtrip vie
}
}
{default} {
return "$childTypes"
}
}
}
proc CustFVUiObj::customFileVersionNames {} {
return {
cad.mnu cad.pnl ccd.mnu ccd.pnl checkconfig class.mnu desk.mnu
desk.vie dfd.mnu dfd.pnl diagram.mnu etd.mnu etd.pnl mgd.mnu
mgd.pnl m4env objtype.objtype opendefs.opendefs openlocs.openlocs
propdefs.propdefs proplocs.proplocs roundtrip.roundtrip std.mnu std.pnl
ucd.mnu ucd.pnl
}
}
method CustFVUiObj::customFileVersions {this} {
return [[$this parent] customFileVersions]
}
method CustFVUiObj::deselectObjects {this} {
set custlvlV [$this getParent CustomLevelVersion]
set script ""
foreach obj [$wmttoolObj selectedObjSet] {
if {"$script" != ""} {
append script " ;"
}
append script " $custlvlV deselectVersion $obj"
}
$wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
}
proc CustFVUiObj::infoProperties {} {
return [BrowserProcs::infoProperties]
}
method CustFVUiObj::initializeInfo {this dummy} {
$this BrowsUiObj::initializeInfo $dummy
$this setInfo Text "[$this uiText] of [[$this parent] getInfo Text]"
}
method CustFVUiObj::newObjects {this} {
set custlvlV [$this getParent CustomLevelVersion]
set script ""
foreach obj [$wmttoolObj selectedObjSet] {
if {"$script" != ""} {
append script " ;"
}
append script " $custlvlV derive $obj"
}
$wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
}
method CustFVUiObj::printObjects {this} {
set asciiFiles ""
foreach obj [$wmttoolObj selectedObjSet] {
set tmpFile [args_file {}]
$obj downLoad $tmpFile
lappend asciiFiles $tmpFile
}
BrowserProcs::printObjects $asciiFiles "" "" 1
}
method CustFVUiObj::removeObjects {this} {
set box $wmttoolObj.removeWarning
ClassMaker::extend WarningDialog RemoveObjectsWarningDialog dbObj
RemoveObjectsWarningDialog new $box \
-title "Delete Warning" \
-message [BrowserProcs::removeMessage] \
-dbObj [$this getParent CustomLevelVersion] \
-helpPressed {.main helpOnName removeWarning} \
-cancelPressed {%this delete} \
-okPressed {
set dbObj [%this dbObj]
set script ""
foreach obj [$wmttoolObj selectedObjSet] {
if {"$script" != ""} {
append script " ;"
}
append script " $dbObj remove $obj"
}
$wmttoolObj startCommand tcl "$script" "" "" {1 0} 1
%this delete
}
$box popUp
}
method CustFVUiObj::selectObject {this mode} {
set custlvlV [$this getParent CustomLevelVersion]
set versionList ""
foreach custFV [$custlvlV customFileVersions] {
set workingList([$custFV customFile]) $custFV
}
case "$mode" in {
{new} {
set custFList ""
foreach custF [[$custlvlV customLevel] customFiles] {
if [info exists workingList($custF)] continue
lappend custFList $custF
}
}
{default} {
set custFList ""
foreach obj [$wmttoolObj selectedObjSet] {
lappend custFList [$obj customFile]
}
}
}
foreach custF $custFList {
set custFName [$custF name]
if [info exists workingList($custF)] {
set working $workingList($custF)
} else {
set working [ORB::nil]
}
foreach version [$custF customFileVersions] {
if [$version isSame $working] continue
if {"[$version status]" == "working"} continue
lappend versionList [list $version "$custFName"]
}
}
BrowserProcs::selectObject $custlvlV $versionList $mode
}
# Do not delete this line -- regeneration end marker