OptionBox.st
changeset 3211 54cb5fb7fd2f
parent 3208 7b4c5a215af9
child 3260 274ba11c1789
--- a/OptionBox.st	Thu Oct 06 17:38:16 2005 +0200
+++ b/OptionBox.st	Tue Oct 11 13:45:52 2005 +0200
@@ -105,10 +105,35 @@
                   request:('text has not been accepted.\\Your modifications will be lost when continuing.') withCRs
                   label:' Attention'
                   image:(WarningBox iconBitmap)
-                  buttonLabels:#('abort' 'accept' 'continue')
+                  buttonLabels:#('Abort' 'Accept' 'Continue')
                   values:#(#abort #accept #continue).
     Transcript showCR:what.
                                                                         [exEnd]
+
+
+ use callBack-hook to intercept creation:
+                                                                        [exBegin]
+    |what|
+
+    AboutToOpenBoxNotificationSignal handle:[:ex |
+        |box|
+
+        box := ex parameter.
+        box verticalPanel 
+            add:(CheckBox label:'Do no show this Dialog again.'
+                          model:false asValue).
+        ex proceed.
+    ] do:[
+        what := OptionBox 
+                      request:('bla bla bla bla.\\You must bla bla bla!!') withCRs
+                      label:' Attention'
+                      image:(WarningBox iconBitmap)
+                      buttonLabels:#('Abort' 'Accept' 'Continue')
+                      values:#(#abort #accept #continue)
+                      default:#continue.
+    ].
+    Transcript showCR:what.
+                                                                        [exEnd]
 "
 ! !
 
@@ -290,8 +315,7 @@
                 default:defaultValue.
 
     box action:[:n | retVal := values at:n].
-    box showAtPointer.
-    box destroy.
+    self showAndThenDestroyBox:box.
 
     ^ retVal
 
@@ -635,5 +659,5 @@
 !OptionBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.61 2005-10-05 11:35:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.62 2005-10-11 11:45:52 cg Exp $'
 ! !