--- a/LayoutOrg.st Wed Aug 30 19:54:43 1995 +0200
+++ b/LayoutOrg.st Sat Sep 09 04:30:16 1995 +0200
@@ -94,7 +94,7 @@
version
"
-$Header: /cvs/stx/stx/libview2/Attic/LayoutOrg.st,v 1.6 1995-08-29 17:44:11 claus Exp $
+$Header: /cvs/stx/stx/libview2/Attic/LayoutOrg.st,v 1.7 1995-09-09 02:29:45 claus Exp $
"
! !
@@ -281,3 +281,45 @@
leftOffset := topOffset := 0.
leftFraction := topFraction := 0.
! !
+
+!LayoutOrigin methodsFor:'converting'!
+
+literalArrayEncoding
+ "encode myself as an array.
+ The encoding is:
+ (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY)
+ "
+
+ ^ Array
+ with:self class name asSymbol
+ with:leftOffset
+ with:leftFraction
+ with:topOffset
+ with:topFraction
+
+ "
+ LayoutOrigin new fromLiteralArrayEncoding:#(#LayoutOrigin 70 0 2 0)
+ (LayoutOrigin new leftOffset:10; leftFraction:0.2;
+ topOffset:20; topFraction:0.4) literalArrayEncoding
+ "
+
+ "Modified: 1.9.1995 / 02:43:48 / claus"
+!
+
+fromLiteralArrayEncoding:encoding
+ "read my values from an encoding.
+ The encoding is supposed to be of the form:
+ (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY)
+ This is the reverse operation to #literalArrayEncoding."
+
+ leftOffset := encoding at:2.
+ leftFraction := encoding at:3.
+ topOffset := encoding at:4.
+ topFraction := encoding at:5.
+
+
+ "
+ LayoutOrigin new fromLiteralArrayEncoding:#(#LayoutOrigin 70 0 2 0)
+ "
+! !
+