CompositePart.st
author Stefan Vogel <sv@exept.de>
Mon, 13 Mar 2017 09:54:33 +0100
changeset 3941 dd9237d3a727
parent 1789 f52f0a0d8448
child 3855 1db7742d33ad
permissions -rw-r--r--
#BUGFIX by stefan class: MIMETypes application/xml -> #isXmlType
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
     1
"{ Package: 'stx:libview2' }"
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
     2
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
VisualPart subclass:#CompositePart
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	instanceVariableNames:'components preferredBounds'
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	classVariableNames:''
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	poolDictionaries:''
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
     7
	category:'Compatibility-ST80-Graphics-Display Objects'
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!CompositePart class methodsFor:'documentation'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
documentation
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
    a dummy class - only existing to provide a compatible home
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
    for fileIn of ST-80 classes.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
    Notice: 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
        this class was implemented using protocol information
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
        from alpha testers, from reading PD programs and 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
        from the Hopkins/Horan book.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
        - it may not be complete or compatible to the corresponding ST-80 class. 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
        If you encounter any incompatibilities, please forward a note 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
    [author:]
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
        Claus Gittinger
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
!CompositePart methodsFor:'accessing'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
components
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
    "return the components"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    ^ components
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    "Created: 14.2.1997 / 17:57:23 / cg"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    "Modified: 14.2.1997 / 17:57:32 / cg"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!CompositePart methodsFor:'adding-removing'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
add:aComponent
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    48
    components isNil ifTrue:[
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    49
        components := OrderedCollection new
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    50
    ].
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    51
    components add:aComponent.
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    52
    aComponent container:self.
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    53
    self changed:#sizeOfContents
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    55
    "Created: / 14.2.1997 / 17:57:59 / cg"
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    56
    "Modified: / 6.7.1998 / 18:50:40 / cg"
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
add:aComponent at:aPoint
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    aComponent origin:aPoint.
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    61
    self add:aComponent
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    62
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    63
    "Created: / 14.2.1997 / 17:58:19 / cg"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    64
    "Modified: / 6.7.1998 / 13:44:01 / cg"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    65
! !
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    66
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    67
!CompositePart methodsFor:'displaying'!
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    69
displayOn:aGC
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    70
    "display the receiver on some graphicsContext. 
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    71
     The sender is repsonsible for restoring the GC's state
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    72
     (i.e. it may be left in any undefined state)"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    73
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    74
    components notNil ifTrue:[
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    75
        components do:[:aComponent |
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    76
            aComponent displayOn:aGC
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    77
        ]
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    78
    ].
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    79
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    80
    "Created: / 6.7.1998 / 13:59:33 / cg"
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    81
    "Modified: / 6.7.1998 / 17:55:40 / cg"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    82
! !
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    83
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    84
!CompositePart methodsFor:'view protocol mimicri'!
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    85
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    86
realizeAllSubViews
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    87
    "realize all my subviews - but not myself."
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    88
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    89
    components notNil ifTrue:[
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    90
        components do:[:component |
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    91
            component realize
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    92
        ]
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    93
    ].
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    94
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    95
    "Modified: / 5.9.1995 / 23:30:47 / claus"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    96
    "Modified: / 13.1.1997 / 21:25:49 / cg"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    97
    "Created: / 6.7.1998 / 18:37:39 / cg"
1220
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    98
!
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
    99
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   100
withAllSubViewsDo:aBlock
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   101
    aBlock value:self.
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   102
    components notNil ifTrue:[
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   103
        components do:[:aComponent |
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   104
            aComponent withAllSubViewsDo:aBlock
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   105
        ]
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   106
    ]
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!CompositePart class methodsFor:'documentation'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
version
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   112
    ^ '$Header: /cvs/stx/stx/libview2/CompositePart.st,v 1.5 2003-08-18 12:13:47 cg Exp $'
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
! !