home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1994
- #
- # File: @(#)newdocvdlg.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)newdocvdlg.tcl /main/hindenburg/1 23 May 1997 Copyright 1994 Westmount Technology
-
- # Start user added include file section
- require "wmt_util.tcl"
- # End user added include file section
-
-
- Class NewDocVDlg : {TemplateDialog} {
- constructor
- method destructor
- method handleCancel
- method handleHelp
- method handleOk
- method handleSelectionChanged
- method popUp
- attribute dbObj
- }
-
- constructor NewDocVDlg {class this name} {
- set this [TemplateDialog::constructor $class $this $name]
- # Start constructor user section
-
- interface DlgColumn $this.top {
- Label nameLab {
- text "Document Name:"
- }
- SingleLineText name {}
- Label docsysLab {
- text "Documented System:"
- }
- ComboBox docsys {
- rowCount 5
- }
- Label editorLab {
- text "Editor:"
- }
- OptionMenu editor {
- }
- }
- $this config \
- -modal yes \
- -title "New Document Version" \
- -okPressed "$this handleOk" \
- -cancelPressed "$this handleCancel" \
- -helpPressed "$this handleHelp"
-
- # Selection-changed callback
- $this.top.docsys textModified {
- set dialog [getParent [getParent %this]]
- $dialog handleSelectionChanged
- }
- $this.top.name textModified "$this handleSelectionChanged"
-
- # Fill list of available editors
- if $win95 {
- set entrySet {Word Wd97}
- } else {
- set entrySet {Fm40 Fm50 Il60}
- }
- $this.top.editor config \
- -entrySet $entrySet \
- -selected [lindex $entrySet 0]
-
- # End constructor user section
- return $this
- }
-
- method NewDocVDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method NewDocVDlg::handleCancel {this} {
- }
-
- method NewDocVDlg::handleHelp {this} {
- [getParent $this] helpOnName [nt_get_type $this]
- }
-
- method NewDocVDlg::handleOk {this} {
- set dbObj [$this dbObj]
- set docsys [$this.top.docsys text]
- set docname [$this.top.name text]
- set doctype [lindex ${BrowserProcs::systemTypes} 1]
- set editor [$this.top.editor selected]
-
- set script "set docV \[$dbObj createSystemVersion \
- [list $docname] cl [list $doctype] [$dbObj getParent ConfigVersion] 0\]"
- append script " ;"
- append script " \$docV setProperty editor [list $editor]"
- append script " ;"
- append script " \$docV setProperty doc_sys [list $docsys]"
- append script " ;"
- append script " set propInfo \[PIPropInfo new\]"
- append script " ;"
- append script " \$propInfo edit \$docV"
- append script " ;"
- append script " set prop \[\$propInfo findProperty doc_sys\]"
- append script " ;"
- append script " PIPropItemRef new \$prop cl scopePhase"
- append script " ;"
- append script " \$propInfo save"
- append script " ;"
- append script " \$propInfo delete"
-
- if [[$dbObj findSystemVersion -byNameAndType "$docsys" system] isNil] {
- set endScript "wmtkwarning \
- \"SystemVersion with name '$docsys' does not\
- exist within the current PhaseVersion\""
- } else {
- set endScript ""
- }
-
- $wmttoolObj startCommand tcl \
- "$script" "$endScript" \
- "Creating $doctype version '$docname'..." \
- {1 0} 1
- }
-
- method NewDocVDlg::handleSelectionChanged {this} {
- if {"[rmWhiteSpace [$this.top.name text]]" == "" ||
- "[rmWhiteSpace [$this.top.docsys text]]" == ""} {
- set selected 0
- } else {
- set selected 1
- }
- $this okSensitive $selected
- $this okDefault $selected
- $this cancelDefault [expr 1 - $selected]
- }
-
- method NewDocVDlg::popUp {this} {
- # Fill list of documented systems
- set entrySet ""
- foreach sysV [[$this dbObj] getChildSet systemVersions] {
- set sys [$sysV system]
- if {"[$sys type]" != "system"} continue
- lappend entrySet "[$sys name]"
- }
- set entrySet [lsort $entrySet]
- set text [$this.top.docsys text]
- if {"$text" == "" || [lsearch -exact $entrySet "$text"] == -1} {
- set text [lindex $entrySet 0]
- }
- $this.top.docsys config \
- -entrySet $entrySet \
- -text $text
-
- $this handleSelectionChanged
- $this TemplateDialog::popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
-