364
|
1 |
VisualPart subclass:#CompositePart
|
|
2 |
instanceVariableNames:'components preferredBounds'
|
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Graphics-Display Objects'
|
|
6 |
!
|
|
7 |
|
|
8 |
!CompositePart class methodsFor:'documentation'!
|
|
9 |
|
|
10 |
documentation
|
|
11 |
"
|
|
12 |
a dummy class - only existing to provide a compatible home
|
|
13 |
for fileIn of ST-80 classes.
|
|
14 |
|
|
15 |
Notice:
|
|
16 |
this class was implemented using protocol information
|
|
17 |
from alpha testers, from reading PD programs and
|
|
18 |
from the Hopkins/Horan book.
|
|
19 |
- it may not be complete or compatible to the corresponding ST-80 class.
|
|
20 |
If you encounter any incompatibilities, please forward a note
|
|
21 |
describing the incompatibility verbal (i.e. no code) to the ST/X team.
|
|
22 |
|
|
23 |
[author:]
|
|
24 |
Claus Gittinger
|
|
25 |
"
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
! !
|
|
31 |
|
|
32 |
!CompositePart methodsFor:'accessing'!
|
|
33 |
|
|
34 |
components
|
|
35 |
"return the components"
|
|
36 |
|
|
37 |
^ components
|
|
38 |
|
|
39 |
"Created: 14.2.1997 / 17:57:23 / cg"
|
|
40 |
"Modified: 14.2.1997 / 17:57:32 / cg"
|
|
41 |
! !
|
|
42 |
|
|
43 |
!CompositePart methodsFor:'adding-removing'!
|
|
44 |
|
|
45 |
add:aComponent
|
993
|
46 |
components isNil ifTrue:[
|
|
47 |
components := OrderedCollection new
|
|
48 |
].
|
999
|
49 |
components add:aComponent.
|
|
50 |
aComponent container:self.
|
|
51 |
self changed:#sizeOfContents
|
364
|
52 |
|
993
|
53 |
"Created: / 14.2.1997 / 17:57:59 / cg"
|
999
|
54 |
"Modified: / 6.7.1998 / 18:50:40 / cg"
|
364
|
55 |
!
|
|
56 |
|
|
57 |
add:aComponent at:aPoint
|
|
58 |
aComponent origin:aPoint.
|
993
|
59 |
self add:aComponent
|
|
60 |
|
|
61 |
"Created: / 14.2.1997 / 17:58:19 / cg"
|
|
62 |
"Modified: / 6.7.1998 / 13:44:01 / cg"
|
|
63 |
! !
|
|
64 |
|
|
65 |
!CompositePart methodsFor:'displaying'!
|
364
|
66 |
|
993
|
67 |
displayOn:aGC
|
|
68 |
"display the receiver on some graphicsContext.
|
|
69 |
The sender is repsonsible for restoring the GC's state
|
|
70 |
(i.e. it may be left in any undefined state)"
|
|
71 |
|
999
|
72 |
components notNil ifTrue:[
|
|
73 |
components do:[:aComponent |
|
|
74 |
aComponent displayOn:aGC
|
|
75 |
]
|
993
|
76 |
].
|
|
77 |
|
|
78 |
"Created: / 6.7.1998 / 13:59:33 / cg"
|
999
|
79 |
"Modified: / 6.7.1998 / 17:55:40 / cg"
|
|
80 |
! !
|
|
81 |
|
|
82 |
!CompositePart methodsFor:'view protocol mimicri'!
|
|
83 |
|
|
84 |
realizeAllSubViews
|
|
85 |
"realize all my subviews - but not myself."
|
|
86 |
|
|
87 |
components notNil ifTrue:[
|
|
88 |
components do:[:component |
|
|
89 |
component realize
|
|
90 |
]
|
|
91 |
].
|
|
92 |
|
|
93 |
"Modified: / 5.9.1995 / 23:30:47 / claus"
|
|
94 |
"Modified: / 13.1.1997 / 21:25:49 / cg"
|
|
95 |
"Created: / 6.7.1998 / 18:37:39 / cg"
|
364
|
96 |
! !
|
|
97 |
|
|
98 |
!CompositePart class methodsFor:'documentation'!
|
|
99 |
|
|
100 |
version
|
999
|
101 |
^ '$Header: /cvs/stx/stx/libview2/CompositePart.st,v 1.3 1998-07-10 00:01:28 cg Exp $'
|
364
|
102 |
! !
|