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