examples
authorClaus Gittinger <cg@exept.de>
Thu, 16 May 1996 12:02:53 +0200
changeset 644 dbb02e0858fa
parent 643 89c06c80ff2a
child 645 f6ef83a129e1
examples
DialogBox.st
WarnBox.st
WarningBox.st
--- a/DialogBox.st	Tue May 14 18:46:27 1996 +0200
+++ b/DialogBox.st	Thu May 16 12:02:53 1996 +0200
@@ -717,11 +717,11 @@
 
         vPanel1 := VerticalPanelView origin:0.0@0.0 corner:0.5@1.0 in:frame.
         vPanel1 horizontalLayout:#leftSpace.
-        vPanel1 verticalLayout:#top.
+        vPanel1 verticalLayout:#spreadSpace.
 
         vPanel2 := VerticalPanelView origin:0.5@0.0 corner:1.0@1.0 in:frame.
         vPanel2 horizontalLayout:#leftSpace.
-        vPanel2 verticalLayout:#top.
+        vPanel2 verticalLayout:#spreadSpace.
 
         m1 := true asValue.
         m2 := true asValue.
@@ -853,7 +853,7 @@
         ]
                                                                         [exEnd]
       an example from Hopkins/Horan:  
-                                                                        [exbegin]
+                                                                        [exBegin]
         |aText index|
 
         aText := 'Smalltalk/X: An Introduction to Application Development' asText.
@@ -865,11 +865,11 @@
         aText emphasizeFrom:index 
                          to:'Introduction' size + index - 1
                        with:#italic.
-        DialogView warn:aText        
+        Dialog warn:aText        
         
                                                                         [exEnd]
       the same, with colors:  
-                                                                        [exbegin]
+                                                                        [exBegin]
         |aText index|
 
         aText := 'Smalltalk/X: An Introduction to Application Development' asText.
@@ -881,7 +881,7 @@
         aText emphasizeFrom:index 
                          to:'Introduction' size + index - 1
                        with:#italic.
-        DialogView warn:aText        
+        Dialog warn:aText        
                                                                         [exEnd]
 "
 !
@@ -4471,6 +4471,6 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.69 1996-05-12 14:12:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.70 1996-05-16 10:02:53 cg Exp $'
 ! !
 DialogBox initialize!
--- a/WarnBox.st	Tue May 14 18:46:27 1996 +0200
+++ b/WarnBox.st	Thu May 16 12:02:53 1996 +0200
@@ -81,7 +81,25 @@
 
 examples
 "
-    Examples:
+    standard warning dialogs
+    (recommended, since these are ST-80 compatible interfaces)
+                                                                        [exBegin]
+        Dialog warn:'you should not do this'
+                                                                        [exEnd]
+    since all objects support the #warn message,
+    you can also simply use (for any self):
+                                                                        [exBegin]
+        self warn:'you should not do this' 
+                                                                        [exEnd]
+
+    with attributed text:
+                                                                        [exBegin]
+        Dialog warn:(Text string:'you should not do this' 
+                          emphasis:#color->Color red)
+                                                                        [exEnd]
+        
+    specifying more details of the warnBox (low level entries).
+    label of OK-button:
                                                                         [exBegin]
         |aBox|
 
@@ -89,14 +107,25 @@
         aBox okText:'OK'.
         aBox showAtPointer.
                                                                         [exEnd]
+
+    accessing the ok-Button component and changing its color:
+                                                                        [exBegin]
+        |aBox|
+
+        aBox := WarningBox title:'Do you really want to do this ?'.
+        aBox okText:'yes, go on'.
+        aBox okButton foregroundColor:Color red.
+        aBox showAtPointer.
+                                                                        [exEnd]
     since warnboxes are much like infoBoxes, all of look can be changed
     like described there:
                                                                         [exBegin]
-        |aBox|
+        |image aBox|
 
         aBox := WarningBox title:'Press ''OK'' to continue'.
         aBox okText:'yes, continue'.
-        aBox form:(Image fromFile:'bitmaps/SmalltalkX.xbm').
+        image := Image fromFile:'bitmaps/SmalltalkX.xbm'.
+        aBox form:image.
         aBox showAtPointer.
                                                                         [exEnd]
 "
@@ -177,5 +206,5 @@
 !WarningBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/WarnBox.st,v 1.18 1996-04-27 18:16:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/WarnBox.st,v 1.19 1996-05-16 10:02:21 cg Exp $'
 ! !
--- a/WarningBox.st	Tue May 14 18:46:27 1996 +0200
+++ b/WarningBox.st	Thu May 16 12:02:53 1996 +0200
@@ -81,7 +81,25 @@
 
 examples
 "
-    Examples:
+    standard warning dialogs
+    (recommended, since these are ST-80 compatible interfaces)
+                                                                        [exBegin]
+        Dialog warn:'you should not do this'
+                                                                        [exEnd]
+    since all objects support the #warn message,
+    you can also simply use (for any self):
+                                                                        [exBegin]
+        self warn:'you should not do this' 
+                                                                        [exEnd]
+
+    with attributed text:
+                                                                        [exBegin]
+        Dialog warn:(Text string:'you should not do this' 
+                          emphasis:#color->Color red)
+                                                                        [exEnd]
+        
+    specifying more details of the warnBox (low level entries).
+    label of OK-button:
                                                                         [exBegin]
         |aBox|
 
@@ -89,14 +107,25 @@
         aBox okText:'OK'.
         aBox showAtPointer.
                                                                         [exEnd]
+
+    accessing the ok-Button component and changing its color:
+                                                                        [exBegin]
+        |aBox|
+
+        aBox := WarningBox title:'Do you really want to do this ?'.
+        aBox okText:'yes, go on'.
+        aBox okButton foregroundColor:Color red.
+        aBox showAtPointer.
+                                                                        [exEnd]
     since warnboxes are much like infoBoxes, all of look can be changed
     like described there:
                                                                         [exBegin]
-        |aBox|
+        |image aBox|
 
         aBox := WarningBox title:'Press ''OK'' to continue'.
         aBox okText:'yes, continue'.
-        aBox form:(Image fromFile:'bitmaps/SmalltalkX.xbm').
+        image := Image fromFile:'bitmaps/SmalltalkX.xbm'.
+        aBox form:image.
         aBox showAtPointer.
                                                                         [exEnd]
 "
@@ -177,5 +206,5 @@
 !WarningBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.18 1996-04-27 18:16:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/WarningBox.st,v 1.19 1996-05-16 10:02:21 cg Exp $'
 ! !