home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
modelunres.tcl
< prev
next >
Wrap
Text File
|
1997-11-28
|
3KB
|
129 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)modelunres.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)modelunres.tcl /main/titanic/3 28 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require procs.tcl
# End user added include file section
Class ModelUnreserveDialog : {TemplateDialog} {
constructor
method destructor
method popUp
method ok
method cancel
attribute model
}
constructor ModelUnreserveDialog {class this name} {
set this [TemplateDialog::constructor $class $this $name]
# Start constructor user section
$this config \
-title "Unreserve Model" \
-modal 1 \
-okPressed "busy { $this ok }"
interface DlgColumn $this.top {
Label l {
text "Release the reservation:"
}
}
set lineCnt 0
foreach header {"Reserved At" "By" "Comments"} {
set row [DlgRow new $this.top.row$lineCnt \
-spaceType NONE \
-justification RIGHT]
Label new $row.label \
-text "$header:" \
-alignment RIGHT \
-justification TOP \
-horStretchFactor 10 \
-font "courier-bold-12"
DlgColumn new $row.col
incr lineCnt
}
# End constructor user section
return $this
}
method ModelUnreserveDialog::destructor {this} {
# Start destructor user section
# End destructor user section
}
method ModelUnreserveDialog::popUp {this} {
set model [$this model]
set lineCnt 0
foreach header {"Reserved At" "By" "Comments"} {
set col $this.top.row$lineCnt.col
foreach element [$col childSet] {
$element delete
}
case "$header" in {
{"Reserved At"} {
set info [clock format [$model reserveTime]]
}
{By} {
set info [$model reserveUser]
}
{Comments} {
set info [$model reserveComments]
}
}
set breakUpCnt 0
foreach line [split $info "\n"] {
foreach part [lineBreak $line 35 " "] {
set text [format "%-35s" $part]
Label new $col.label$breakUpCnt \
-text $text \
-font "courier-normal-12"
incr breakUpCnt
}
}
incr lineCnt
}
$this TemplateDialog::popUp
}
method ModelUnreserveDialog::ok {this} {
set model [$this model]
set error ""
catch {$model unreserve} error
# Cannot alter existing dialog on PC
if $win95 {
$this delete
}
if ![lempty $error] {
wmtkerror $error
}
}
method ModelUnreserveDialog::cancel {this} {
# Cannot alter existing dialog on PC
if $win95 {
$this delete
}
}
# Do not delete this line -- regeneration end marker