--- a/DialogBox.st Fri Mar 08 14:45:20 1996 +0100
+++ b/DialogBox.st Fri Mar 08 21:20:18 1996 +0100
@@ -765,6 +765,14 @@
"
! !
+!DialogBox class methodsFor:'class initialization'!
+
+initialize
+ Dialog := self
+
+ "Created: 8.3.1996 / 21:18:54 / cg"
+! !
+
!DialogBox class methodsFor:'common dialogs'!
information:aString
@@ -793,14 +801,20 @@
"launch a Dialog, which allows user to enter yes or no.
return true for yes, false for no"
- |box answer|
-
- box := YesNoBox title:aString.
- box label:(self classResources string:'Confirm').
- box yesAction:[answer := true] noAction:[answer := false].
- box showAtPointer.
- box yesAction:nil noAction:nil.
- ^ answer
+ ^ self
+ confirm:aString
+ title:nil
+ yesLabel:nil
+ noLabel:nil
+
+"/ |box answer|
+"/
+"/ box := YesNoBox title:aString.
+"/ box label:(self classResources string:'Confirm').
+"/ box yesAction:[answer := true] noAction:[answer := false].
+"/ box showAtPointer.
+"/ box yesAction:nil noAction:nil.
+"/ ^ answer
"
Dialog confirm:'really ?'
@@ -810,7 +824,7 @@
)
"
- "Modified: 27.2.1996 / 01:17:54 / cg"
+ "Modified: 8.3.1996 / 21:16:54 / cg"
!
confirm:aString initialAnswer:what
@@ -847,7 +861,7 @@
"Modified: 27.1.1996 / 14:24:39 / cg"
!
-confirm:aString yesLabel:yesText noLabel:noText
+confirm:aString title:title 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."
@@ -855,18 +869,45 @@
|box answer|
box := YesNoBox title:aString.
- box yesLabel:yesText; noLabel:noText.
+ yesText notNil ifTrue:[
+ box yesLabel:yesText.
+ ].
+ noText notNil ifTrue:[
+ box noLabel:noText.
+ ].
box yesAction:[answer := true] noAction:[answer := false].
+ title notNil ifTrue:[
+ box label:title
+ ].
box showAtPointer.
box yesAction:nil noAction:nil.
^ answer
"
+ Dialog
+ confirm:'really ?'
+ title:'fooBar'
+ yesLabel:'oh well'
+ noLabel:'nope'
+ "
+
+ "Created: 21.2.1996 / 01:10:14 / cg"
+ "Modified: 8.3.1996 / 21:15:56 / cg"
+!
+
+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."
+
+ ^ self confirm:aString title:nil yesLabel:yesText noLabel:noText
+
+ "
Dialog confirm:'really ?' yesLabel:'oh well' noLabel:'nope'
"
"Created: 21.2.1996 / 01:10:14 / cg"
- "Modified: 21.2.1996 / 01:34:55 / cg"
+ "Modified: 8.3.1996 / 21:15:06 / cg"
!
confirmWithCancel:aString
@@ -3765,5 +3806,6 @@
!DialogBox class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.53 1996-03-07 12:35:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.54 1996-03-08 20:20:18 cg Exp $'
! !
+DialogBox initialize!