VisualPart.st
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--
commentary
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
VisualComponent subclass:#VisualPart
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
	instanceVariableNames:'container'
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	classVariableNames:''
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
	poolDictionaries:''
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
	category:'Graphics-Display Objects'
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
     8
!VisualPart class methodsFor:'documentation'!
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
     9
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    10
documentation
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    11
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    12
    abstract superclass for all kinds of visual components, which
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    13
    are containers for some other component.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    14
    This class and its subclasses (currently) exist mostly for
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    15
    ST-80 compatibility - to provide a home for ported PD classes,
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    16
    which depend on the VisualPart hierarchy.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    17
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    18
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    19
        this class was implemented using protocol information
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
    20
        from alpha testers, from reading PD programs and 
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
    21
        from the Hopkins/Horan book.
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    22
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    23
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    24
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    25
        This is still being constructed - not yet finished.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    26
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    27
    [author:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    28
        Claus Gittinger
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    29
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    30
    [see also:]
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    31
        GeometricWrapper
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    32
"
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    33
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    34
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
    35
! !
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!VisualPart methodsFor:'accessing'!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    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
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    ^ container
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    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
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
container:something
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    "set container"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    container := something.
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    "Created: 9.5.1996 / 00:31:41 / cg"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
graphicsContext
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    "return the graphicsContext"
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    59
    ^ container graphicsContext
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    "Created: 9.5.1996 / 00:32:12 / cg"
254
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    62
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    63
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    64
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    65
graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    66
    "return the graphicsContext"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    67
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    68
    ^ container graphicsDevice
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    69
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    70
    "Created: 9.5.1996 / 00:32:12 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    71
    "Modified: 9.5.1996 / 01:37:03 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    72
!
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    73
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    74
topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    75
    "return the top component - typically the topView"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    76
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    77
    ^ container topComponent
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    78
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    79
    "Modified: 9.5.1996 / 01:37:10 / cg"
Claus Gittinger <cg@exept.de>
parents: 249
diff changeset
    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
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
    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
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   100
"/Transcript show:'container '; show:container; show:' of '; show:self; 
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   101
"/           show:' changed size to '; showCR:container viewRectangle.
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   102
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   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
ee2f4da361a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   106
    "Modified: 19.7.1996 / 21:20:58 / cg"
294
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   107
! !
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   108
f44534fc18e4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 289
diff changeset
   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
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
! !
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   143
!VisualPart class methodsFor:'documentation'!
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
version
365
47e0d48fd769 commentary
Claus Gittinger <cg@exept.de>
parents: 323
diff changeset
   146
    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.7 1997-01-14 17:02:19 cg Exp $'
249
38827944ca9c intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
! !