4293
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
88
|
3 |
"
|
|
4 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
93
|
5 |
All Rights Reserved
|
88
|
6 |
|
|
7 |
This software is furnished under a license and may be used
|
|
8 |
only in accordance with the terms of that license and with the
|
|
9 |
inclusion of the above copyright notice. This software may not
|
|
10 |
be provided or otherwise made available to, or used by, any
|
|
11 |
other person. No title to or ownership of the software is
|
|
12 |
hereby transferred.
|
|
13 |
"
|
2137
|
14 |
"{ Package: 'stx:libview2' }"
|
|
15 |
|
3616
|
16 |
"{ NameSpace: Smalltalk }"
|
|
17 |
|
77
|
18 |
Object subclass:#Layout
|
216
|
19 |
instanceVariableNames:''
|
|
20 |
classVariableNames:''
|
|
21 |
poolDictionaries:''
|
|
22 |
category:'Graphics-Geometry'
|
77
|
23 |
!
|
|
24 |
|
88
|
25 |
!Layout class methodsFor:'documentation'!
|
|
26 |
|
|
27 |
copyright
|
|
28 |
"
|
|
29 |
COPYRIGHT (c) 1995 by Claus Gittinger
|
93
|
30 |
All Rights Reserved
|
88
|
31 |
|
|
32 |
This software is furnished under a license and may be used
|
|
33 |
only in accordance with the terms of that license and with the
|
|
34 |
inclusion of the above copyright notice. This software may not
|
|
35 |
be provided or otherwise made available to, or used by, any
|
|
36 |
other person. No title to or ownership of the software is
|
|
37 |
hereby transferred.
|
|
38 |
"
|
|
39 |
!
|
|
40 |
|
93
|
41 |
documentation
|
|
42 |
"
|
|
43 |
This is an abstract superclass for geometry controlling objects.
|
|
44 |
While old smalltalks used relative origin/extent/corner and absolute
|
|
45 |
origin/corner/extents, these mechanisms are now being removed from the
|
4293
|
46 |
view itself into geometry controlling objects, which are given a superview's
|
|
47 |
size and are to return a component's size upon request.
|
93
|
48 |
This allows more flexible geometry management, since any algorithm can
|
|
49 |
be implemented (if the existing ones are not sufficient, add you own subclass
|
96
|
50 |
and install it as layout-object in your view).
|
93
|
51 |
|
229
|
52 |
Notice:
|
|
53 |
this class was implemented using protocol information
|
|
54 |
from alpha testers - it may not be complete or compatible to
|
|
55 |
the corresponding ST-80 class.
|
|
56 |
If you encounter any incompatibilities, please forward a note
|
|
57 |
describing the incompatibility verbal (i.e. no code) to the ST/X team.
|
219
|
58 |
|
|
59 |
[author:]
|
|
60 |
Claus Gittinger
|
229
|
61 |
|
|
62 |
[see also:]
|
|
63 |
View
|
|
64 |
LayoutOrigin LayoutFrame AlignmentOrigin
|
94
|
65 |
"
|
88
|
66 |
! !
|
|
67 |
|
77
|
68 |
!Layout class methodsFor:'instance creation'!
|
|
69 |
|
|
70 |
new
|
229
|
71 |
"return a new initialized instance"
|
|
72 |
|
77
|
73 |
^ self basicNew initialize
|
229
|
74 |
|
|
75 |
"Modified: 27.4.1996 / 14:47:08 / cg"
|
77
|
76 |
! !
|
|
77 |
|
3877
|
78 |
!Layout class methodsFor:'queries'!
|
|
79 |
|
|
80 |
isAbstract
|
|
81 |
"Return if this class is an abstract class.
|
|
82 |
True is returned here for myself only; false for subclasses.
|
|
83 |
Abstract subclasses must redefine this again."
|
|
84 |
|
|
85 |
^ self == Layout.
|
|
86 |
! !
|
|
87 |
|
4293
|
88 |
!Layout methodsFor:'computing'!
|
|
89 |
|
|
90 |
rectangleRelativeTo:superRectangle preferred:prefRectHolder
|
|
91 |
"compute the rectangle represented by the receiver,
|
|
92 |
given the superView's rectangle and the view's preferredExtent.
|
|
93 |
Must be implemented by concrete subclasses."
|
|
94 |
|
|
95 |
^ self subclassResponsibility
|
|
96 |
|
|
97 |
"Modified: / 27-05-1998 / 10:19:21 / cg"
|
|
98 |
"Modified (comment): / 17-07-2019 / 10:02:45 / Claus Gittinger"
|
|
99 |
! !
|
|
100 |
|
284
|
101 |
!Layout methodsFor:'converting'!
|
|
102 |
|
|
103 |
asLayout
|
|
104 |
"return the receiver"
|
|
105 |
|
|
106 |
^ self
|
|
107 |
|
|
108 |
"Created: 29.5.1996 / 15:12:13 / cg"
|
|
109 |
! !
|
|
110 |
|
77
|
111 |
!Layout methodsFor:'initialization'!
|
|
112 |
|
|
113 |
initialize
|
229
|
114 |
"setup the instance - to be redefined by concrete subclasses"
|
|
115 |
|
77
|
116 |
^ self subclassResponsibility
|
229
|
117 |
|
|
118 |
"Modified: 27.4.1996 / 14:46:56 / cg"
|
77
|
119 |
! !
|
126
|
120 |
|
|
121 |
!Layout methodsFor:'queries'!
|
|
122 |
|
415
|
123 |
isAlignmentOrigin
|
|
124 |
"return true, if this is an alignmentOrigin"
|
|
125 |
|
|
126 |
^ false
|
|
127 |
|
|
128 |
!
|
|
129 |
|
126
|
130 |
isLayout
|
3616
|
131 |
"return true, if the receiver is a layout object.
|
229
|
132 |
Always return true here."
|
415
|
133 |
|
126
|
134 |
^ true
|
229
|
135 |
|
|
136 |
"Modified: 27.4.1996 / 14:45:27 / cg"
|
126
|
137 |
!
|
|
138 |
|
417
|
139 |
isLayoutFrame
|
|
140 |
"return true, if this is a layoutFrame"
|
|
141 |
|
|
142 |
^ false
|
|
143 |
|
|
144 |
!
|
|
145 |
|
415
|
146 |
isLayoutOrigin
|
|
147 |
"return true, if this is a layoutOrigin"
|
|
148 |
|
|
149 |
^ false
|
|
150 |
|
126
|
151 |
! !
|
|
152 |
|
|
153 |
!Layout class methodsFor:'documentation'!
|
|
154 |
|
|
155 |
version
|
3616
|
156 |
^ '$Header$'
|
126
|
157 |
! !
|
3616
|
158 |
|