home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)newdiagram.tcl /main/hindenburg/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)newdiagram.tcl /main/hindenburg/2 30 Jul 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "newobjentr.tcl"
-
- Class NewDiagramDlg : {NewObjEntryDlg} {
- constructor
- method destructor
- method handleEdit
- method handleOk
- method handleTextModified
- method popUp
- attribute type
- attribute qualified
- attribute createInterface
- }
-
- constructor NewDiagramDlg {class this name} {
- set this [NewObjEntryDlg::constructor $class $this $name]
- $this createInterface 1
- # Start constructor user section
-
- $this config \
- -okPressed "$this handleOk"
- PushButton new $this.edit \
- -label Edit \
- -activated "$this handleEdit"
-
- # End constructor user section
- return $this
- }
-
- method NewDiagramDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this NewObjEntryDlg::destructor
- }
-
- method NewDiagramDlg::handleEdit {this} {
- $this popDown
- $this handleOk
- if [isCommand [$this createdObj]] {
- [$this createdObj] editFile
- }
- }
-
- method NewDiagramDlg::handleOk {this} {
- set fileType [$this type]
- set itemType [file2itemtype $fileType]
- set configV [[$this dbObj] getParent ConfigVersion]
-
- set message "Creating $fileType file version"
- set script "$this createdObj \"\""
- append script " ;"
-
- if [$this qualified] {
- set className [$this entry]
- set fileName [$this.top.name2 text]
- set message "$message '${className}:${fileName}'..."
-
- append script " \
- set sysItem [[[$this dbObj] itemKeeper] findDeclareItem \
- -byName $className cl scopePhaseDef]"
- append script " ;"
- append script " \
- set item \[\[\$sysItem item\] findCreateItem \
- \"$fileName\" $itemType\]"
- append script " ;"
- append script " \
- $this createdObj \[[$this dbObj] createFileVersion \
- \$item \
- [fileHasScopePhase $fileType] $fileType graph $configV\]"
- } else {
- set fileName [$this entry]
- set message "$message '$fileName'..."
-
- append script " \
- $this createdObj \[[$this dbObj] createFileVersion \
- \"$fileName\" $itemType \
- [fileHasScopePhase $fileType] $fileType graph $configV\]"
- }
- $wmttoolObj startCommand tcl "$script" "" $message {1 0} 1
- }
-
- method NewDiagramDlg::handleTextModified {this} {
- if {[$this qualified] && "[rmWhiteSpace [$this.top.name2 text]]" == ""} {
- $this entry [$this.top.name text]
- set selected 0
- $this okSensitive $selected
- $this.edit sensitive $selected
- $this okDefault $selected
- $this cancelDefault [expr 1 - $selected]
- } else {
- $this NewObjEntryDlg::handleTextModified
- $this.edit sensitive [$this okSensitive]
- }
- }
-
- method NewDiagramDlg::popUp {this} {
- if [$this createInterface] {
- $this createInterface 0
- case [$this type] in {
- {etd std} {
- set message "Class Name:"
- set qualified 1
- }
- default {
- set message "Diagram Name:"
- set qualified 0
- }
- }
- $this config \
- -title "New [$this type]" \
- -qualified $qualified \
- -message $message
- if $qualified {
- Label new $this.top.nameLab2 \
- -text "Name:"
- SingleLineText new $this.top.name2 \
- -textModified "$this handleTextModified"
- }
- }
- $this NewObjEntryDlg::popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
-