DialogBox.st
changeset 1949 f8a1dfee9935
parent 1898 fe4300f57e1a
child 2014 14397e93887e
--- a/DialogBox.st	Tue Jul 06 12:09:47 1999 +0200
+++ b/DialogBox.st	Wed Jul 07 14:18:37 1999 +0200
@@ -4757,34 +4757,69 @@
      This will keep the component at a constant distance from the bottom
      (without this setup, it would stay at a constant offset from the top)"
 
-    self resize.
-
-    aComponent
-	topInset:(self height - aComponent top) negated;
-	bottomInset:(self height - aComponent bottom); 
-	origin:0.0 @ 1.0; corner:1.0 @ 1.0.
+    self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0
 
     "
      compare the resizing behavior of:
 
-	|box|
-
-	box := Dialog new.
-	box addTextLabel:'hello'.
-	box addTextLabel:'hello2'.
-	box addOkButton.
-	box show
+        |box|
+
+        box := Dialog new.
+        box addTextLabel:'hello'.
+        box addTextLabel:'hello2'.
+        box addOkButton.
+        box show
 
      with:
 
-	|box l2|
-
-	box := Dialog new.
-	box addTextLabel:'hello'.
-	l2 := box addTextLabel:'hello2'.
-	box addOkButton.
-	box stickAtBottomWithFixHeight:l2.
-	box show
+        |box l2|
+
+        box := Dialog new.
+        box addTextLabel:'hello'.
+        l2 := box addTextLabel:'hello2'.
+        box addOkButton.
+        box stickAtBottomWithFixHeight:l2.
+        box show
+   "
+
+    "Created: 27.1.1996 / 17:17:41 / cg"
+    "Modified: 27.1.1996 / 18:29:03 / cg"
+!
+
+stickAtBottomWithFixHeight:aComponent left:left right:right
+    "arrange for a component to be positioned at a constant offset
+     from the bottom of the box and its height to remain the same.
+     This will keep the component at a constant distance from the bottom
+     (without this setup, it would stay at a constant offset from the top)"
+
+    self resize.
+
+    aComponent
+        topInset:(self height - aComponent top) negated;
+        bottomInset:(self height - aComponent bottom); 
+        origin:left @ 1.0; corner:right @ 1.0.
+
+    "
+     compare the resizing behavior of:
+
+        |box|
+
+        box := Dialog new.
+        box addTextLabel:'hello'.
+        box addTextLabel:'hello2'.
+        box addOkButton.
+        box show
+
+     with:
+
+        |box l2|
+
+        box := Dialog new.
+        box addTextLabel:'hello'.
+        l2 := box addTextLabel:'hello2'.
+        box addOkButton.
+        box stickAtBottomWithFixHeight:l2.
+        box show
    "
 
     "Created: 27.1.1996 / 17:17:41 / cg"
@@ -5989,6 +6024,6 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.135 1999-05-05 09:12:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.136 1999-07-07 12:18:37 cg Exp $'
 ! !
 DialogBox initialize!