home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
represtmod.tcl
< prev
next >
Wrap
Text File
|
1997-11-28
|
3KB
|
109 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)represtmod.tcl /main/titanic/10
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)represtmod.tcl /main/titanic/10 28 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require "represtobj.tcl"
Class RepRestModelDialog : {RepRestObjDialog} {
constructor
method destructor
method browseObjects
method setOverwrite
method objType
method objDescription
method pressedOk
method restore
method restoreFinished
}
constructor RepRestModelDialog {class this name view} {
set this [RepRestObjDialog::constructor $class $this $name $view]
# Start constructor user section
$this config \
-title "Restore Single Model" \
-helpPressed "$view helpOnName restoreModel"
[$this dirLabel] text "From Model Directory\
(created by unarchive command)"
[$this nameLabel] text "New Model Name\
(taken from dump if not specified)"
[$this overwriteLabel] text "Overwrite Model\
(not overwritten if not specified)"
# End constructor user section
return $this
}
method RepRestModelDialog::destructor {this} {
# Start destructor user section
# End destructor user section
$this RepRestObjDialog::destructor
}
method RepRestModelDialog::browseObjects {this} {
set dlg [$this view].selectrestmodelbrowser
if ![isCommand $dlg] {
RepModelBrowser new $dlg [$this view] \
-okPressed "$this setOverwrite \[%this selectedObject]"
}
$dlg popUp
}
method RepRestModelDialog::setOverwrite {this model} {
[$this overwriteField] text "[$model name].[$model type]"
$this checkOverwrite old
$this checkOk
}
method RepRestModelDialog::objType {this} {
return "Model"
}
method RepRestModelDialog::objDescription {this} {
return "model '[[$this nameField] text]'"
}
method RepRestModelDialog::pressedOk {this} {
$this RepRestObjDialog::pressedOk
}
method RepRestModelDialog::restore {this dbInfo} {
upvar $dbInfo info
set rep [[$this view] rep]
set opts {}
set modelDir [[$this dirField] text]
# Only one of newName and overwriteName can ever be specified.
#
set nt [splitFileName [[$this nameField] text]]
set newName [lindex $nt 0]
set overwriteName [[$this overwriteField] text]
if [string length $overwriteName] {
set nt [splitFileName $overwriteName]
set newName [lindex $nt 0]
append opts " -o"
}
return [$rep restoreObject "$this restoreFinished" info $opts \
"model" $modelDir $newName]
}
method RepRestModelDialog::restoreFinished {this exitCode} {
$this RepRestObjDialog::restoreFinished $exitCode
}
# Do not delete this line -- regeneration end marker