DialogBox.st
changeset 4777 317cf814c9c4
parent 4690 8d29570eaa36
child 4839 c13bf8da0039
--- a/DialogBox.st	Wed Sep 18 15:23:11 2013 +0200
+++ b/DialogBox.st	Thu Sep 19 13:06:59 2013 +0200
@@ -8174,6 +8174,37 @@
 
     "Created: 28.2.1996 / 15:16:34 / cg"
     "Modified: 4.3.1996 / 17:23:38 / cg"
+!
+
+addTriggerBox:label action:aBlock
+    "create a triggerBox with label and action and add it.
+     Returns the box."
+
+    |b|
+
+    b := TriggerBox new action:aBlock.
+    b label:label.
+    self addComponent:b tabable:false.
+    ^ b
+
+    "
+     |dialog trigger1 trigger2 trigger3|
+
+     trigger1 := true asValue.
+     trigger2 := false asValue.
+     trigger3 := true asValue.
+
+     dialog := DialogBox new.
+     dialog addTriggerBox:'go' action:[Transcript showCR:'1'].
+     dialog addHorizontalLine.
+
+     dialog addTriggerBox:'go go' action:[Transcript showCR:'2'].
+     dialog addTriggerBox:'trigger' action:[Transcript showCR:'3'].
+     dialog addOkButton.
+     dialog open.
+    "
+
+    "Modified: 9.2.1996 / 22:16:49 / cg"
 ! !
 
 !DialogBox methodsFor:'construction-inputfields'!
@@ -9993,11 +10024,11 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.344 2013-08-29 14:40:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.345 2013-09-19 11:06:59 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.344 2013-08-29 14:40:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.345 2013-09-19 11:06:59 cg Exp $'
 ! !