home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
openbyname.tcl
< prev
next >
Wrap
Text File
|
1996-09-17
|
2KB
|
90 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)openbyname.tcl /main/hindenburg/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)openbyname.tcl /main/hindenburg/2 17 Sep 1996 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 \
-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 sysV [$ed systemVersion]
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 selected [rmWhiteSpace [$this text]]
set index [lsearch -exact [$this fileNameList] $selected]
if {$index == -1} {
busy {
set ed [$this editor]
wmtkmessage "Creating '$selected.$type'"
set sysV [$ed systemVersion]
set configV [$ed configVersion]
set type [$ed diagramType]
set itemType [file2itemtype $type]
set scopePhase [fileHasScopePhase $type]
set newFile [$sysV createFileVersion \
$selected $itemType $scopePhase \
$type graph $configV]
$ed doEdit $newFile
}
} else {
[$this editor] doEdit [lindex [$this filevList] $index]
}
}
# Do not delete this line -- regeneration end marker