VisualComponent subclass:#VisualPart
instanceVariableNames:'container'
classVariableNames:''
poolDictionaries:''
category:'Graphics-Display Objects'
!
!VisualPart class methodsFor:'documentation'!
documentation
"
abstract superclass for all kinds of visual components, which
are containers for some other component.
This class and its subclasses (currently) exist mostly for
ST-80 compatibility - to provide a home for ported PD classes,
which depend on the VisualPart hierarchy.
Notice:
this class was implemented using protocol information
from alpha testers, from reading PD programs and
from the Hopkins/Horan book.
- it may not be complete or compatible to the corresponding ST-80 class.
If you encounter any incompatibilities, please forward a note
describing the incompatibility verbal (i.e. no code) to the ST/X team.
This is still being constructed - not yet finished.
[author:]
Claus Gittinger
[see also:]
GeometricWrapper
"
! !
!VisualPart methodsFor:'accessing'!
backgroundColor
^ container backgroundColor
"Created: / 18.6.1998 / 15:58:34 / cg"
!
container
"return my container"
^ container
"Created: 9.5.1996 / 00:31:41 / cg"
"Modified: 5.6.1996 / 01:08:26 / cg"
!
container:something
"set container"
container := something.
"Created: 9.5.1996 / 00:31:41 / cg"
!
graphicsContext
"return the graphicsContext"
^ container graphicsContext
"Created: 9.5.1996 / 00:32:12 / cg"
"Modified: 9.5.1996 / 01:37:10 / cg"
!
graphicsDevice
"return the graphicsContext"
^ container graphicsDevice
"Created: 9.5.1996 / 00:32:12 / cg"
"Modified: 9.5.1996 / 01:37:03 / cg"
!
topComponent
"return the top component - typically the topView"
^ container topComponent
"Modified: 9.5.1996 / 01:37:10 / cg"
"Created: 9.5.1996 / 01:39:15 / cg"
!
view
"return my view"
container isNil ifTrue:[^ nil].
^ container view
"Created: 4.6.1996 / 21:32:34 / cg"
"Modified: 5.6.1996 / 01:20:13 / cg"
! !
!VisualPart methodsFor:'view protocol mimicri'!
containerChangedSize
"my container changed its size.
The default here is to ignore this, but some wrappers like
to resize when this happens."
"/Transcript show:'container '; show:container; show:' of '; show:self;
"/ show:' changed size to '; showCR:container viewRectangle.
self bounds:container viewRectangle
"Created: 4.6.1996 / 21:27:58 / cg"
"Modified: 19.7.1996 / 21:20:58 / cg"
!
create
"want myself to be created."
container create
"Created: 4.6.1996 / 21:30:25 / cg"
!
invalidate
container notNil ifTrue:[
container invalidate:self bounds
]
"Modified: / 18.6.1998 / 16:12:15 / cg"
!
realize
"my container realized itself.
The default here is to ignore this, but some wrappers like
to do something when this happens."
self realizeAllSubViews
"Created: / 4.6.1996 / 21:28:31 / cg"
"Modified: / 6.7.1998 / 18:38:28 / cg"
!
realizeAllSubViews
"realize all my subviews - but not myself."
^ self
"Created: / 6.7.1998 / 18:37:08 / cg"
!
shown
container isNil ifTrue:[^ false].
^ container shown
!
subViewChangedSize
^ self
"Created: 4.6.1996 / 21:35:57 / cg"
!
windowGroup
^ container windowGroup
"Created: 5.6.1996 / 00:49:19 / cg"
!
withAllSubViewsDo:aBlock
aBlock value:self
! !
!VisualPart class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.10 1999-08-18 19:49:56 cg Exp $'
! !