CompositePart.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 30 May 2018 09:37:07 +0100
branchjv
changeset 4132 7e5528572373
parent 3855 1db7742d33ad
permissions -rw-r--r--
Copyright updates
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3855
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     1
"
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     2
 COPYRIGHT (c) Claus Gittinger / 2006 by eXept Software AG
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     3
              All Rights Reserved
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     4
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     5
 This software is furnished under a license and may be used
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     6
 only in accordance with the terms of that license and with the
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
     9
 other person.  No title to or ownership of the software is
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    10
 hereby transferred.
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    11
"
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    12
"{ Package: 'stx:libview2' }"
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    13
3855
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    14
"{ NameSpace: Smalltalk }"
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    15
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
VisualPart subclass:#CompositePart
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'components preferredBounds'
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
    20
	category:'Compatibility-ST80-Graphics-Display Objects'
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!CompositePart class methodsFor:'documentation'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
3855
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    25
copyright
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    26
"
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    27
 COPYRIGHT (c) Claus Gittinger / 2006 by eXept Software AG
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    28
              All Rights Reserved
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    29
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    30
 This software is furnished under a license and may be used
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    31
 only in accordance with the terms of that license and with the
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    33
 be provided or otherwise made available to, or used by, any
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    34
 other person.  No title to or ownership of the software is
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    35
 hereby transferred.
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    36
"
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    37
!
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
    38
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    a dummy class - only existing to provide a compatible home
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    for fileIn of ST-80 classes.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Notice: 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        this class was implemented using protocol information
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
        from alpha testers, from reading PD programs and 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        from the Hopkins/Horan book.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        - it may not be complete or compatible to the corresponding ST-80 class. 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        If you encounter any incompatibilities, please forward a note 
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    [author:]
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        Claus Gittinger
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
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
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
!CompositePart methodsFor:'accessing'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
components
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "return the components"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    ^ components
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    "Created: 14.2.1997 / 17:57:23 / cg"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    "Modified: 14.2.1997 / 17:57:32 / cg"
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!CompositePart methodsFor:'adding-removing'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
add:aComponent
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    75
    components isNil ifTrue:[
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    76
        components := OrderedCollection new
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    77
    ].
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    78
    components add:aComponent.
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    79
    aComponent container:self.
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    80
    self changed:#sizeOfContents
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    82
    "Created: / 14.2.1997 / 17:57:59 / cg"
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    83
    "Modified: / 6.7.1998 / 18:50:40 / cg"
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
add:aComponent at:aPoint
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    aComponent origin:aPoint.
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    88
    self add:aComponent
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    89
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    90
    "Created: / 14.2.1997 / 17:58:19 / cg"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    91
    "Modified: / 6.7.1998 / 13:44:01 / cg"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    92
! !
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    93
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    94
!CompositePart methodsFor:'displaying'!
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    96
displayOn:aGC
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    97
    "display the receiver on some graphicsContext. 
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    98
     The sender is repsonsible for restoring the GC's state
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
    99
     (i.e. it may be left in any undefined state)"
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
   100
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   101
    components notNil ifTrue:[
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   102
        components do:[:aComponent |
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   103
            aComponent displayOn:aGC
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   104
        ]
993
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
   105
    ].
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
   106
2b42f3515f05 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 364
diff changeset
   107
    "Created: / 6.7.1998 / 13:59:33 / cg"
999
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   108
    "Modified: / 6.7.1998 / 17:55:40 / cg"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   109
! !
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   110
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   111
!CompositePart methodsFor:'view protocol mimicri'!
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   112
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   113
realizeAllSubViews
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   114
    "realize all my subviews - but not myself."
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   115
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   116
    components notNil ifTrue:[
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   117
        components do:[:component |
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   118
            component realize
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   119
        ]
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   120
    ].
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   121
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   122
    "Modified: / 5.9.1995 / 23:30:47 / claus"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   123
    "Modified: / 13.1.1997 / 21:25:49 / cg"
d2eeb6201c2f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   124
    "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
   125
!
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   126
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   127
withAllSubViewsDo:aBlock
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   128
    aBlock value:self.
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   129
    components notNil ifTrue:[
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   130
        components do:[:aComponent |
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   131
            aComponent withAllSubViewsDo:aBlock
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   132
        ]
39e5e28042da protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents: 999
diff changeset
   133
    ]
364
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
! !
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!CompositePart class methodsFor:'documentation'!
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
bacd91f54052 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
version
1789
f52f0a0d8448 category
Claus Gittinger <cg@exept.de>
parents: 1220
diff changeset
   139
    ^ '$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
   140
! !
3855
1db7742d33ad Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 1789
diff changeset
   141