home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
textrefsec.tcl
< prev
next >
Wrap
Text File
|
1997-01-02
|
3KB
|
117 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)textrefsec.tcl /main/titanic/2
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)textrefsec.tcl /main/titanic/2 2 Jan 1997 Copyright 1994 Westmount Technology
# Start user added include file section
# End user added include file section
require_module_file "filerefsec.tcl" docwriter
Class TextRefSection : {FileRefSection} {
constructor
method destructor
method isDocDirUpToDate
method show
method print
method preview
method updateDocDir
}
constructor TextRefSection {class this name document} {
set this [FileRefSection::constructor $class $this $name $document]
# Start constructor user section
# End constructor user section
return $this
}
method TextRefSection::destructor {this} {
# Start destructor user section
# End destructor user section
$this FileRefSection::destructor
}
method TextRefSection::isDocDirUpToDate {this} {
# do not update if document is frozen
if {"[[$this document] getInfo Status]" == "frozen"} {
return 1
}
# if the timestamp of the docLocation is > then the
# one of the location the section is up to date
if {! [file exists [$this docLocation]]} {
return 0
}
set fileV [$this referredFileVersion]
if [$fileV isNil] {
return 0
}
if [catch {set path [$fileV path]} msg] {
# fileV must be frozen, so take the update time
# this can be done with the regular (base) method
return [$this FileRefSection::isDocDirUpToDate]
} else {
file stat [$this docLocation] destination
file stat [$fileV path] source
if {$source(mtime) > $destination(mtime)} {
return 0
}
}
return 1
}
method TextRefSection::show {this} {
set cmd [list viewer [$this docLocation] [$this uiName]]
$this execute "$cmd" m4
}
method TextRefSection::print {this} {
set cmd [list \
"[m4_var get M4_a_printer] [$this docLocation]" \
[$this uiName] \
]
$this execute "$cmd"
}
method TextRefSection::preview {this} {
set cmd [list previewer [$this docLocation] [$this uiName]]
$this execute "$cmd" m4
}
method TextRefSection::updateDocDir {this} {
set fileV [$this referredFileVersion]
if [$fileV isNil] {
return 0
}
case "[$fileV status]" in {
{backGround} {
$fileV activate
$fileV downLoadFrozenContents [$this docLocation]
$fileV deactivate
}
{frozen reused} {
$fileV downLoadFrozenContents [$this docLocation]
}
{default} {
copy_text_file [$fileV path] [$this docLocation]
}
}
return 1
}
# Do not delete this line -- regeneration end marker