home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)textrefsec.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)textrefsec.tcl /main/hindenburg/2 6 Sep 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "filerefsec.tcl"
-
- 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
-
-