home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)ilstrconge.tcl 1.4
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)ilstrconge.tcl 1.4 07 Nov 1995 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- # End user added include file section
-
- require "ilcongen.tcl"
-
- Class IlStrConGen : {IlConGen} {
- method destructor
- constructor
- method generate
- method genComponent
- method nextY
- method nextX
- method attribPath
- method section
- attribute x
- attribute y
- attribute ascFid
- attribute _section
- }
-
- global IlStrConGen::stepX
- set IlStrConGen::stepX ""
-
- global IlStrConGen::stepY
- set IlStrConGen::stepY ""
-
- global IlStrConGen::startX
- set IlStrConGen::startX ""
-
- global IlStrConGen::startY
- set IlStrConGen::startY ""
-
- global IlStrConGen::indentX
- set IlStrConGen::indentX ""
-
-
- method IlStrConGen::destructor {this} {
- set ref [$this _section]
- if {$ref != ""} {
- $ref _contentsGenerator ""
- }
- # Start destructor user section
- # End destructor user section
- $this IlConGen::destructor
- }
-
- constructor IlStrConGen {class this name section} {
- set this [IlConGen::constructor $class $this $name $section]
- $section _contentsGenerator $this
-
- if {${IlStrConGen::stepX} == ""} {
- global IlStrConGen::stepX
- global IlStrConGen::stepY
- global IlStrConGen::startX
- global IlStrConGen::startY
- global IlStrConGen::indentX
- set IlStrConGen::stepX 96
- set IlStrConGen::stepY 56
- set IlStrConGen::startX 50
- set IlStrConGen::startY 50
- set IlStrConGen::indentX 96
- }
- $this x -1
- $this y -1
-
- return $this
- }
-
- method IlStrConGen::generate {this} {
-
- # Generate Interleaf attribute-files
- # and put them also in the current section
-
- $this ascFid [$this openAsc]
-
- if {[$this ascFid] == ""} {
- return
- }
-
- set dir [path_name directory [[$this section] docLocation]]
-
-
- set curDir [pwd]
- cd $dir
- if {! [catch {set files [glob .@*]}]} {
- foreach file $files {
- BasicFS::removeFile $file
- }
- }
-
- set comp [[docTool structure] firstComponent]
- for {} {$comp != ""} {set comp [$comp next]} {
- set section [docTool findSection [$comp uiName]]
- if {$section != ""} {
- $this genComponent $section
- }
- }
-
- close [$this ascFid]
- }
-
- method IlStrConGen::genComponent {this section} {
-
- set dotFile [$this attribPath $section]
-
- set attribs [TextSection new]
- set name [$section uiName]
-
- if {[regsub -all {\(} $name {\\(} nn]} {set name $nn}
- if {[regsub -all {\)} $name {\\)} nn]} {set name $nn}
-
- if {[$section docType] == "Doc"} {
- $this nextY [$section indentation]
- } else {
- $this nextX $name
- }
-
- $attribs append "(system_attributes\n"
- $attribs append " (doc_name $name)\n"
- $attribs append " (icon_x [$this x])\n"
- $attribs append " (icon_y [$this y])\n"
-
- if {[$section docType] == "Cat"} {
- $attribs append " (master_exports components auto_numbers \
- frames diagramming_objects tables \
- pages header_footers)"
- }
- $attribs append ")\n"
- $attribs append "(attribute_display_list)\n"
- $attribs append "(attribute_control \"<#0>\")\n"
-
- puts [$this ascFid] ".@$name"
- $attribs write [$this ascFid]
-
- if {[catch {set dot [open $dotFile w]} reason]} {
- wmtkerror "Error on opening '$dotFile' for writing: $reason"
- } else {
- $attribs write $dot
- close $dot
- }
- }
-
- method IlStrConGen::nextY {this level} {
-
- global IlStrConGen::startY
- global IlStrConGen::stepY
- global IlStrConGen::indentX
-
- set y [$this y]
-
- if {$y == -1} {
- set y ${IlStrConGen::startY}
- } else {
- incr y ${IlStrConGen::stepY}
- }
-
- $this y $y
-
- set x ${IlStrConGen::startX}
-
- if {$level > 0} {
- incr x [expr $level*${IlStrConGen::indentX}]
- }
-
- $this x $x
- }
-
- method IlStrConGen::nextX {this name} {
-
- global IlStrConGen::startY
- global IlStrConGen::startX
- global IlStrConGen::stepX
-
- if {[$this y] == -1} {
- $this y ${IlStrConGen::startY}
- }
-
- set x [$this x]
-
- if {$x == -1} {
- set x ${IlStrConGen::startX}
- } else {
- set shift [expr 7*[string length $name]]
- if {$shift < ${IlStrConGen::stepX}} {
- incr x ${IlStrConGen::stepX}
- } else {
- incr x $shift
- }
- }
-
- $this x $x
- }
-
- method IlStrConGen::attribPath {this section} {
-
- set path [$section docLocation]
- set dir [path_name directory $path]
- set file ".@[path_name file $path]"
-
- return [path_name concat $dir $file]
- }
-
- # Do not delete this line -- regeneration end marker
-
- method IlStrConGen::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
- }
-
-