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