home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
openbyname.tcl
< prev
next >
Wrap
Text File
|
1997-07-23
|
3KB
|
93 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)openbyname.tcl /main/titanic/5
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)openbyname.tcl /main/titanic/5 23 Jul 1997 Copyright 1994 Westmount Technology
# Start user added include file section
if {[info commands SelectionDialog] == ""} {
require pcsel.tcl
}
# End user added include file section
Class OpenByName : {SelectionDialog} {
constructor
method destructor
method popUp
method handleOk
attribute filevList
attribute fileNameList
attribute editor
}
constructor OpenByName {class this name} {
set this [SelectionDialog::constructor $class $this $name]
# Start constructor user section
$this config -okPressed {%this handleOk} \
-helpPressed {.main helpOnName openByName} \
-rowCount 10 \
-modal $win95 \
-message "Select diagram to open:" \
-title "Open By Name"
# End constructor user section
return $this
}
method OpenByName::destructor {this} {
# Start destructor user section
# End destructor user section
}
method OpenByName::popUp {this} {
set ed [$this editor]
set cc [ClientContext::global]
set sysV [$cc currentSystem]
set type [$ed diagramType]
set fileVersions [$sysV localFileVersions]
set myTypeFileList ""
set myTypeNameList ""
foreach fv $fileVersions {
if {[[$fv file] type] == "$type"} {
lappend myTypeFileList $fv
lappend myTypeNameList [[$fv file] name]
}
}
$this filevList $myTypeFileList
$this fileNameList $myTypeNameList
$this entrySet [lsort $myTypeNameList]
$this SelectionDialog::popUp
}
method OpenByName::handleOk {this} {
set ed [$this editor]
set cc [ClientContext::global]
set selected [rmWhiteSpace [$this text]]
set index [lsearch -exact [$this fileNameList] $selected]
if {$index == -1} {
busy {
wmtkmessage "Creating '$selected.$type'"
set sysV [$cc currentSystem]
set configV [$cc currentConfig]
set type [$ed diagramType]
set itemType [file2itemtype $type]
set scopePhase [fileHasScopePhase $type]
set newFile [$sysV createFileVersion \
$selected $itemType $scopePhase \
$type graph $configV]
}
} else {
set newFile [lindex [$this filevList] $index]
}
$ed doEdit [$cc createPath $newFile]
}
# Do not delete this line -- regeneration end marker