home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
roundtripd.tcl
< prev
next >
Wrap
Text File
|
1997-08-27
|
5KB
|
182 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)roundtripd.tcl /main/titanic/6
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)roundtripd.tcl /main/titanic/6 27 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
Class RoundtripDlg : {TemplateDialog} {
constructor
method destructor
method qaFinished
method qaDataArrived
method sendAnswer
method handleYes
method handleNo
method handleDefaultToAll
method handleStop
method setButtonsSensitivity
method popUp
attribute qa
attribute command
attribute answerDefaultToAll
attribute defaultAnswer
}
constructor RoundtripDlg {class this name} {
set this [TemplateDialog::constructor $class $this $name]
$this command ""
$this answerDefaultToAll 0
$this defaultAnswer ""
# Start constructor user section
$this qa [QAServer new \
-mode BLOCK \
-finished "$this qaFinished" \
-dataArrived "$this qaDataArrived"]
$this config \
-title "Roundtrip Selected Files" \
-modal yes \
-helpPressed {.main helpOnName roundtripEngineer}
interface NamedGroup $this.grp {
label "Interactive Roundtrip Session"
DlgColumn dc {
MultiLineText out {
editable false
columnCount 60
rowCount 15
}
DlgColumn dc {
sizeEqual yes
verStretchFactor 0
DlgRow yesNoRow {
sizeEqual yes
verStretchFactor 0
PushButton yesButton {
sensitive no
label "Yes"
}
PushButton noButton {
sensitive no
label "No"
}
PushButton defaultAllButton {
sensitive no
label "Default To All"
}
PushButton stopButton {
sensitive no
label "Stop"
}
}
}
}
}
$this.grp.dc.out font [m4_var get M4_font -context desk]
set buttons $this.grp.dc.dc.yesNoRow
$buttons.yesButton activated "$this handleYes"
$buttons.noButton activated "$this handleNo"
$buttons.defaultAllButton activated "$this handleDefaultToAll"
$buttons.stopButton activated "$this handleStop"
$this okSensitive no
$this delCancelButton
# End constructor user section
return $this
}
method RoundtripDlg::destructor {this} {
# Start destructor user section
# End destructor user section
}
method RoundtripDlg::qaFinished {this} {
$this setButtonsSensitivity no
$this okSensitive yes
}
method RoundtripDlg::qaDataArrived {this} {
set data [[$this qa] data]
if [regexp -nocase {(.*)QUESTION ((YES)|(NO)) (.*)$} $data matchVar \
pre yesNo yesTxt noTxt quest] {
$this.grp.dc.out appendText $pre
$this.grp.dc.out appendText "$quest "
$this defaultAnswer $yesNo
if [$this answerDefaultToAll] {
$this sendAnswer [cap $yesNo]
} else {
$this setButtonsSensitivity yes
}
} else {
$this.grp.dc.out appendText $data
}
}
method RoundtripDlg::sendAnswer {this answer} {
if {$tcl_platform(platform) == "windows"} {
# Need to echo the answer ourselves
$this.grp.dc.out appendText "${answer}\n"
}
puts [[$this qa] chan] $answer
}
method RoundtripDlg::handleYes {this} {
$this sendAnswer "Yes"
$this setButtonsSensitivity no
}
method RoundtripDlg::handleNo {this} {
$this sendAnswer "No"
$this setButtonsSensitivity no
}
method RoundtripDlg::handleDefaultToAll {this} {
$this sendAnswer [cap [$this defaultAnswer]]
$this answerDefaultToAll 1
$this setButtonsSensitivity no
}
method RoundtripDlg::handleStop {this} {
$this sendAnswer "Stop"
$this setButtonsSensitivity no
}
method RoundtripDlg::setButtonsSensitivity {this value} {
set buttons $this.grp.dc.dc.yesNoRow
$buttons.yesButton sensitive $value
$buttons.noButton sensitive $value
$buttons.defaultAllButton sensitive $value
$buttons.stopButton sensitive $value
}
method RoundtripDlg::popUp {this} {
# (re)initialize data; note that the following is already taken care
# off at this point:
# $this setButtonsSensitivity no
#
$this.grp.dc.out text ""
$this answerDefaultToAll 0
$this okSensitive no
[$this qa] command [$this command]
# popUp the dialog en start a QA session
#
$this TemplateDialog::popUp
[$this qa] execute
}
# Do not delete this line -- regeneration end marker