LayoutFrm.st
changeset 100 0300e64bb883
parent 96 948318b2fbd4
child 114 e577a2f332d0
equal deleted inserted replaced
99:a656b0c9dd21 100:0300e64bb883
   108 "
   108 "
   109 !
   109 !
   110 
   110 
   111 version
   111 version
   112 "
   112 "
   113 $Header: /cvs/stx/stx/libview2/Attic/LayoutFrm.st,v 1.7 1995-08-29 17:44:07 claus Exp $
   113 $Header: /cvs/stx/stx/libview2/Attic/LayoutFrm.st,v 1.8 1995-09-09 02:29:42 claus Exp $
   114 "
   114 "
   115 ! !
   115 ! !
   116 
   116 
   117 !LayoutFrame methodsFor:'accessing'!
   117 !LayoutFrame methodsFor:'accessing'!
   118 
   118 
   255 initialize
   255 initialize
   256     leftOffset := rightOffset := bottomOffset := topOffset := 0.
   256     leftOffset := rightOffset := bottomOffset := topOffset := 0.
   257     leftFraction := topFraction := 0.
   257     leftFraction := topFraction := 0.
   258     bottomFraction := rightFraction := 1.
   258     bottomFraction := rightFraction := 1.
   259 ! !
   259 ! !
       
   260 
       
   261 !LayoutFrame methodsFor:'converting'!
       
   262 
       
   263 literalArrayEncoding
       
   264     "encode myself as an array.
       
   265      The encoding is: 
       
   266 	(#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)"
       
   267 
       
   268     ^ super literalArrayEncoding
       
   269       , (Array
       
   270 	    with:rightOffset
       
   271 	    with:rightFraction
       
   272 	    with:bottomOffset
       
   273 	    with:bottomFraction)
       
   274 
       
   275     "Modified: 1.9.1995 / 02:43:35 / claus"
       
   276 !
       
   277 
       
   278 fromLiteralArrayEncoding:encoding
       
   279     "read my values from an encoding.
       
   280      The encoding is supposed to be of the form: 
       
   281 	(LayoutFrame orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)
       
   282      This is the reverse to literalArrayEncoding."
       
   283 
       
   284     leftOffset := encoding at:2.
       
   285     leftFraction := encoding at:3.
       
   286     topOffset := encoding at:4.
       
   287     topFraction := encoding at:5.
       
   288     rightOffset := encoding at:6.
       
   289     rightFraction := encoding at:7.
       
   290     bottomOffset := encoding at:8.
       
   291     bottomFraction := encoding at:9.
       
   292 
       
   293     "
       
   294       LayoutFrame new fromLiteralArrayEncoding:#(#LayoutFrame 70 0 2 0 0 1 25 0 )
       
   295       #(#LayoutFrame 70 0 2 0 0 1 25 0 ) decodeAsLiteralArray 
       
   296     "
       
   297 ! !