author | fm |
Fri, 15 Sep 2006 16:30:57 +0200 | |
changeset 2221 | 52803ae96560 |
parent 2123 | 5247deafa7ef |
child 2618 | fb52a0f3e1e8 |
permissions | -rw-r--r-- |
88 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
93 | 3 |
All Rights Reserved |
88 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
1594 | 13 |
"{ Package: 'stx:libview2' }" |
14 |
||
77 | 15 |
LayoutOrigin subclass:#LayoutFrame |
191 | 16 |
instanceVariableNames:'rightFraction bottomFraction rightOffset bottomOffset' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Graphics-Geometry' |
|
77 | 20 |
! |
21 |
||
88 | 22 |
!LayoutFrame class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
93 | 27 |
All Rights Reserved |
88 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
93 | 38 |
documentation |
39 |
" |
|
40 |
This class is provided to make porting of existing ST-80 applications |
|
41 |
easier. Instances can be used to control the geometry of a subview, within |
|
42 |
its superview. Like a layoutOrigin, it controls the origin of a component |
|
43 |
by given fraction and offset dimensions; in addition, the bottom-right |
|
44 |
corner is also controlled by corresponding values. Therefore, the components |
|
45 |
preferredExtent is ignored. |
|
46 |
||
47 |
See also: |
|
219 | 48 |
LayoutOrigin AlignmentOrigin Layout |
93 | 49 |
|
229 | 50 |
Notice: |
51 |
this class was implemented using protocol information |
|
52 |
from alpha testers - it may not be complete or compatible to |
|
53 |
the corresponding ST-80 class. |
|
54 |
If you encounter any incompatibilities, please forward a note |
|
55 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
219 | 56 |
|
57 |
[author:] |
|
58 |
Claus Gittinger |
|
229 | 59 |
|
60 |
[see also:] |
|
61 |
View |
|
62 |
LayoutOrigin AlignmentOrigin Layout |
|
63 |
Rectangle Point |
|
94 | 64 |
" |
93 | 65 |
! |
66 |
||
67 |
examples |
|
68 |
" |
|
229 | 69 |
Although the examples below use a button as component, |
70 |
they work of course with any type of subview .... |
|
71 |
||
93 | 72 |
|
229 | 73 |
arrange for the button to be in 0.25 @ 0.25 -> 0.75 @ 0.75. |
74 |
This is the same as with relative origin/corner. |
|
75 |
[exBegin] |
|
76 |
|top button| |
|
93 | 77 |
|
229 | 78 |
top := StandardSystemView new. |
79 |
top extent:300@300. |
|
93 | 80 |
|
229 | 81 |
button := Button label:'component'. |
82 |
top add:button in:(LayoutFrame new |
|
83 |
leftFraction:0.25; |
|
84 |
topFraction:0.25; |
|
85 |
rightFraction:0.75; |
|
86 |
bottomFraction:0.75). |
|
87 |
||
88 |
top open |
|
89 |
[exEnd] |
|
93 | 90 |
|
91 |
||
92 |
like above, but adds additional offset to the origin: |
|
229 | 93 |
This is the same as with relative origin/corner |
94 |
and setting left & right insets. |
|
95 |
[exBegin] |
|
96 |
|top button| |
|
93 | 97 |
|
229 | 98 |
top := StandardSystemView new. |
99 |
top extent:300@300. |
|
93 | 100 |
|
229 | 101 |
button := Button label:'component'. |
102 |
top add:button in:(LayoutFrame new |
|
103 |
leftFraction:0.25; leftOffset:10; |
|
104 |
topFraction:0.25; topOffset:-20; |
|
105 |
rightFraction:0.75; |
|
106 |
bottomFraction:0.75). |
|
93 | 107 |
|
229 | 108 |
top open |
109 |
[exEnd] |
|
93 | 110 |
|
111 |
||
229 | 112 |
like above, with offsets on all edges, |
113 |
actually simulating a constant inset on all four edges: |
|
114 |
[exBegin] |
|
115 |
|top button| |
|
93 | 116 |
|
229 | 117 |
top := StandardSystemView new. |
118 |
top extent:300@300. |
|
93 | 119 |
|
229 | 120 |
button := Button label:'component'. |
121 |
top add:button in:(LayoutFrame new |
|
122 |
leftFraction:0.0; leftOffset:10; |
|
123 |
topFraction:0.0; topOffset:10; |
|
124 |
rightFraction:1.0; rightOffset:-10; |
|
125 |
bottomFraction:1.0; bottomOffset:-10). |
|
93 | 126 |
|
229 | 127 |
top open |
128 |
[exEnd] |
|
93 | 129 |
" |
88 | 130 |
! ! |
131 |
||
426 | 132 |
!LayoutFrame class methodsFor:'instance creation'! |
133 |
||
2221 | 134 |
inset:pixels |
135 |
"create a new layoutFrame which insets the child by some pixels" |
|
136 |
||
137 |
^ self |
|
138 |
leftFraction:0 offset:pixels |
|
139 |
rightFraction:1 offset:pixels negated |
|
140 |
topFraction:0 offset:pixels |
|
141 |
bottomFraction:1 offset:pixels negated |
|
142 |
! |
|
143 |
||
426 | 144 |
leftFraction:lF offset:lO rightFraction:rF offset:rO topFraction:tF offset:tO bottomFraction:bF offset:bO |
145 |
"create a new layoutFrame" |
|
146 |
||
147 |
^ self new |
|
148 |
leftFraction:lF offset:lO |
|
149 |
rightFraction:rF offset:rO |
|
150 |
topFraction:tF offset:tO |
|
151 |
bottomFraction:bF offset:bO |
|
152 |
||
153 |
||
154 |
||
545
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
155 |
! |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
156 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
157 |
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
158 |
"create a new layoutFrame" |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
159 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
160 |
^ self new |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
161 |
leftOffset:lO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
162 |
rightOffset:rO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
163 |
topOffset:tO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
164 |
bottomOffset:bO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
165 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
166 |
"Created: 18.4.1997 / 20:14:44 / cg" |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
167 |
! |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
168 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
169 |
leftOffset:lO topOffset:tO rightOffset:rO bottomOffset:bO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
170 |
"create a new layoutFrame" |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
171 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
172 |
^ self leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
173 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
174 |
"Modified: 18.4.1997 / 20:15:23 / cg" |
1795 | 175 |
! |
176 |
||
177 |
origin:origin corner:corner |
|
178 |
"create a new layoutFrame from an oldStyle origin-corner rectangle. |
|
179 |
Added to make migration from Rectangles to LayoutFrames easier." |
|
180 |
||
181 |
|leftFraction leftOffset rightFraction rightOffset |
|
182 |
topFraction topOffset bottomFraction bottomOffset |
|
183 |
orgX orgY cornerX cornerY| |
|
184 |
||
185 |
orgX := origin x. |
|
186 |
orgY := origin y. |
|
187 |
cornerX := corner x. |
|
188 |
cornerY := corner y. |
|
189 |
leftFraction := leftOffset := 0. |
|
190 |
orgX isInteger ifTrue:[ |
|
191 |
leftOffset := orgX |
|
192 |
] ifFalse:[ |
|
193 |
leftFraction := orgX. |
|
194 |
]. |
|
195 |
orgY isInteger ifTrue:[ |
|
196 |
topOffset := orgY |
|
197 |
] ifFalse:[ |
|
198 |
topFraction := orgY. |
|
199 |
]. |
|
200 |
cornerX isInteger ifTrue:[ |
|
201 |
rightOffset := cornerX |
|
202 |
] ifFalse:[ |
|
203 |
rightFraction := cornerX. |
|
204 |
]. |
|
205 |
cornerY isInteger ifTrue:[ |
|
206 |
bottomOffset := cornerY |
|
207 |
] ifFalse:[ |
|
208 |
bottomFraction := cornerY. |
|
209 |
]. |
|
210 |
^ self |
|
211 |
leftFraction:leftFraction offset:leftOffset |
|
212 |
rightFraction:rightFraction offset:rightOffset |
|
213 |
topFraction:topFraction offset:rightOffset |
|
214 |
bottomFraction:bottomFraction offset:bottomOffset |
|
426 | 215 |
! ! |
216 |
||
77 | 217 |
!LayoutFrame methodsFor:'accessing'! |
218 |
||
126 | 219 |
bottomFraction |
2123 | 220 |
"Return the y-coordinate of the bottom of the relative rectangle as a percentage of the height of the reference rectangle." |
126 | 221 |
|
222 |
^ bottomFraction |
|
223 |
! |
|
224 |
||
225 |
bottomFraction:something |
|
2123 | 226 |
"Set the y-coordinate of the bottom of the relative rectangle to be a fraction of the height of the reference rectangle." |
126 | 227 |
|
228 |
bottomFraction := something. |
|
229 |
! |
|
230 |
||
231 |
bottomFraction:something offset:o |
|
2123 | 232 |
"set both bottomFraction and offset" |
77 | 233 |
|
126 | 234 |
bottomFraction := something. |
235 |
bottomOffset := o |
|
236 |
! |
|
237 |
||
275 | 238 |
bottomInset:pixels |
239 |
"set bottomOffset for an inset at the bottom" |
|
240 |
||
241 |
bottomOffset := pixels negated. |
|
242 |
||
243 |
"Created: 26.5.1996 / 17:38:30 / cg" |
|
244 |
! |
|
245 |
||
126 | 246 |
bottomOffset |
247 |
"return bottomOffset" |
|
248 |
||
249 |
^ bottomOffset |
|
250 |
! |
|
251 |
||
252 |
bottomOffset:something |
|
253 |
"set bottomOffset" |
|
254 |
||
255 |
bottomOffset := something. |
|
77 | 256 |
! |
257 |
||
275 | 258 |
horizontalInset:aNumber |
2123 | 259 |
"setup the offsets for insetting horizontally the frame aNumber pixels at all sides" |
275 | 260 |
|
261 |
leftOffset := aNumber. |
|
262 |
rightOffset := aNumber negated. |
|
263 |
||
264 |
"Created: 26.5.1996 / 17:39:35 / cg" |
|
265 |
! |
|
266 |
||
267 |
inset:aNumber |
|
2123 | 268 |
"setup the offsets for insetting the frame aNumber pixels at all sides" |
275 | 269 |
|
270 |
topOffset := leftOffset := aNumber. |
|
271 |
rightOffset := bottomOffset := aNumber negated. |
|
272 |
||
273 |
"Created: 26.5.1996 / 17:36:49 / cg" |
|
274 |
! |
|
275 |
||
425 | 276 |
leftFraction:lF offset:lO rightFraction:rF offset:rO topFraction:tF offset:tO bottomFraction:bF offset:bO |
277 |
"set all fields" |
|
278 |
||
279 |
leftFraction := lF. |
|
280 |
rightFraction := rF. |
|
281 |
topFraction := tF. |
|
282 |
bottomFraction := bF. |
|
283 |
leftOffset := lO. |
|
284 |
rightOffset := rO. |
|
285 |
topOffset := tO. |
|
286 |
bottomOffset := bO. |
|
287 |
||
288 |
! |
|
289 |
||
1597 | 290 |
leftOffset:lO rightOffset:rO |
291 |
"set the horizontal offset fields" |
|
292 |
||
293 |
leftOffset := lO. |
|
294 |
rightOffset := rO. |
|
295 |
! |
|
296 |
||
545
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
297 |
leftOffset:lO rightOffset:rO topOffset:tO bottomOffset:bO |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
298 |
"set all offset fields" |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
299 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
300 |
leftOffset := lO. |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
301 |
rightOffset := rO. |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
302 |
topOffset := tO. |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
303 |
bottomOffset := bO. |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
304 |
|
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
305 |
"Created: 18.4.1997 / 20:16:08 / cg" |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
306 |
! |
0b9d704baeae
more access & inst-creation methods
Claus Gittinger <cg@exept.de>
parents:
498
diff
changeset
|
307 |
|
77 | 308 |
rightFraction |
309 |
"return rightFraction" |
|
310 |
||
311 |
^ rightFraction |
|
312 |
! |
|
313 |
||
126 | 314 |
rightFraction:something |
315 |
"set rightFraction" |
|
77 | 316 |
|
126 | 317 |
rightFraction := something. |
77 | 318 |
! |
319 |
||
320 |
rightFraction:something offset:o |
|
321 |
"set rightFraction and offset" |
|
322 |
||
323 |
rightFraction := something. |
|
324 |
rightOffset := o |
|
325 |
! |
|
326 |
||
275 | 327 |
rightInset:pixels |
328 |
"set rightOffset for an inset at the right" |
|
329 |
||
330 |
rightOffset := pixels negated. |
|
331 |
||
332 |
"Created: 26.5.1996 / 17:38:38 / cg" |
|
333 |
! |
|
334 |
||
126 | 335 |
rightOffset |
336 |
"return rightOffset" |
|
77 | 337 |
|
126 | 338 |
^ rightOffset |
77 | 339 |
! |
340 |
||
126 | 341 |
rightOffset:something |
342 |
"set rightOffset" |
|
343 |
||
344 |
rightOffset := something. |
|
275 | 345 |
! |
346 |
||
1594 | 347 |
topOffset:newTopOffset bottomOffset:newBottomOffset |
348 |
topOffset := newTopOffset. |
|
349 |
bottomOffset := newBottomOffset. |
|
350 |
! |
|
351 |
||
275 | 352 |
verticalInset:aNumber |
353 |
"setup the offsets for insetting vertically the frame aNumber pixels |
|
354 |
at all sides" |
|
355 |
||
356 |
topOffset := aNumber. |
|
357 |
bottomOffset := aNumber negated. |
|
358 |
||
359 |
"Created: 26.5.1996 / 17:39:50 / cg" |
|
126 | 360 |
! ! |
361 |
||
362 |
!LayoutFrame methodsFor:'converting'! |
|
363 |
||
364 |
fromLiteralArrayEncoding:encoding |
|
365 |
"read my values from an encoding. |
|
366 |
The encoding is supposed to be of the form: |
|
367 |
(LayoutFrame orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY) |
|
368 |
This is the reverse to literalArrayEncoding." |
|
77 | 369 |
|
126 | 370 |
leftOffset := encoding at:2. |
371 |
leftFraction := encoding at:3. |
|
372 |
topOffset := encoding at:4. |
|
373 |
topFraction := encoding at:5. |
|
374 |
rightOffset := encoding at:6. |
|
375 |
rightFraction := encoding at:7. |
|
376 |
bottomOffset := encoding at:8. |
|
377 |
bottomFraction := encoding at:9. |
|
378 |
||
379 |
" |
|
380 |
LayoutFrame new fromLiteralArrayEncoding:#(#LayoutFrame 70 0 2 0 0 1 25 0 ) |
|
381 |
#(#LayoutFrame 70 0 2 0 0 1 25 0 ) decodeAsLiteralArray |
|
382 |
" |
|
77 | 383 |
! |
384 |
||
126 | 385 |
literalArrayEncoding |
191 | 386 |
"encode myself as an array, from which a copy of the receiver |
387 |
can be reconstructed with #decodeAsLiteralArray. |
|
126 | 388 |
The encoding is: |
191 | 389 |
(#LayoutOrigin orgOffsX relOrgX orgOffsY relOrgY cornOffsX relCornX cornOffsY relCornY)" |
77 | 390 |
|
126 | 391 |
^ super literalArrayEncoding |
392 |
, (Array |
|
191 | 393 |
with:rightOffset |
394 |
with:rightFraction |
|
395 |
with:bottomOffset |
|
396 |
with:bottomFraction) |
|
77 | 397 |
|
126 | 398 |
"Modified: 1.9.1995 / 02:43:35 / claus" |
191 | 399 |
"Modified: 22.4.1996 / 13:00:17 / cg" |
77 | 400 |
! ! |
401 |
||
126 | 402 |
!LayoutFrame methodsFor:'initialization'! |
403 |
||
404 |
initialize |
|
405 |
leftOffset := rightOffset := bottomOffset := topOffset := 0. |
|
406 |
leftFraction := topFraction := 0. |
|
468 | 407 |
"/ bottomFraction := rightFraction := 1. |
408 |
bottomFraction := rightFraction := 0. |
|
409 |
||
410 |
"Modified: 1.3.1997 / 16:12:50 / cg" |
|
126 | 411 |
! ! |
77 | 412 |
|
83 | 413 |
!LayoutFrame methodsFor:'printing & storing'! |
414 |
||
415 |
displayString |
|
700 | 416 |
"return a printed representation of the receiver for displaying" |
417 |
||
83 | 418 |
^ (self class name) , '(' |
700 | 419 |
, 'l: ' , leftFraction displayString |
420 |
, '+' , leftOffset displayString |
|
421 |
, ' t: ' , topFraction displayString |
|
422 |
, '+' , topOffset displayString |
|
423 |
, ' r: ' , rightFraction displayString |
|
424 |
, '+' , rightOffset displayString |
|
425 |
, ' b: ' , bottomFraction displayString |
|
426 |
, '+' , bottomOffset displayString |
|
427 |
, ')' |
|
428 |
||
429 |
"Modified: 20.9.1997 / 11:40:14 / cg" |
|
83 | 430 |
! ! |
431 |
||
77 | 432 |
!LayoutFrame methodsFor:'queries'! |
433 |
||
126 | 434 |
corner |
435 |
^ rightFraction asFloat @ bottomFraction asFloat |
|
436 |
! |
|
437 |
||
416 | 438 |
isLayoutFrame |
439 |
"return true, if this is a layoutFrame" |
|
440 |
||
441 |
^ true |
|
442 |
||
443 |
||
444 |
! |
|
445 |
||
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
446 |
rectangleRelativeTo:superRectangle preferred:prefRectHolder |
229 | 447 |
"compute the rectangle represented by the receiver, |
448 |
given the superViews rectangle and the views preferredExtent." |
|
449 |
||
498 | 450 |
|x1 y1 x2 y2 superWidth superHeight| |
77 | 451 |
|
1039 | 452 |
x1 := x2 := superRectangle left. |
453 |
y1 := y2 := superRectangle top. |
|
454 |
||
455 |
leftOffset notNil ifTrue:[ |
|
456 |
x1 := x1 + leftOffset value |
|
77 | 457 |
]. |
1039 | 458 |
topOffset notNil ifTrue:[ |
459 |
y1 := y1 + topOffset value |
|
77 | 460 |
]. |
1039 | 461 |
rightOffset notNil ifTrue:[ |
462 |
x2 := x2 + rightOffset value |
|
463 |
]. |
|
464 |
bottomOffset notNil ifTrue:[ |
|
465 |
y2 := y2 + bottomOffset value |
|
77 | 466 |
]. |
498 | 467 |
|
77 | 468 |
leftFraction notNil ifTrue:[ |
498 | 469 |
superWidth := superRectangle width. |
1601 | 470 |
x1 := x1 + (superWidth * leftFraction value) |
77 | 471 |
]. |
472 |
topFraction notNil ifTrue:[ |
|
498 | 473 |
superHeight := superRectangle height. |
1601 | 474 |
y1 := y1 + (superHeight * topFraction value) |
77 | 475 |
]. |
476 |
rightFraction notNil ifTrue:[ |
|
498 | 477 |
superWidth isNil ifTrue:[superWidth := superRectangle width]. |
1601 | 478 |
x2 := x2 + (superWidth * rightFraction value) |
77 | 479 |
]. |
480 |
bottomFraction notNil ifTrue:[ |
|
498 | 481 |
superHeight isNil ifTrue:[superHeight := superRectangle height]. |
1601 | 482 |
y2 := y2 + (superHeight * bottomFraction value) |
77 | 483 |
]. |
242 | 484 |
^ Rectangle left:x1 top:y1 right:x2 bottom:y2 |
83 | 485 |
|
486 |
" |
|
487 |
|superRect lF| |
|
488 |
||
498 | 489 |
superRect := 0@0 corner:99@99. |
83 | 490 |
lF := (LayoutFrame new). |
491 |
lF leftFraction:0.25; |
|
229 | 492 |
topFraction:0.25; |
493 |
rightFraction:0.75; |
|
494 |
bottomFraction:0.75. |
|
83 | 495 |
lF rectangleRelativeTo:superRect preferred:(0@0 corner:30@30) |
496 |
" |
|
229 | 497 |
|
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
700
diff
changeset
|
498 |
"Created: / 6.3.1997 / 21:07:51 / cg" |
1039 | 499 |
"Modified: / 13.8.1998 / 18:33:59 / cg" |
77 | 500 |
! ! |
100 | 501 |
|
126 | 502 |
!LayoutFrame class methodsFor:'documentation'! |
100 | 503 |
|
126 | 504 |
version |
2221 | 505 |
^ '$Header: /cvs/stx/stx/libview2/LayoutFrame.st,v 1.32 2006-09-15 14:30:57 fm Exp $' |
100 | 506 |
! ! |