author | Claus Gittinger <cg@exept.de> |
Thu, 22 Dec 2005 17:55:14 +0100 | |
changeset 2074 | 043bdbb49ef4 |
parent 1789 | f52f0a0d8448 |
child 2376 | bd1615a0d2af |
permissions | -rw-r--r-- |
1789 | 1 |
"{ Package: 'stx:libview2' }" |
2 |
||
249 | 3 |
VisualComponent subclass:#VisualPart |
4 |
instanceVariableNames:'container' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
1789 | 7 |
category:'Compatibility-ST80-Graphics-Display Objects' |
249 | 8 |
! |
9 |
||
365 | 10 |
!VisualPart class methodsFor:'documentation'! |
265 | 11 |
|
12 |
documentation |
|
13 |
" |
|
14 |
abstract superclass for all kinds of visual components, which |
|
15 |
are containers for some other component. |
|
16 |
This class and its subclasses (currently) exist mostly for |
|
17 |
ST-80 compatibility - to provide a home for ported PD classes, |
|
18 |
which depend on the VisualPart hierarchy. |
|
19 |
||
20 |
Notice: |
|
21 |
this class was implemented using protocol information |
|
365 | 22 |
from alpha testers, from reading PD programs and |
23 |
from the Hopkins/Horan book. |
|
265 | 24 |
- it may not be complete or compatible to the corresponding ST-80 class. |
25 |
If you encounter any incompatibilities, please forward a note |
|
26 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
27 |
This is still being constructed - not yet finished. |
|
28 |
||
29 |
[author:] |
|
30 |
Claus Gittinger |
|
31 |
||
32 |
[see also:] |
|
33 |
GeometricWrapper |
|
34 |
" |
|
35 |
||
36 |
||
37 |
! ! |
|
249 | 38 |
|
39 |
!VisualPart methodsFor:'accessing'! |
|
40 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
41 |
backgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
42 |
^ container backgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
43 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
44 |
"Created: / 18.6.1998 / 15:58:34 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
45 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
46 |
|
249 | 47 |
container |
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
48 |
"return my container" |
249 | 49 |
|
50 |
^ container |
|
51 |
||
52 |
"Created: 9.5.1996 / 00:31:41 / cg" |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
53 |
"Modified: 5.6.1996 / 01:08:26 / cg" |
249 | 54 |
! |
55 |
||
56 |
container:something |
|
57 |
"set container" |
|
58 |
||
59 |
container := something. |
|
60 |
||
61 |
"Created: 9.5.1996 / 00:31:41 / cg" |
|
62 |
! |
|
63 |
||
64 |
graphicsContext |
|
65 |
"return the graphicsContext" |
|
66 |
||
254 | 67 |
^ container graphicsContext |
249 | 68 |
|
69 |
"Created: 9.5.1996 / 00:32:12 / cg" |
|
254 | 70 |
"Modified: 9.5.1996 / 01:37:10 / cg" |
71 |
! |
|
72 |
||
73 |
graphicsDevice |
|
74 |
"return the graphicsContext" |
|
75 |
||
76 |
^ container graphicsDevice |
|
77 |
||
78 |
"Created: 9.5.1996 / 00:32:12 / cg" |
|
79 |
"Modified: 9.5.1996 / 01:37:03 / cg" |
|
80 |
! |
|
81 |
||
82 |
topComponent |
|
83 |
"return the top component - typically the topView" |
|
84 |
||
85 |
^ container topComponent |
|
86 |
||
87 |
"Modified: 9.5.1996 / 01:37:10 / cg" |
|
88 |
"Created: 9.5.1996 / 01:39:15 / cg" |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
89 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
90 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
91 |
view |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
92 |
"return my view" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
93 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
94 |
container isNil ifTrue:[^ nil]. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
95 |
^ container view |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
96 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
97 |
"Created: 4.6.1996 / 21:32:34 / cg" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
98 |
"Modified: 5.6.1996 / 01:20:13 / cg" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
99 |
! ! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
100 |
|
294 | 101 |
!VisualPart methodsFor:'view protocol mimicri'! |
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
102 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
103 |
containerChangedSize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
104 |
"my container changed its size. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
105 |
The default here is to ignore this, but some wrappers like |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
106 |
to resize when this happens." |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
107 |
|
323 | 108 |
"/Transcript show:'container '; show:container; show:' of '; show:self; |
109 |
"/ show:' changed size to '; showCR:container viewRectangle. |
|
110 |
||
111 |
self bounds:container viewRectangle |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
112 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
113 |
"Created: 4.6.1996 / 21:27:58 / cg" |
323 | 114 |
"Modified: 19.7.1996 / 21:20:58 / cg" |
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
115 |
! |
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
116 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
117 |
create |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
118 |
"want myself to be created." |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
119 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
120 |
container create |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
121 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
122 |
"Created: 4.6.1996 / 21:30:25 / cg" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
123 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
124 |
|
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
125 |
invalidate |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
126 |
container notNil ifTrue:[ |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
127 |
container invalidate:self bounds |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
128 |
] |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
129 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
130 |
"Modified: / 18.6.1998 / 16:12:15 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
131 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
132 |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
133 |
realize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
134 |
"my container realized itself. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
135 |
The default here is to ignore this, but some wrappers like |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
136 |
to do something when this happens." |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
137 |
|
998 | 138 |
self realizeAllSubViews |
139 |
||
140 |
"Created: / 4.6.1996 / 21:28:31 / cg" |
|
141 |
"Modified: / 6.7.1998 / 18:38:28 / cg" |
|
142 |
! |
|
143 |
||
144 |
realizeAllSubViews |
|
145 |
"realize all my subviews - but not myself." |
|
146 |
||
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
147 |
^ self |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
148 |
|
998 | 149 |
"Created: / 6.7.1998 / 18:37:08 / cg" |
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
150 |
! |
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
151 |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
152 |
shown |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
153 |
container isNil ifTrue:[^ false]. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
154 |
^ container shown |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
155 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
156 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
157 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
158 |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
159 |
subViewChangedSize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
160 |
^ self |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
161 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
162 |
"Created: 4.6.1996 / 21:35:57 / cg" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
163 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
164 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
165 |
windowGroup |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
166 |
^ container windowGroup |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
167 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
168 |
"Created: 5.6.1996 / 00:49:19 / cg" |
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
169 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
170 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
171 |
withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
998
diff
changeset
|
172 |
aBlock value:self |
249 | 173 |
! ! |
174 |
||
365 | 175 |
!VisualPart class methodsFor:'documentation'! |
249 | 176 |
|
177 |
version |
|
1789 | 178 |
^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.11 2003-08-18 12:12:29 cg Exp $' |
249 | 179 |
! ! |