home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / fmtitlecon.tcl < prev    next >
Encoding:
Text File  |  1996-05-29  |  1.6 KB  |  62 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)fmtitlecon.tcl    1.2
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)fmtitlecon.tcl    1.2   23 Jun 1995 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "fmcongen.tcl"
  15.  
  16. Class FmTitleConGen : {FmConGen} {
  17.     constructor
  18.     method destructor
  19.     method generate
  20. }
  21.  
  22. constructor FmTitleConGen {class this name section} {
  23.     set this [FmConGen::constructor $class $this $name $section]
  24.     # Start constructor user section
  25.  
  26.     # this is not a type-tied generator, so adjust the type
  27.     # part of the tempate name
  28.     set version [[[[$this section] document] editor] version]
  29.     $this templatePath [m4_path_name etc fm${version}title.mif]
  30.  
  31.     # End constructor user section
  32.     return $this
  33. }
  34.  
  35. method FmTitleConGen::destructor {this} {
  36.     # Start destructor user section
  37.     # End destructor user section
  38.     $this FmConGen::destructor
  39. }
  40.  
  41. method FmTitleConGen::generate {this} {
  42.  
  43.     set mifFid [$this openMif]
  44.  
  45.     # check first if output file can be opened
  46.     if {$mifFid == ""} {
  47.         return
  48.     }
  49.     # Make a section and expand the template into it
  50.     set contents [TextSection new]
  51.     expand_file $contents [$this templatePath]
  52.  
  53.     # Write the contents into the MIF-file
  54.     $contents write $mifFid
  55.     close $mifFid
  56.  
  57.     $this mif2Bin
  58. }
  59.  
  60. # Do not delete this line -- regeneration end marker
  61.  
  62.