home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
workitemse.tcl
< prev
next >
Wrap
Text File
|
1996-11-07
|
4KB
|
140 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1996
#
# File: @(#)workitemse.tcl /main/titanic/1
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)workitemse.tcl /main/titanic/1 7 Nov 1996 Copyright 1996 Cadre Technologies Inc.
# Start user added include file section
# End user added include file section
Class WorkItemSelHandler : {ListDialog} {
constructor
method destructor
method handle
method handleOkPressed
method popUp
method showScope
method addWorkItem
method removeWorkItem
attribute command
attribute workItemSet
}
constructor WorkItemSelHandler {class this name} {
set this [ListDialog::constructor $class $this $name]
$this workItemSet [List new]
# Start constructor user section
$this config \
-okPressed {%this handleOkPressed} \
-helpPressed ".main helpOnName selectItem" \
-selectionPolicy BROWSE \
-rowCount 4 \
-font "courier-normal-12"
# End constructor user section
return $this
}
method WorkItemSelHandler::destructor {this} {
# Start destructor user section
# End destructor user section
}
method WorkItemSelHandler::handle {this entry} {
[$this workItemSet] contents ""
$entry collectWorkItems [$this workItemSet]
[$this workItemSet] contents [lrmdoubles [[$this workItemSet] contents]]
if {[llength [[$this workItemSet] contents]] == 0} {
wmtkerror "Cannot '[$this command]':\
no WorkItem found in selected entry"
return
}
if {[llength [[$this workItemSet] contents]] == 1} {
$this [$this command] [[$this workItemSet] index]
return
}
$this popUp
}
method WorkItemSelHandler::handleOkPressed {this} {
set idx [lsearch [$this entrySet] [lindex [$this selectedSet] 0]]
if {$idx != -1} {
$this [$this command] \
[lindex [[$this workItemSet] contents] $idx]
}
}
method WorkItemSelHandler::popUp {this} {
set entrySet ""
[$this workItemSet] foreach workItem {
lappend entrySet [$workItem name]
}
$this entrySet $entrySet
$this ListDialog::popUp
}
method WorkItemSelHandler::showScope {this workItem} {
global classCount
set box .main.showScopeDialog$classCount
incr classCount
interface TemplateDialog $box {
title "Show Scope"
DlgColumn col {}
helpPressed {.main helpOnName showScope}
okPressed {%this delete}
}
$box modal $win95
$box delCancelButton
set tuples [list \
[list Name "[$workItem name]"] \
[list Type "[$workItem type]"] \
[list Scope "[$workItem scope]"] \
]
set qualifier [[$workItem item] qualifier]
if {! [$qualifier isNil]} {
lappend tuples [list "Qualified By" "[$qualifier name]"]
}
set lineCnt 0
foreach tuple $tuples {
DlgRow new $box.col.row$lineCnt \
-spaceType NONE \
-justification RIGHT
Label new $box.col.row$lineCnt.header \
-text "[lindex $tuple 0]:" \
-alignment RIGHT \
-horStretchFactor 10 \
-justification TOP \
-font "courier-bold-12"
DlgColumn new $box.col.row$lineCnt.col
set breakUpCnt 0
foreach part [lineBreak [lindex $tuple 1] 25 " "] {
set text [format "%-25s" $part]
Label new $box.col.row$lineCnt.col.label$breakUpCnt \
-text $text \
-font "courier-normal-12"
incr breakUpCnt
}
incr lineCnt
}
$box popUp
}
# Do not delete this line -- regeneration end marker
method WorkItemSelHandler::addWorkItem {this newWorkItem} {
[$this workItemSet] append $newWorkItem
}
method WorkItemSelHandler::removeWorkItem {this oldWorkItem} {
[$this workItemSet] removeValue $oldWorkItem
}