home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)rmpropdial.tcl /main/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)rmpropdial.tcl /main/2 5 Jun 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class RmPropDialog : {TemplateDialog} {
- constructor
- method destructor
- method popUp
- method handleOk
- method handleCancel
- method selectionChanged
- method addContainer
- method removeContainer
- attribute containerSet
- attribute tool
- }
-
- constructor RmPropDialog {class this name tool} {
- set this [TemplateDialog::constructor $class $this $name]
- $this tool $tool
- $this containerSet [List new]
- # Start constructor user section
-
- TextList new $this.list \
- -selectionPolicy EXTENDED \
- -font "courier-normal-12" \
- -rowCount 10 \
- -selectionChanged "$this selectionChanged"
- $this config \
- -modal yes \
- -title "Delete Properties" \
- -okPressed "$this handleOk" \
- -cancelPressed "$this handleCancel"
-
- # End constructor user section
- return $this
- }
-
- method RmPropDialog::destructor {this} {
- # Start destructor user section
- [$this tool] releasePropContainers
- # End destructor user section
- }
-
- method RmPropDialog::popUp {this} {
- set contents ""
- set cntSet [[$this tool] propContainerSet]
- [$this containerSet] contents [$cntSet contents]
- $cntSet foreach cnt {
- lappend contents [$cnt propertyPresentation]
- }
- $this.list entrySet $contents
-
- $this selectionChanged
- $this TemplateDialog::popUp
- }
-
- method RmPropDialog::handleOk {this} {
- foreach index [$this.list selectedIndexSet] {
- [[$this containerSet] index $index] removeProperties
- }
- $this delete
- }
-
- method RmPropDialog::handleCancel {this} {
- $this delete
- }
-
- method RmPropDialog::selectionChanged {this} {
- if {[llength [$this.list selectedSet]] > 0} {
- set selected 1
- } else {
- set selected 0
- }
- $this okSensitive $selected
- $this okDefault $selected
- $this cancelDefault [expr 1 - $selected]
- }
-
- # Do not delete this line -- regeneration end marker
-
- method RmPropDialog::addContainer {this newContainer} {
- [$this containerSet] append $newContainer
-
- }
-
- method RmPropDialog::removeContainer {this oldContainer} {
- [$this containerSet] removeValue $oldContainer
- }
-
-