diff -r eb2f9e689f5e -r c14a2460b698 DialogBox.st --- a/DialogBox.st Wed Oct 14 18:18:11 1998 +0200 +++ b/DialogBox.st Wed Oct 21 15:50:45 1998 +0200 @@ -1353,14 +1353,39 @@ The default argument (if non-nil) defines the index of the return button (1 to 3)" + ^ self + confirmWithCancel:aString + labels:buttonLabels + values:#(nil false true) + default:default + + " + Transcript showCR:( + Dialog + confirmWithCancel:'really ?' + labels:#('mhmh' 'maybe' 'definitely') + default:3 + ) + " + + "Created: / 18.10.1996 / 14:50:51 / cg" + "Modified: / 21.10.1998 / 15:49:16 / cg" +! + +confirmWithCancel:aString labels:buttonLabels values:buttonValues default:default + "launch a Dialog, which allows user to click on any button. + Return the corresponding value from the values array. + The labels for for the buttons are to be passed in + buttonLabels; + The default argument (if non-nil) defines the index of the + return button (1 to n)" + |box answer| box := OptionBox title:aString numberOfOptions:3. box buttonTitles:buttonLabels - actions:(Array with:[answer := nil] - with:[answer := false] - with:[answer := true] - ). + actions:(buttonValues collect:[:v | [answer := v]]). + default notNil ifTrue:[box defaultButtonIndex:default]. box label:(self classResources string:'confirm'). box showAtPointer. @@ -1369,14 +1394,17 @@ ^ answer " - Dialog - confirmWithCancel:'really ?' - labels:#('mhmh' 'maybe' 'definitely') - default:3 - " - - "Created: 18.10.1996 / 14:50:51 / cg" - "Modified: 14.11.1996 / 16:06:23 / cg" + Transcript showCR:( + Dialog + confirmWithCancel:'really ?' + labels:#('mhmh' 'maybe' 'definitely') + values:#(1 2 3) + default:3 + ) + " + + "Created: / 18.10.1996 / 14:50:51 / cg" + "Modified: / 21.10.1998 / 15:48:33 / cg" ! ! !DialogBox class methodsFor:'defaults'! @@ -5792,6 +5820,6 @@ !DialogBox class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.121 1998-10-09 14:14:40 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.122 1998-10-21 13:50:45 cg Exp $' ! ! DialogBox initialize!