author | Claus Gittinger <cg@exept.de> |
Tue, 29 Aug 2017 02:19:30 +0200 | |
changeset 3994 | 8ab8729d5dec |
parent 3877 | 595b816b53b5 |
child 4293 | 263c32978c32 |
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 |
||
3616 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
77 | 16 |
Object subclass:#Layout |
216 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Graphics-Geometry' |
|
77 | 21 |
! |
22 |
||
88 | 23 |
!Layout class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 1995 by Claus Gittinger |
|
93 | 28 |
All Rights Reserved |
88 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
93 | 39 |
documentation |
40 |
" |
|
41 |
This is an abstract superclass for geometry controlling objects. |
|
42 |
While old smalltalks used relative origin/extent/corner and absolute |
|
43 |
origin/corner/extents, these mechanisms are now being removed from the |
|
44 |
view itself into geometry controlling objects, which are given a superviews |
|
45 |
size and are to return a components size upon request. |
|
46 |
This allows more flexible geometry management, since any algorithm can |
|
47 |
be implemented (if the existing ones are not sufficient, add you own subclass |
|
96 | 48 |
and install it as layout-object in your view). |
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 LayoutFrame AlignmentOrigin |
|
94 | 63 |
" |
88 | 64 |
! ! |
65 |
||
77 | 66 |
!Layout class methodsFor:'instance creation'! |
67 |
||
68 |
new |
|
229 | 69 |
"return a new initialized instance" |
70 |
||
77 | 71 |
^ self basicNew initialize |
229 | 72 |
|
73 |
"Modified: 27.4.1996 / 14:47:08 / cg" |
|
77 | 74 |
! ! |
75 |
||
3877 | 76 |
!Layout class methodsFor:'queries'! |
77 |
||
78 |
isAbstract |
|
79 |
"Return if this class is an abstract class. |
|
80 |
True is returned here for myself only; false for subclasses. |
|
81 |
Abstract subclasses must redefine this again." |
|
82 |
||
83 |
^ self == Layout. |
|
84 |
! ! |
|
85 |
||
284 | 86 |
!Layout methodsFor:'converting'! |
87 |
||
88 |
asLayout |
|
89 |
"return the receiver" |
|
90 |
||
91 |
^ self |
|
92 |
||
93 |
"Created: 29.5.1996 / 15:12:13 / cg" |
|
94 |
! ! |
|
95 |
||
77 | 96 |
!Layout methodsFor:'initialization'! |
97 |
||
98 |
initialize |
|
229 | 99 |
"setup the instance - to be redefined by concrete subclasses" |
100 |
||
77 | 101 |
^ self subclassResponsibility |
229 | 102 |
|
103 |
"Modified: 27.4.1996 / 14:46:56 / cg" |
|
77 | 104 |
! ! |
126 | 105 |
|
106 |
!Layout methodsFor:'queries'! |
|
107 |
||
415 | 108 |
isAlignmentOrigin |
109 |
"return true, if this is an alignmentOrigin" |
|
110 |
||
111 |
^ false |
|
112 |
||
113 |
! |
|
114 |
||
126 | 115 |
isLayout |
3616 | 116 |
"return true, if the receiver is a layout object. |
229 | 117 |
Always return true here." |
415 | 118 |
|
126 | 119 |
^ true |
229 | 120 |
|
121 |
"Modified: 27.4.1996 / 14:45:27 / cg" |
|
126 | 122 |
! |
123 |
||
417 | 124 |
isLayoutFrame |
125 |
"return true, if this is a layoutFrame" |
|
126 |
||
127 |
^ false |
|
128 |
||
129 |
! |
|
130 |
||
415 | 131 |
isLayoutOrigin |
132 |
"return true, if this is a layoutOrigin" |
|
133 |
||
134 |
^ false |
|
135 |
||
136 |
! |
|
137 |
||
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
138 |
rectangleRelativeTo:superRectangle preferred:prefRectHolder |
229 | 139 |
"compute the rectangle represented by the receiver, |
3795 | 140 |
given the superViews rectangle and the view's preferredExtent. |
229 | 141 |
Must be implemented by concrete subclasses." |
142 |
||
126 | 143 |
^ self subclassResponsibility |
229 | 144 |
|
949
0eb888b21192
prefRect may now be a valueHolder or block
Claus Gittinger <cg@exept.de>
parents:
785
diff
changeset
|
145 |
"Modified: / 27.5.1998 / 10:19:21 / cg" |
126 | 146 |
! ! |
147 |
||
148 |
!Layout class methodsFor:'documentation'! |
|
149 |
||
150 |
version |
|
3616 | 151 |
^ '$Header$' |
126 | 152 |
! ! |
3616 | 153 |