home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)classselha.tcl /main/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)classselha.tcl /main/2 12 Jun 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class ClassSelHandler : {ListDialog} {
- constructor
- method destructor
- method handle
- method handleOkPressed
- method popUp
- method addClass
- method removeClass
- attribute command
- attribute classSet
- }
-
- constructor ClassSelHandler {class this name} {
- set this [ListDialog::constructor $class $this $name]
- $this classSet [List new]
- # Start constructor user section
- $this config \
- -okPressed {%this handleOkPressed} \
- -helpPressed ".main helpOnName selectClass" \
- -selectionPolicy BROWSE \
- -rowCount 4 \
- -font "courier-normal-12"
- # End constructor user section
- return $this
- }
-
- method ClassSelHandler::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method ClassSelHandler::handle {this entry} {
- [$this classSet] contents ""
- $entry collectClasses [$this classSet]
- [$this classSet] contents [lrmdoubles [[$this classSet] contents]]
- if {[llength [[$this classSet] contents]] == 0} {
- wmtkerror "Cannot '[$this command]':\
- no class found in selected entry"
- return
- }
- if {[llength [[$this classSet] contents]] == 1} {
- [[$this classSet] index] [$this command]
- return
- }
- $this popUp
- }
-
- method ClassSelHandler::handleOkPressed {this} {
- set idx [lsearch [$this entrySet] [lindex [$this selectedSet] 0]]
- if {$idx != -1} {
- [lindex [[$this classSet] contents] $idx] [$this command]
- }
- }
-
- method ClassSelHandler::popUp {this} {
- set entrySet ""
- [$this classSet] foreach entry {
- lappend entrySet [$entry format]
- }
- $this entrySet $entrySet
- $this ListDialog::popUp
- }
-
- # Do not delete this line -- regeneration end marker
-
- method ClassSelHandler::addClass {this newClass} {
- [$this classSet] append $newClass
-
- }
-
- method ClassSelHandler::removeClass {this oldClass} {
- [$this classSet] removeValue $oldClass
- }
-
-