home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)fmbookcong.tcl 1.5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)fmbookcong.tcl 1.5 09 Jan 1996 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "fmcongen.tcl"
-
- Class FmBookConGen : {FmConGen} {
- method destructor
- constructor
- method generate
- method genComponent
- method section
- attribute mifFid
- attribute _section
- }
-
- method FmBookConGen::destructor {this} {
- set ref [$this _section]
- if {$ref != ""} {
- $ref _contentsGenerator ""
- }
- # Start destructor user section
- # End destructor user section
- $this FmConGen::destructor
- }
-
- constructor FmBookConGen {class this name section} {
- set this [FmConGen::constructor $class $this $name $section]
- $section _contentsGenerator $this
- return $this
- }
-
- method FmBookConGen::generate {this} {
-
- $this mifFid [$this openMif]
-
- if {[$this mifFid] == ""} {
- return
- }
-
- set inSubBook 0
- set subBookLevel 0
-
- # Start the MIF-file with a Book-identification
- puts [$this mifFid] "<Book 4.00>"
-
- foreach sect [[$this section] getTree] {
-
- set level [$sect indentation]
- set name [$sect uiName]
- set docType [$sect docType]
-
- set class [$sect operationClass]
-
- if {$inSubBook} {
- # Check for end of subbook
- if {$level <= $subBookLevel} {
- set inSubBook 0
- }
- }
- if {!$inSubBook} {
- # Check if the section is manipulatable.
- # If so then skip this section and
- # all it's underlying sections.
- if {$docType == [[$this section] docType]} {
- # In subbook
- set inSubBook 1
- set subBookLevel $level
- } else {
- if {$class == "manipulate"} {
- # Section is manipulatable.
- # Put it in the book
- $this genComponent $sect
- }
- }
- }
- }
-
- # Close the MIF-file
- close [$this mifFid]
-
- $this mif2Bin
- }
-
- method FmBookConGen::genComponent {this section} {
-
- set mif [$this mifFid]
-
- # Start the Bookcomponent
- puts $mif "<BookComponent"
- puts $mif " <PageNumbering Continue>"
- puts $mif " <PgfNumbering Continue>"
- puts $mif " <FileName `<c\\>[$section docLocation]'>"
-
- # If the section is a Table of Contents then specify which
- # paragraph-tag's must be included in the Table of Contents
- if {[$section docType] == "Toc"} {
- puts $mif " <DeriveType TOC>"
- puts $mif " <DeriveTag `Chapter'>"
- puts $mif " <DeriveTag `Chapter1'>"
- puts $mif " <DeriveTag `Section'>"
- puts $mif " <DeriveTag `Section1'>"
- puts $mif " <DeriveTag `SubSection'>"
- puts $mif " <DeriveTag `SubSection1'>"
- puts $mif " <DeriveTag `SubSubSection'>"
- puts $mif " <DeriveTag `SubSubSection1'>"
- }
-
- # Finish the Bookcomponent
- puts $mif ">"
- }
-
- # Do not delete this line -- regeneration end marker
-
- method FmBookConGen::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
- }
-
-