home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
wd97mstrco.tcl
< prev
next >
Wrap
Text File
|
1997-11-21
|
6KB
|
226 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)wd97mstrco.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)wd97mstrco.tcl /main/titanic/3 21 Nov 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class Wd97MstrConGen : {Object} {
constructor
method destructor
method generate
method section
attribute _section
}
constructor Wd97MstrConGen {class this name section} {
set this [Object::constructor $class $this $name]
$this _section $section
$section _contentsGenerator $this
# Start constructor user section
# End constructor user section
return $this
}
method Wd97MstrConGen::destructor {this} {
set ref [$this _section]
if {$ref != ""} {
$ref _contentsGenerator ""
}
# Start destructor user section
# End destructor user section
}
method Wd97MstrConGen::generate {this} {
set sect [$this _section]
set name [$sect uiName]
set docu [$sect document]
if [catch {
set app [[[docTool document] editor] app]
# for 'live' generation
#$app property Visible 1
set docs [$app property Documents]
set dest [[$this section] docLocation]
# open file
set d [$docs Open $dest]
# set in Master Document View
set activeWindow [$d property ActiveWindow]
set view [$activeWindow property View]
$view property Type 5
# expand sub documents
set subDocs [$d property SubDocuments]
$subDocs property Expanded 1.0
# delete current contents
set cnt [$d property Content]
$cnt Select
$cnt Delete
$cnt InsertAfter [$docu title]
$cnt property Style "Title Cover"
$cnt InsertParagraphAfter
$cnt Collapse 0
set tables [$d property Tables]
set tbl1 [$tables Add $cnt 2 2]
set c11 [$tbl1 Cell 1 1]
set c11Cnt [$c11 property Range]
$c11Cnt InsertAfter "Project:"
$c11 property Width 3.0
set c12 [$tbl1 Cell 1 2]
set c12Cnt [$c12 property Range]
$c12Cnt InsertAfter [[$docu project] name]
$c12 property Width 3.0
set c21 [$tbl1 Cell 2 1]
set c21Cnt [$c21 property Range]
$c21Cnt InsertAfter "Documented System:"
$c21 property Width 3.0
set c22 [$tbl1 Cell 2 2]
set c22Cnt [$c22 property Range]
$c22Cnt InsertAfter [[[$docu documentedSystem] system] name]
$c22 property Width 3.0
set tblRange1 [$tbl1 property Range]
$tblRange1 property Style "Subtitle Cover"
$tblRange1 InsertParagraphAfter
$tblRange1 Collapse 0
$tblRange1 InsertParagraphAfter
$tblRange1 Collapse 0
set tbl2 [$tables Add $tblRange1 7 2]
set c11 [$tbl2 Cell 1 1]
set c11Cnt [$c11 property Range]
$c11Cnt InsertAfter "Title:"
$c11 property Width 1.5
set c12 [$tbl2 Cell 1 2]
set c12Cnt [$c12 property Range]
$c12Cnt InsertAfter [$docu title]
$c12 property Width 1.5
set c21 [$tbl2 Cell 2 1]
set c21Cnt [$c21 property Range]
$c21Cnt InsertAfter "Subject:"
$c21 property Width 1.5
set c22 [$tbl2 Cell 2 2]
set c22Cnt [$c22 property Range]
$c22Cnt InsertAfter [$docu subject]
$c22 property Width 1.5
set c31 [$tbl2 Cell 3 1]
set c31Cnt [$c31 property Range]
$c31Cnt InsertAfter "Reference:"
$c31 property Width 1.5
set c32 [$tbl2 Cell 3 2]
set c32Cnt [$c32 property Range]
$c32Cnt InsertAfter [$docu reference]
$c32 property Width 1.5
set c41 [$tbl2 Cell 4 1]
set c41Cnt [$c41 property Range]
$c41Cnt InsertAfter "Keywords:"
$c41 property Width 1.5
set c42 [$tbl2 Cell 4 2]
set c42Cnt [$c42 property Range]
$c42Cnt InsertAfter [$docu keywords]
$c42 property Width 1.5
set c51 [$tbl2 Cell 5 1]
set c51Cnt [$c51 property Range]
$c51Cnt InsertAfter "Authors:"
$c51 property Width 1.5
set c52 [$tbl2 Cell 5 2]
set c52Cnt [$c52 property Range]
$c52Cnt InsertAfter [$docu authors]
$c52 property Width 1.5
set c61 [$tbl2 Cell 6 1]
set c61Cnt [$c61 property Range]
$c61Cnt InsertAfter "Status:"
$c61 property Width 1.5
set c62 [$tbl2 Cell 6 2]
set c62Cnt [$c62 property Range]
$c62Cnt InsertAfter [$docu docStatus]
$c62 property Width 1.5
set c71 [$tbl2 Cell 7 1]
set c71Cnt [$c71 property Range]
$c71Cnt InsertAfter "Date:"
$c71 property Width 1.5
set c72 [$tbl2 Cell 7 2]
set c72Cnt [$c72 property Range]
$c72Cnt InsertAfter [$docu date]
$c72 property Width 1.5
set tblRange2 [$tbl2 property Range]
$tblRange2 property Style "Title Attributes"
$tblRange2 Collapse 0
set cnt $tblRange2
$cnt InsertBreak
$cnt Collapse 0
$cnt property Style $OTStyles(OTBodyText)
set tocs [$d property TablesOfContents]
set toc [$tocs Add $cnt]
set cntToc [$toc property Range]
$cntToc Collapse 0
#$cntToc InsertBreak
set subDocs [$d property SubDocuments]
$subDocs property Expanded 1.0
foreach sect [[$this section] getTree] {
if {[$sect indentation] > 1} {
continue
}
set cnt [$d Range]
$cnt Collapse 0
$cnt Select
$subDocs AddFromFile [$sect docLocation]
$d Save
}
set cnt [$d Range]
$cnt Collapse 0
$cnt InsertParagraphAfter
$d Close -1
} msg] {
wmtkerror "Word Automation Error: $msg"
}
}
# Do not delete this line -- regeneration end marker
method Wd97MstrConGen::section {this args} {
if {$args == ""} {
return [$this _section]
}
set ref [$this _section]
if {$ref != ""} {
$ref _contentsGenerator ""
}
set obj [lindex $args 0]
if {$obj != ""} {
$obj _contentsGenerator $this
}
$this _section $obj
}