#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Tue, 30 Apr 2019 10:45:36 +0200
changeset 4257 2f858dbfd25b
parent 4256 8ec6b049e7ac
child 4258 5fc4985b0d74
#DOCUMENTATION by cg class: BlockValue class comment/format in: #documentation #examples
BlockValue.st
--- a/BlockValue.st	Sat Apr 20 09:07:20 2019 +0200
+++ b/BlockValue.st	Tue Apr 30 10:45:36 2019 +0200
@@ -41,13 +41,17 @@
 
 documentation
 "
-    BlockValues depend on multiple other objects (typically valueHolders)
+    BlockValues depend on one or more other objects (typically valueHolders)
     and recompute a value whenever one of them changes.
-    If the new value is different, it triggers itself a change to its dependents.
+    If the recomputed new value is different, it triggers itself a change to its dependents.
 
-    Example use is to base an enableChannels value on multiple other boolean values.
-    (See example for how this is done)
+    A typical example use is to base an enableChannel's value on multiple other 
+    boolean (or non-boolean) values. (See example for how this is done)
 
+    Notice, that a BlockValue can also be created without depending on any other
+    object (i.e. BlockValue with:aBlock). In this case, a recomputation must be explicitly
+    triggered by sending #recomputeValue to the blockValue instance.
+    
     Notice: 
         this class was implemented using protocol information
         from alpha testers - it may not be complete or compatible to
@@ -176,6 +180,22 @@
         (box addOkButton) enableChannel:anyValue.
         box open
                                                                         [exEnd]
+    a logical-not block:
+                                                                        [exBegin]
+        |val1 valNot box|
+
+        val1 := false asValue.
+        valNot := BlockValue forLogicalNot:val1.
+
+        box := Dialog new.
+        box addCheckBox:'one' on:val1.
+        box addHorizontalLine.
+        (box addCheckBox:'not one' on:valNot) enabled:false
+        box addOkButton.
+        box open
+                                                                        [exEnd]
+
+
 "
 ! !