home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
mtfilemenu.tcl
< prev
next >
Wrap
Text File
|
1997-09-12
|
4KB
|
167 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)mtfilemenu.tcl /main/titanic/11
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)mtfilemenu.tcl /main/titanic/11 12 Sep 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class MTFileMenuProcs : {Object} {
constructor
method destructor
}
constructor MTFileMenuProcs {class this name} {
set this [Object::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method MTFileMenuProcs::destructor {this} {
# Start destructor user section
# End destructor user section
}
proc MTFileMenuProcs::reload {} {
busy {
wmtkmessage "Reloading ..."
# save current object info
set cur ""
if {[.main currentObj] != ""} {
set cur [[[.main currentObj] repObj] fromRepObj]
}
foreach elm [[.main navigView] rootSet] {
$elm delete
}
foreach elm [[.main infoView] objectSet] {
$elm delete
}
.main start
set parent [[.main navigView] rootSet]
if {$parent != "" && $cur != ""} {
foreach elm [MTFileMenuProcs::getChildren $parent] {
set obj [[$elm repObj] fromRepObj]
if {$obj == $cur} {
$elm open
break;
}
}
}
wmtkmessage "Done"
}
}
proc MTFileMenuProcs::getChildren {parent} {
set children [$parent childSet]
if {$children == ""} {
return ""
}
foreach child $children {
set children "$children [MTFileMenuProcs::getChildren $child]"
}
return $children
}
proc MTFileMenuProcs::openSource {} {
set obj [[lindex [.main selectedMergeObjSet] 0] fromRepObj]
if {[$obj isA GraphVDbObj] || [$obj isA MtrxVDbObj]} {
$obj showFile [.main fromCurContext]
} else {
$obj showFile
}
}
proc MTFileMenuProcs::openTarget {} {
set obj [[lindex [.main selectedMergeObjSet] 0] toRepObj]
if {[$obj status] == "working"} {
set action editFile
} else {
set action showFile
}
if {[$obj isA GraphVDbObj] || [$obj isA MtrxVDbObj]} {
$obj $action [.main toCurContext]
} else {
$obj $action
}
}
proc MTFileMenuProcs::showInfo {} {
set selObj [lindex [.main selectedMergeObjSet] 0]
set fromObj [$selObj fromRepObj]
set toObj [$selObj toRepObj]
# collect the info to be shown.
set info [$selObj getInfo]
if {$info == ""} {
wmtkinfo "No info available."
return
}
global classCount
set box .main.showObjectInfo$classCount
incr classCount
interface TemplateDialog $box {
title "Information"
DlgColumn col {}
okPressed {%this delete}
}
$box modal $win95
$box delCancelButton
$box delHelpButton
set len [llength $info]
for {set i 0} {$i < $len} {incr i 2} {
DlgRow new $box.col.row$i \
-spaceType NONE \
-justification RIGHT
Label new $box.col.row$i.header \
-text "[lindex $info $i]:" \
-alignment RIGHT \
-horStretchFactor 10 \
-justification TOP \
-font "courier-bold-12"
DlgColumn new $box.col.row$i.col
set breakUpCnt 0
set lineInfo [lindex $info [expr $i+1]]
foreach line [split $lineInfo "\n"] {
foreach part [lineBreak $line 49 " "] {
set text [format "%-49s" $part]
Label new $box.col.row$i.col.label$breakUpCnt \
-text $text \
-font "courier-normal-12"
incr breakUpCnt
}
}
}
$box popUp
}
proc MTFileMenuProcs::exitBrowser {} {
if {! [.main watchdogBusy]} {
.main WmtTool::stop
}
}
# Do not delete this line -- regeneration end marker