AlignOrg.st
changeset 93 f2389560b8eb
parent 88 f8a41aa4b34b
child 94 8888ddd11323
--- a/AlignOrg.st	Sun Aug 27 16:41:00 1995 +0200
+++ b/AlignOrg.st	Tue Aug 29 18:13:19 1995 +0200
@@ -1,6 +1,6 @@
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -22,7 +22,7 @@
 copyright
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -33,9 +33,83 @@
 "
 !
 
+documentation
+"
+    This class is provided to make porting of existing ST-80 applications
+    easier. Instances can be used to control the geometry of a subview, within
+    its superview. Like a LayoutOrigin, it controls the components origin
+    via a relative part plus offset. However, in contrast to LayoutOrigin
+    (in which the top-left corner is specified by fraction+offset, here any
+    reference point within the component is positioned.
+    The reference point itself is specified as fraction of the components size.
+
+    See also:
+	LayoutOrigin LayoutFrame Layout
+
+    Notice: this class was implemented using protocol information
+    from alpha testers - it may not be complete or compatible to
+    the corresponding ST-80 class. If you encounter any incompatibilities,
+    please forward a note to the ST/X team.
+!
+
+examples
+"
+    using a LayoutOrigin, to control the top-left origins position of
+    a component (i.e. origin at:0.5@0.5):
+
+	|top button|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+
+	button := Button label:'component'.
+	top add:button in:(LayoutOrigin new
+				leftFraction:0.5;
+				topFraction:0.5).
+
+	top open
+
+
+    using an AlignmentOrigin, to control the centers position of
+    a component (i.e. center of component at:0.5@0.5):
+
+	|top button|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+
+	button := Button label:'component'.
+	top add:button in:(AlignmentOrigin new
+				leftFraction:0.5;
+				topFraction:0.5;
+				leftAlignmentFraction:0.5;
+				topAlignmentFraction:0.5).
+
+	top open
+
+
+    using an AlignmentOrigin, to control the bottom-right position of
+    a component (i.e. bottom-right of component at:0.5@0.5):
+
+	|top button|
+
+	top := StandardSystemView new.
+	top extent:300@300.
+
+	button := Button label:'component'.
+	top add:button in:(AlignmentOrigin new
+				leftFraction:0.5;
+				topFraction:0.5;
+				leftAlignmentFraction:1.0;
+				topAlignmentFraction:1.0).
+
+	top open
+"
+!
+
 version
 "
-$Header: /cvs/stx/stx/libview2/Attic/AlignOrg.st,v 1.2 1995-08-10 18:43:06 claus Exp $
+$Header: /cvs/stx/stx/libview2/Attic/AlignOrg.st,v 1.3 1995-08-29 16:13:05 claus Exp $
 "
 ! !