home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)revengdlg.tcl /main/hindenburg/8
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)revengdlg.tcl /main/hindenburg/8 20 Mar 1997 Copyright 1996 Cayenne Software Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class RevEngDlg : {TemplateDialog} {
- method destructor
- constructor
- method checkDialogStatus
- method getOptions
- method ok
- attribute headerFiles
- attribute language
- attribute revEngTool
- attribute dbObj
- }
-
- method RevEngDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- constructor RevEngDlg {class this name language revEngTool} {
- set this [TemplateDialog::constructor $class $this $name]
- $this config \
- -language $language \
- -revEngTool $revEngTool \
- -title "Reverse Engineer $language" \
- -modal yes \
- -okPressed {
- %this ok
- }
- interface DlgColumn $this.top {
- spaceType EVEN
- DlgRow diag {
- verStretchFactor 0
- verShrinkFactor 0
- Label lab {
- text Diagram
- }
- SingleLineText name {}
- }
- DlgRow gen {
- verStretchFactor 0
- verShrinkFactor 0
- Label lab {
- text Generate
- }
- OptionMenu types {
- entrySet {
- "CADs and CDMs"
- "Only CADs"
- "Only CDMs"
- }
- selected "CADs and CDMs"
- }
- }
- CheckButton overwrite {
- label "Overwrite Existing Diagrams"
- }
- CheckButton reference {
- label "Create Reference Diagrams"
- }
- NamedGroup dims {
- verStretchFactor 0
- verShrinkFactor 0
- label "Maximum Size (Width x Height)"
- DlgColumn mtx {
- DlgRow class {
- Label lab {
- text Class
- }
- DlgRow dim {
- horStretchFactor 0
- horShrinkFactor 0
- spaceType NONE
- IntField width {
- columnCount 8
- intValue 512
- }
- IntField height {
- columnCount 8
- intValue 512
- }
- }
- }
- DlgRow tree {
- Label lab {
- text Tree
- }
- DlgRow dim {
- horStretchFactor 0
- horShrinkFactor 0
- spaceType NONE
- IntField width {
- columnCount 8
- intValue 2048
- }
- IntField height {
- columnCount 8
- intValue 2048
- }
- }
- }
- DlgRow screen {
- Label lab {
- text Screen
- }
- DlgRow dim {
- horStretchFactor 0
- horShrinkFactor 0
- spaceType NONE
- IntField width {
- columnCount 8
- intValue 2048
- }
- IntField height {
- columnCount 8
- intValue 2048
- }
- }
- }
- }
- }
- }
- $this config -okSensitive 1 -okDefault 1 -cancelDefault 1
- $this.top.diag.name textModified "$this checkDialogStatus"
- $this.top.gen.types selectionChanged "$this checkDialogStatus"
- return $this
- }
-
- method RevEngDlg::checkDialogStatus {this} {
- set enableOk 1
- $this okSensitive $enableOk
- $this okDefault $enableOk
- $this cancelDefault [expr 1 - $enableOk]
- }
-
- method RevEngDlg::getOptions {this} {
- case "[$this.top.gen.types selected]" in {
- {"Only CDMs"} { append script " -f" }
- {"Only CADs"} { append script " -i" }
- }
- if [$this.top.overwrite state] {
- append script " -o"
- }
- if [$this.top.reference state] {
- append script " -r"
- }
- set dim $this.top.dims.mtx.class.dim
- append script " -c[$dim.width intValue]x[$dim.height intValue]"
- set dim $this.top.dims.mtx.screen.dim
- append script " -s[$dim.width intValue]x[$dim.height intValue]"
- set dim $this.top.dims.mtx.tree.dim
- append script " -t[$dim.width intValue]x[$dim.height intValue]"
- append script " -P[[[$this dbObj] getParent Project] name]"
- append script " -C[[[$this dbObj] getParent ConfigVersion] name]"
- append script " -A[[[$this dbObj] getParent PhaseVersion] name]"
- append script " -T[[[$this dbObj] getParent PhaseVersion] browserType]"
- append script " -S[[$this dbObj] name]"
- append script " -V[[[$this dbObj] getParent ConfigVersion] versionName]"
- if {[$this.top.diag.name text] != ""} {
- append script " -D\"[$this.top.diag.name text]\""
- }
- return $script
- }
-
- method RevEngDlg::ok {this} {
- set script [quoteIf [m4_path_name bin [$this revEngTool]$EXE_EXT]]
- append script [$this getOptions]
-
- set argsFile [args_file {}]
- set fid [open $argsFile w]
- foreach file [$this headerFiles] {
- puts $fid $file
- }
- close $fid
- append script " -F$argsFile"
-
- set msg "Starting 'Reverse Engineer [$this language]'"
- $wmttoolObj startCommand mtool "$script" "" "$msg" {1 0} 0
- }
-
- # Do not delete this line -- regeneration end marker
-
-