home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
editseldia.tcl
< prev
next >
Wrap
Text File
|
1996-05-29
|
2KB
|
100 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)editseldia.tcl 1.7
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)editseldia.tcl 1.7 06 Mar 1996 Copyright 1994 Westmount Technology
# Start user added include file section
require wmt_util.tcl
# End user added include file section
Class EditSelDialog : {TemplateDialog} {
constructor
method destructor
method handleEdit
method handleHelp
method handleSelectionChanged
method popUp
method text
attribute entrySet
attribute editPressed
attribute message
}
constructor EditSelDialog {class this name} {
set this [TemplateDialog::constructor $class $this $name]
# Start constructor user section
interface DlgColumn $this.top {
Label message {}
ComboBox list {}
}
PushButton new $this.edit \
-label Edit \
-activated "$this handleEdit"
$this config \
-modal yes \
-helpPressed "$this handleHelp"
$this.top.list textModified "$this handleSelectionChanged"
# End constructor user section
return $this
}
method EditSelDialog::destructor {this} {
# Start destructor user section
# End destructor user section
}
method EditSelDialog::handleEdit {this} {
$this popDown
set doDelete [regsub -all "$this delete" "[$this okPressed]" "" okPressed]
eval $okPressed
eval [$this editPressed]
if $doDelete {
$this delete
}
}
method EditSelDialog::handleHelp {this} {
[getParent $this] helpOnName [nt_get_type $this]
}
method EditSelDialog::handleSelectionChanged {this} {
if {"[rmWhiteSpace [$this text]]" == ""} {
set selected 0
} else {
set selected 1
}
$this okSensitive $selected
$this okDefault $selected
$this cancelDefault [expr 1 - $selected]
$this.edit config \
-sensitive $selected \
-default 0
}
method EditSelDialog::popUp {this} {
$this.top.message text [$this message]
$this.top.list config \
-rowCount [llength [$this entrySet]] \
-entrySet [$this entrySet]
$this handleSelectionChanged
$this TemplateDialog::popUp
}
method EditSelDialog::text {this} {
return [$this.top.list text]
}
# Do not delete this line -- regeneration end marker