home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / revengdlg.tcl < prev    next >
Text File  |  1997-03-20  |  5KB  |  195 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Cayenne Software Inc.    1996
  4. #
  5. #      File:           @(#)revengdlg.tcl    /main/hindenburg/8
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)revengdlg.tcl    /main/hindenburg/8   20 Mar 1997 Copyright 1996 Cayenne Software Inc.
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14.  
  15. Class RevEngDlg : {TemplateDialog} {
  16.     method destructor
  17.     constructor
  18.     method checkDialogStatus
  19.     method getOptions
  20.     method ok
  21.     attribute headerFiles
  22.     attribute language
  23.     attribute revEngTool
  24.     attribute dbObj
  25. }
  26.  
  27. method RevEngDlg::destructor {this} {
  28.     # Start destructor user section
  29.     # End destructor user section
  30. }
  31.  
  32. constructor RevEngDlg {class this name language revEngTool} {
  33.     set this [TemplateDialog::constructor $class $this $name]
  34.     $this config \
  35.         -language $language \
  36.         -revEngTool $revEngTool \
  37.         -title "Reverse Engineer $language" \
  38.         -modal yes \
  39.         -okPressed {
  40.             %this ok
  41.         }
  42.     interface DlgColumn $this.top {
  43.         spaceType EVEN
  44.         DlgRow diag {
  45.             verStretchFactor 0
  46.             verShrinkFactor 0
  47.             Label lab {
  48.                 text Diagram
  49.             }
  50.             SingleLineText name {}
  51.         }
  52.         DlgRow gen {
  53.             verStretchFactor 0
  54.             verShrinkFactor 0
  55.             Label lab {
  56.                 text Generate
  57.             }
  58.             OptionMenu types {
  59.                 entrySet {
  60.                     "CADs and CDMs"
  61.                     "Only CADs"
  62.                     "Only CDMs"
  63.                 }
  64.                 selected "CADs and CDMs"
  65.             }
  66.         }
  67.         CheckButton overwrite {
  68.             label "Overwrite Existing Diagrams"
  69.         }
  70.         CheckButton reference {
  71.             label "Create Reference Diagrams"
  72.         }
  73.         NamedGroup dims {
  74.             verStretchFactor 0
  75.             verShrinkFactor 0
  76.             label "Maximum Size (Width x Height)"
  77.             DlgColumn mtx {
  78.                 DlgRow class {
  79.                     Label lab {
  80.                         text Class
  81.                     }
  82.                     DlgRow dim {
  83.                         horStretchFactor 0
  84.                         horShrinkFactor 0
  85.                         spaceType NONE
  86.                         IntField width {
  87.                             columnCount 8
  88.                             intValue 512
  89.                         }
  90.                         IntField height {
  91.                             columnCount 8
  92.                             intValue 512
  93.                         }
  94.                     }
  95.                 }
  96.                 DlgRow tree {
  97.                     Label lab {
  98.                         text Tree
  99.                     }
  100.                     DlgRow dim {
  101.                         horStretchFactor 0
  102.                         horShrinkFactor 0
  103.                         spaceType NONE
  104.                         IntField width {
  105.                             columnCount 8
  106.                             intValue 2048
  107.                         }
  108.                         IntField height {
  109.                             columnCount 8
  110.                             intValue 2048
  111.                         }
  112.                     }
  113.                 }
  114.                 DlgRow screen {
  115.                     Label lab {
  116.                         text Screen
  117.                     }
  118.                     DlgRow dim {
  119.                         horStretchFactor 0
  120.                         horShrinkFactor 0
  121.                         spaceType NONE
  122.                         IntField width {
  123.                             columnCount 8
  124.                             intValue 2048
  125.                         }
  126.                         IntField height {
  127.                             columnCount 8
  128.                             intValue 2048
  129.                         }
  130.                     }
  131.                 }
  132.             }
  133.         }
  134.     }
  135.     $this config -okSensitive 1 -okDefault 1 -cancelDefault 1
  136.     $this.top.diag.name textModified "$this checkDialogStatus"
  137.     $this.top.gen.types selectionChanged "$this checkDialogStatus"
  138.     return $this
  139. }
  140.  
  141. method RevEngDlg::checkDialogStatus {this} {
  142.     set enableOk 1
  143.     $this okSensitive $enableOk
  144.     $this okDefault $enableOk
  145.     $this cancelDefault [expr 1 - $enableOk]
  146. }
  147.  
  148. method RevEngDlg::getOptions {this} {
  149.     case "[$this.top.gen.types selected]" in {
  150.         {"Only CDMs"} { append script " -f" }
  151.         {"Only CADs"} { append script " -i" }
  152.     }
  153.     if [$this.top.overwrite state] {
  154.         append script " -o"
  155.     }
  156.     if [$this.top.reference state] {
  157.         append script " -r"
  158.     }
  159.     set dim $this.top.dims.mtx.class.dim
  160.     append script " -c[$dim.width intValue]x[$dim.height intValue]"
  161.     set dim $this.top.dims.mtx.screen.dim
  162.     append script " -s[$dim.width intValue]x[$dim.height intValue]"
  163.     set dim $this.top.dims.mtx.tree.dim
  164.     append script " -t[$dim.width intValue]x[$dim.height intValue]"
  165.     append script " -P[[[$this dbObj] getParent Project] name]"
  166.     append script " -C[[[$this dbObj] getParent ConfigVersion] name]"
  167.     append script " -A[[[$this dbObj] getParent PhaseVersion] name]"
  168.     append script " -T[[[$this dbObj] getParent PhaseVersion] browserType]"
  169.     append script " -S[[$this dbObj] name]"
  170.     append script " -V[[[$this dbObj] getParent ConfigVersion] versionName]"
  171.     if {[$this.top.diag.name text] != ""} {
  172.         append script " -D\"[$this.top.diag.name text]\""
  173.     }
  174.     return $script
  175. }
  176.  
  177. method RevEngDlg::ok {this} {
  178.     set script [quoteIf [m4_path_name bin [$this revEngTool]$EXE_EXT]]
  179.     append script [$this getOptions]
  180.  
  181.     set argsFile [args_file {}]
  182.     set fid [open $argsFile w]
  183.     foreach file [$this headerFiles] {
  184.         puts $fid $file
  185.     }
  186.     close $fid
  187.     append script " -F$argsFile"
  188.  
  189.     set msg "Starting 'Reverse Engineer [$this language]'"
  190.     $wmttoolObj startCommand mtool "$script" "" "$msg" {1 0} 0
  191. }
  192.  
  193. # Do not delete this line -- regeneration end marker
  194.  
  195.