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 |
|
|
65 |
new
|
229
|
66 |
"return a new initialized instance"
|
|
67 |
|
77
|
68 |
^ self basicNew initialize
|
229
|
69 |
|
|
70 |
"Modified: 27.4.1996 / 14:47:08 / cg"
|
77
|
71 |
! !
|
|
72 |
|
284
|
73 |
!Layout methodsFor:'converting'!
|
|
74 |
|
|
75 |
asLayout
|
|
76 |
"return the receiver"
|
|
77 |
|
|
78 |
^ self
|
|
79 |
|
|
80 |
"Created: 29.5.1996 / 15:12:13 / cg"
|
|
81 |
! !
|
|
82 |
|
77
|
83 |
!Layout methodsFor:'initialization'!
|
|
84 |
|
|
85 |
initialize
|
229
|
86 |
"setup the instance - to be redefined by concrete subclasses"
|
|
87 |
|
77
|
88 |
^ self subclassResponsibility
|
229
|
89 |
|
|
90 |
"Modified: 27.4.1996 / 14:46:56 / cg"
|
77
|
91 |
! !
|
126
|
92 |
|
|
93 |
!Layout methodsFor:'queries'!
|
|
94 |
|
415
|
95 |
isAlignmentOrigin
|
|
96 |
"return true, if this is an alignmentOrigin"
|
|
97 |
|
|
98 |
^ false
|
|
99 |
|
|
100 |
!
|
|
101 |
|
126
|
102 |
isLayout
|
229
|
103 |
"return true, if the recevier is a layout object.
|
|
104 |
Always return true here."
|
415
|
105 |
|
126
|
106 |
^ true
|
229
|
107 |
|
|
108 |
"Modified: 27.4.1996 / 14:45:27 / cg"
|
126
|
109 |
!
|
|
110 |
|
417
|
111 |
isLayoutFrame
|
|
112 |
"return true, if this is a layoutFrame"
|
|
113 |
|
|
114 |
^ false
|
|
115 |
|
|
116 |
!
|
|
117 |
|
415
|
118 |
isLayoutOrigin
|
|
119 |
"return true, if this is a layoutOrigin"
|
|
120 |
|
|
121 |
^ false
|
|
122 |
|
|
123 |
!
|
|
124 |
|
126
|
125 |
rectangleRelativeTo:superRectangle preferred:prefRect
|
229
|
126 |
"compute the rectangle represented by the receiver,
|
|
127 |
given the superViews rectangle and the views preferredExtent.
|
|
128 |
Must be implemented by concrete subclasses."
|
|
129 |
|
126
|
130 |
^ self subclassResponsibility
|
229
|
131 |
|
|
132 |
"Modified: 27.4.1996 / 14:46:37 / cg"
|
126
|
133 |
! !
|
|
134 |
|
|
135 |
!Layout class methodsFor:'documentation'!
|
|
136 |
|
|
137 |
version
|
417
|
138 |
^ '$Header: /cvs/stx/stx/libview2/Layout.st,v 1.14 1997-02-11 23:07:36 ca Exp $'
|
126
|
139 |
! !
|