VisualPart.st
author Claus Gittinger <cg@exept.de>
Mon, 22 Jul 1996 11:02:58 +0200
changeset 323 ee2f4da361a6
parent 294 f44534fc18e4
child 365 47e0d48fd769
permissions -rw-r--r--
checkin from browser

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 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'!

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"
! !

!VisualPart ignoredMethodsFor:'view protocol mimicri'!

create
    "want myself to be created."

    container create

    "Created: 4.6.1996 / 21:30:25 / cg"
!

realize
    "my container realized itself.
     The default here is to ignore this, but some wrappers like
     to do something when this happens."

    ^ self

    "Created: 4.6.1996 / 21:28:31 / cg"
! !

!VisualPart methodsFor:'view protocol mimicri'!

subViewChangedSize
    ^ self

    "Created: 4.6.1996 / 21:35:57 / cg"
!

windowGroup
    ^ container windowGroup

    "Created: 5.6.1996 / 00:49:19 / cg"
! !

!VisualPart  class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.6 1996-07-22 09:02:16 cg Exp $'
! !