author | Claus Gittinger <cg@exept.de> |
Tue, 14 Jan 1997 18:02:37 +0100 | |
changeset 365 | 47e0d48fd769 |
parent 323 | ee2f4da361a6 |
child 962 | e6ccfc7fb22e |
permissions | -rw-r--r-- |
249 | 1 |
VisualComponent subclass:#VisualPart |
2 |
instanceVariableNames:'container' |
|
3 |
classVariableNames:'' |
|
4 |
poolDictionaries:'' |
|
5 |
category:'Graphics-Display Objects' |
|
6 |
! |
|
7 |
||
365 | 8 |
!VisualPart class methodsFor:'documentation'! |
265 | 9 |
|
10 |
documentation |
|
11 |
" |
|
12 |
abstract superclass for all kinds of visual components, which |
|
13 |
are containers for some other component. |
|
14 |
This class and its subclasses (currently) exist mostly for |
|
15 |
ST-80 compatibility - to provide a home for ported PD classes, |
|
16 |
which depend on the VisualPart hierarchy. |
|
17 |
||
18 |
Notice: |
|
19 |
this class was implemented using protocol information |
|
365 | 20 |
from alpha testers, from reading PD programs and |
21 |
from the Hopkins/Horan book. |
|
265 | 22 |
- it may not be complete or compatible to the corresponding ST-80 class. |
23 |
If you encounter any incompatibilities, please forward a note |
|
24 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
25 |
This is still being constructed - not yet finished. |
|
26 |
||
27 |
[author:] |
|
28 |
Claus Gittinger |
|
29 |
||
30 |
[see also:] |
|
31 |
GeometricWrapper |
|
32 |
" |
|
33 |
||
34 |
||
35 |
! ! |
|
249 | 36 |
|
37 |
!VisualPart methodsFor:'accessing'! |
|
38 |
||
39 |
container |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
40 |
"return my container" |
249 | 41 |
|
42 |
^ container |
|
43 |
||
44 |
"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
|
45 |
"Modified: 5.6.1996 / 01:08:26 / cg" |
249 | 46 |
! |
47 |
||
48 |
container:something |
|
49 |
"set container" |
|
50 |
||
51 |
container := something. |
|
52 |
||
53 |
"Created: 9.5.1996 / 00:31:41 / cg" |
|
54 |
! |
|
55 |
||
56 |
graphicsContext |
|
57 |
"return the graphicsContext" |
|
58 |
||
254 | 59 |
^ container graphicsContext |
249 | 60 |
|
61 |
"Created: 9.5.1996 / 00:32:12 / cg" |
|
254 | 62 |
"Modified: 9.5.1996 / 01:37:10 / cg" |
63 |
! |
|
64 |
||
65 |
graphicsDevice |
|
66 |
"return the graphicsContext" |
|
67 |
||
68 |
^ container graphicsDevice |
|
69 |
||
70 |
"Created: 9.5.1996 / 00:32:12 / cg" |
|
71 |
"Modified: 9.5.1996 / 01:37:03 / cg" |
|
72 |
! |
|
73 |
||
74 |
topComponent |
|
75 |
"return the top component - typically the topView" |
|
76 |
||
77 |
^ container topComponent |
|
78 |
||
79 |
"Modified: 9.5.1996 / 01:37:10 / cg" |
|
80 |
"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
|
81 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
82 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
83 |
view |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
84 |
"return my view" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
85 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
86 |
container isNil ifTrue:[^ nil]. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
87 |
^ container view |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
88 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
89 |
"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
|
90 |
"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
|
91 |
! ! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
92 |
|
294 | 93 |
!VisualPart methodsFor:'view protocol mimicri'! |
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
94 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
95 |
containerChangedSize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
96 |
"my container changed its size. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
97 |
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
|
98 |
to resize when this happens." |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
99 |
|
323 | 100 |
"/Transcript show:'container '; show:container; show:' of '; show:self; |
101 |
"/ show:' changed size to '; showCR:container viewRectangle. |
|
102 |
||
103 |
self bounds:container viewRectangle |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
104 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
105 |
"Created: 4.6.1996 / 21:27:58 / cg" |
323 | 106 |
"Modified: 19.7.1996 / 21:20:58 / cg" |
294 | 107 |
! ! |
108 |
||
109 |
!VisualPart ignoredMethodsFor:'view protocol mimicri'! |
|
289
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
110 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
111 |
create |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
112 |
"want myself to be created." |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
113 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
114 |
container create |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
115 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
116 |
"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
|
117 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
118 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
119 |
realize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
120 |
"my container realized itself. |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
121 |
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
|
122 |
to do something when this happens." |
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 |
^ self |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
125 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
126 |
"Created: 4.6.1996 / 21:28:31 / cg" |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
127 |
! ! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
128 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
129 |
!VisualPart methodsFor:'view protocol mimicri'! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
130 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
131 |
subViewChangedSize |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
132 |
^ self |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
133 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
134 |
"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
|
135 |
! |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
136 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
137 |
windowGroup |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
138 |
^ container windowGroup |
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
139 |
|
5620dcc0c5f6
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
265
diff
changeset
|
140 |
"Created: 5.6.1996 / 00:49:19 / cg" |
249 | 141 |
! ! |
142 |
||
365 | 143 |
!VisualPart class methodsFor:'documentation'! |
249 | 144 |
|
145 |
version |
|
365 | 146 |
^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.7 1997-01-14 17:02:19 cg Exp $' |
249 | 147 |
! ! |