--- a/DialogBox.st Tue Dec 12 18:38:01 1995 +0100
+++ b/DialogBox.st Wed Dec 13 17:30:35 1995 +0100
@@ -11,13 +11,13 @@
"
ModalBox subclass:#DialogBox
- instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction
- acceptReturnAsOK yPosition leftIndent rightIndent bindings
- addedComponents inputFieldGroup acceptOnLeave acceptValue
- tabableElements'
- classVariableNames:''
- poolDictionaries:''
- category:'Views-DialogBoxes'
+ instanceVariableNames:'buttonPanel okButton okAction abortButton abortAction
+ acceptReturnAsOK yPosition leftIndent rightIndent bindings
+ addedComponents inputFieldGroup acceptOnLeave acceptValue
+ tabableElements'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Views-DialogBoxes'
!
!DialogBox class methodsFor:'documentation'!
@@ -767,6 +767,27 @@
"
!
+confirm:aString yesLabel:yesText noLabel:noText
+ "launch a Dialog, which allows user to enter yes or no.
+ return true for yes, false for no.
+ The yes/no buttons labels are defined by yesText/noText."
+
+ |box answer|
+
+ box := YesNoBox title:aString.
+ box yesLabel:yesText; noLabel:noText.
+ box yesAction:[answer := true] noAction:[answer := false].
+ box showAtPointer.
+ box yesAction:nil noAction:nil.
+ ^ answer
+
+ "
+ Dialog confirm:'really ?' yesLabel:'oh well' noLabel:'nope'
+ "
+
+ "Modified: 13.12.1995 / 16:22:29 / cg"
+!
+
confirmWithCancel:aString
"launch a Dialog, which allows user to enter yes, no and cancel.
return true for 'yes', false for 'no', nil for 'cancel'"
@@ -1940,5 +1961,5 @@
!DialogBox class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.31 1995-12-07 22:15:09 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.32 1995-12-13 16:29:41 cg Exp $'
! !