home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)groupvstrd.tcl /main/titanic/12
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)groupvstrd.tcl /main/titanic/12 25 Nov 1997 Copyright 1997 Cayenne Software Inc.
-
- # Start user added include file section
- require_module_file groupvstrs.tcl corpmodelling
- # End user added include file section
-
- require "groupdialo.tcl"
-
- Class GroupVStrDlg : {GroupDialog} {
- method destructor
- constructor
- method modeChanged
- method popUp
- }
-
- method GroupVStrDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this GroupDialog::destructor
- }
-
- constructor GroupVStrDlg {class this name groupV} {
- set this [GroupDialog::constructor $class $this $name]
- $this groupV $groupV
-
- set view $this.top.view
- $view columnCount 52
- BrowsHeader new $view.header0 -label Name -width 20
- BrowsHeader new $view.header1 -label Type -width 18
- BrowsHeader new $view.header2 -label Status -width 14
-
- return $this
- }
-
- method GroupVStrDlg::modeChanged {this {forceFlag 1}} {
- set currentMode [$this.top.mode.optmenu selected]
- if {! $forceFlag} {
- set mode [$this currentMode]
- if {"$mode" == "$currentMode"} {
- return
- }
- }
- $this currentMode $currentMode
-
- # Enable / disable buttons
- case "$currentMode" in {
- {overview} {
- $this.top.menu.new sensitive 0
- $this.top.menu.show sensitive 0
- $this.top.menu.delete sensitive 0
- }
- {"explicit file"
- "file selector"
- "item selector"} {
- $this.top.menu.show sensitive 0
- $this.top.menu.new sensitive [$this editable]
- $this.top.menu.delete sensitive [$this editable]
- }
- {"explicit group version"
- "group version filter"} {
- # Can not have subgroups any more
- $this.top.menu.show sensitive 1
- $this.top.menu.new sensitive 0
- $this.top.menu.delete sensitive [$this editable]
- }
- {default} {
- $this.top.menu.show sensitive 1
- $this.top.menu.new sensitive [$this editable]
- $this.top.menu.delete sensitive [$this editable]
- }
- }
-
- # Check if the view should be updated
- if {! $forceFlag} {
- set checkList {"file selector" "item selector"}
- if {[lsearch -exact $checkList "$mode"] != -1 &&
- [lsearch -exact $checkList "$currentMode"] != -1} {
- return
- }
- }
-
- # Fill the view
- set groupV [$this groupV]
- set sysV [$this sysV]
- set confV [$this confV]
- case "$currentMode" in {
- {overview} {
- $this showObjectsOk [$groupV selectorEngine $sysV $confV] 1
- }
- {"explicit group version"} {
- $this showObjectsOk [$groupV explicitSubgroupVersions $sysV] 1
- }
- {"group version filter"} {
- $this showObjectsOk [$groupV filterSubgroupVersions "" $sysV] 1
- }
- {"explicit file"} {
- $this showObjectsOk [$groupV explicitFileVersions $sysV] 1
- }
- {"file filter"} {
- $this showObjectsOk [$groupV filterFileVersions "" $sysV] 1
- }
- {"item filter"} {
- $this showObjectsOk [$groupV filterItems "" $sysV] 1
- }
- {"file selector" "item selector"} {
- $this showObjectsOk [$groupV localSelectorEngine $sysV $confV] 1
- }
- }
- }
-
- method GroupVStrDlg::popUp {this} {
- if {[$this editable] && [catch {[$this groupV] edit} errorMsg]} {
- if [info exists errorInfo] {
- set errorTrace $errorInfo
- set errorCodeCopy $errorCode
- } else {
- set errorTrace ""
- set errorCodeCopy ""
- }
- $this editable 0
- } else {
- set errorMsg ""
- }
-
- # Set the mode entrySet
- set entrySet {
- overview
- "explicit group version"
- "group version filter"
- "explicit file"
- "file filter"
- "item filter"
- }
- set phaseV [$this phaseV]
- if {"[$phaseV getInfo Type]" != "Implementation"} {
- set entrySet [linsert $entrySet 5 "file selector"]
- append entrySet { "item selector"}
- }
- $this.top.mode.optmenu entrySet $entrySet
-
- $this modeChanged
- $this config \
- -modal [$this editable] \
- -title "[$this title] - [[$this groupV] getInfo Name]"
- $this TemplateDialog::popUp
-
- if {"$errorMsg" != ""} {
- global errorInfo errorCode
- set errorInfo $errorTrace
- set errorCode $errorCodeCopy
- wmtkerror $errorMsg
- }
- }
-
- # Do not delete this line -- regeneration end marker
-
-