equal
deleted
inserted
replaced
92 " |
92 " |
93 ! |
93 ! |
94 |
94 |
95 version |
95 version |
96 " |
96 " |
97 $Header: /cvs/stx/stx/libview2/Attic/LayoutOrg.st,v 1.6 1995-08-29 17:44:11 claus Exp $ |
97 $Header: /cvs/stx/stx/libview2/Attic/LayoutOrg.st,v 1.7 1995-09-09 02:29:45 claus Exp $ |
98 " |
98 " |
99 ! ! |
99 ! ! |
100 |
100 |
101 !LayoutOrigin class methodsFor:'instance creation'! |
101 !LayoutOrigin class methodsFor:'instance creation'! |
102 |
102 |
279 |
279 |
280 initialize |
280 initialize |
281 leftOffset := topOffset := 0. |
281 leftOffset := topOffset := 0. |
282 leftFraction := topFraction := 0. |
282 leftFraction := topFraction := 0. |
283 ! ! |
283 ! ! |
|
284 |
|
285 !LayoutOrigin methodsFor:'converting'! |
|
286 |
|
287 literalArrayEncoding |
|
288 "encode myself as an array. |
|
289 The encoding is: |
|
290 (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY) |
|
291 " |
|
292 |
|
293 ^ Array |
|
294 with:self class name asSymbol |
|
295 with:leftOffset |
|
296 with:leftFraction |
|
297 with:topOffset |
|
298 with:topFraction |
|
299 |
|
300 " |
|
301 LayoutOrigin new fromLiteralArrayEncoding:#(#LayoutOrigin 70 0 2 0) |
|
302 (LayoutOrigin new leftOffset:10; leftFraction:0.2; |
|
303 topOffset:20; topFraction:0.4) literalArrayEncoding |
|
304 " |
|
305 |
|
306 "Modified: 1.9.1995 / 02:43:48 / claus" |
|
307 ! |
|
308 |
|
309 fromLiteralArrayEncoding:encoding |
|
310 "read my values from an encoding. |
|
311 The encoding is supposed to be of the form: |
|
312 (#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY) |
|
313 This is the reverse operation to #literalArrayEncoding." |
|
314 |
|
315 leftOffset := encoding at:2. |
|
316 leftFraction := encoding at:3. |
|
317 topOffset := encoding at:4. |
|
318 topFraction := encoding at:5. |
|
319 |
|
320 |
|
321 " |
|
322 LayoutOrigin new fromLiteralArrayEncoding:#(#LayoutOrigin 70 0 2 0) |
|
323 " |
|
324 ! ! |
|
325 |