LayoutWrapper.st
changeset 292 60fbf13dfc8c
parent 278 f2382bb48850
child 321 6421da8810e2
--- a/LayoutWrapper.st	Wed Jun 05 17:22:58 1996 +0200
+++ b/LayoutWrapper.st	Wed Jun 05 17:28:29 1996 +0200
@@ -5,6 +5,32 @@
 	category:'Graphics-Display Objects'
 !
 
+!LayoutWrapper class methodsFor:'documentation'!
+
+examples
+"
+                                                                        [exBegin]
+    |t view wrapper|
+
+    t := StandardSystemView extent:200@200.
+
+    view := View new.
+    view viewBackground:Color red.
+
+    wrapper := LayoutWrapper new.
+    wrapper layout:(LayoutFrame new
+                        leftFraction:0.2;
+                        rightFraction:0.8;
+                        topFraction:0.2;
+                        bottomFraction:0.8).
+    wrapper component:view.
+
+    t addComponent:wrapper.
+
+    t open
+                                                                        [exEnd]
+"
+! !
 
 !LayoutWrapper class methodsFor:'instance creation'!
 
@@ -34,15 +60,30 @@
 !
 
 layout:something
-    "set layout"
+    "set the layout"
 
     layout := something.
 
     "Created: 26.5.1996 / 16:18:11 / cg"
+    "Modified: 5.6.1996 / 13:58:55 / cg"
+! !
+
+!LayoutWrapper methodsFor:'view protocol mimicri'!
+
+containerChangedSize
+    "my container changed its size.
+     Resize my component according the layout spec"
+
+    layout notNil ifTrue:[
+        self bounds:(layout rectangleRelativeTo:(container viewRectangle)
+                                      preferred:(self preferredBounds)) rounded
+    ]
+
+    "Modified: 5.6.1996 / 02:32:01 / cg"
 ! !
 
 !LayoutWrapper class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/LayoutWrapper.st,v 1.1 1996-05-28 22:43:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/LayoutWrapper.st,v 1.2 1996-06-05 15:28:29 cg Exp $'
 ! !