author | Claus Gittinger <cg@exept.de> |
Wed, 27 May 1998 11:21:38 +0200 | |
changeset 949 | 0eb888b21192 |
parent 785 | e7e50d798cfc |
child 2137 | 1cc62200836d |
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 |
||
77 | 13 |
Object subclass:#Layout |
216 | 14 |
instanceVariableNames:'' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Graphics-Geometry' |
|
77 | 18 |
! |
19 |
||
88 | 20 |
!Layout class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
93 | 25 |
All Rights Reserved |
88 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
93 | 36 |
documentation |
37 |
" |
|
38 |
This is an abstract superclass for geometry controlling objects. |
|
39 |
While old smalltalks used relative origin/extent/corner and absolute |
|
40 |
origin/corner/extents, these mechanisms are now being removed from the |
|
41 |
view itself into geometry controlling objects, which are given a superviews |
|
42 |
size and are to return a components size upon request. |
|
43 |
This allows more flexible geometry management, since any algorithm can |
|
44 |
be implemented (if the existing ones are not sufficient, add you own subclass |
|
96 | 45 |
and install it as layout-object in your view). |
93 | 46 |
|
229 | 47 |
Notice: |
48 |
this class was implemented using protocol information |
|
49 |
from alpha testers - it may not be complete or compatible to |
|
50 |
the corresponding ST-80 class. |
|
51 |
If you encounter any incompatibilities, please forward a note |
|
52 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
219 | 53 |
|
54 |
[author:] |
|
55 |
Claus Gittinger |
|
229 | 56 |
|
57 |
[see also:] |
|
58 |
View |
|
59 |
LayoutOrigin LayoutFrame AlignmentOrigin |
|
94 | 60 |
" |
88 | 61 |
! ! |
62 |
||
77 | 63 |
!Layout class methodsFor:'instance creation'! |
64 |
||
785
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
65 |
decodeFromLiteralArray:anArray |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
66 |
"create & return a new instance from information encoded in anArray. |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
67 |
Redefined since no initialization is needed (the values are |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
68 |
all set from the specArray." |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
69 |
|
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
70 |
^ self basicNew fromLiteralArrayEncoding:anArray. |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
71 |
|
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
72 |
"Modified: / 28.1.1998 / 17:42:25 / cg" |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
73 |
! |
e7e50d798cfc
no need to initialize values twice (when decoding from a literalArray).
Claus Gittinger <cg@exept.de>
parents:
417
diff
changeset
|
74 |
|
77 | 75 |
new |
229 | 76 |
"return a new initialized instance" |
77 |
||
77 | 78 |
^ self basicNew initialize |
229 | 79 |
|
80 |
"Modified: 27.4.1996 / 14:47:08 / cg" |
|
77 | 81 |
! ! |
82 |
||
284 | 83 |
!Layout methodsFor:'converting'! |
84 |
||
85 |
asLayout |
|
86 |
"return the receiver" |
|
87 |
||
88 |
^ self |
|
89 |
||
90 |
"Created: 29.5.1996 / 15:12:13 / cg" |
|
91 |
! ! |
|
92 |
||
77 | 93 |
!Layout methodsFor:'initialization'! |
94 |
||
95 |
initialize |
|
229 | 96 |
"setup the instance - to be redefined by concrete subclasses" |
97 |
||
77 | 98 |
^ self subclassResponsibility |
229 | 99 |
|
100 |
"Modified: 27.4.1996 / 14:46:56 / cg" |
|
77 | 101 |
! ! |
126 | 102 |
|
103 |
!Layout methodsFor:'queries'! |
|
104 |
||
415 | 105 |
isAlignmentOrigin |
106 |
"return true, if this is an alignmentOrigin" |
|
107 |
||
108 |
^ false |
|
109 |
||
110 |
! |
|
111 |
||
126 | 112 |
isLayout |
229 | 113 |
"return true, if the recevier is a layout object. |
114 |
Always return true here." |
|
415 | 115 |
|
126 | 116 |
^ true |
229 | 117 |
|
118 |
"Modified: 27.4.1996 / 14:45:27 / cg" |
|
126 | 119 |
! |
120 |
||
417 | 121 |
isLayoutFrame |
122 |
"return true, if this is a layoutFrame" |
|
123 |
||
124 |
^ false |
|
125 |
||
126 |
! |
|
127 |
||
415 | 128 |
isLayoutOrigin |
129 |
"return true, if this is a layoutOrigin" |
|
130 |
||
131 |
^ false |
|
132 |
||
133 |
! |
|
134 |
||
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
135 |
rectangleRelativeTo:superRectangle preferred:prefRectHolder |
229 | 136 |
"compute the rectangle represented by the receiver, |
137 |
given the superViews rectangle and the views preferredExtent. |
|
138 |
Must be implemented by concrete subclasses." |
|
139 |
||
126 | 140 |
^ self subclassResponsibility |
229 | 141 |
|
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
142 |
"Modified: / 27.5.1998 / 10:19:21 / cg" |
126 | 143 |
! ! |
144 |
||
145 |
!Layout class methodsFor:'documentation'! |
|
146 |
||
147 |
version |
|
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
148 |
^ '$Header: /cvs/stx/stx/libview2/Layout.st,v 1.16 1998-05-27 09:21:20 cg Exp $' |
126 | 149 |
! ! |