VComponent.st
author Claus Gittinger <cg@exept.de>
Thu, 09 May 1996 10:43:59 +0200
changeset 254 1286cec58b5d
parent 250 40acd5bd28ef
child 265 45c83acd7562
permissions -rw-r--r--
doku

"
 COPYRIGHT (c) 1996 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"



Object subclass:#VisualComponent
	instanceVariableNames:'bounds fgColor bgColor'
	classVariableNames:''
	poolDictionaries:''
	category:'Graphics-Display Objects'
!

!VisualComponent class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1996 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


!

documentation
"
    abstract superclass for all kinds of visual components.
    This is still being constructed - not yet finished.

    [author:]
        Claus Gittinger
"

! !

!VisualComponent class methodsFor:'instance creation'!

new
    ^ self basicNew initialize
! !

!VisualComponent methodsFor:'accessing'!

bounds
    "return my bounds"

    ^ bounds

    "Created: 8.5.1996 / 23:35:19 / cg"
    "Modified: 9.5.1996 / 00:12:00 / cg"
!

bounds:aRectangle
    "set my bounds"

    bounds := aRectangle

    "Created: 8.5.1996 / 23:36:07 / cg"
    "Modified: 9.5.1996 / 00:13:12 / cg"
!

container:someContainer
    "ignored here"

    "Created: 9.5.1996 / 00:48:54 / cg"
!

preferredBounds
    "return my preferredBounds"

    ^ 100@100

    "Created: 8.5.1996 / 23:36:29 / cg"
    "Modified: 9.5.1996 / 00:13:22 / cg"
!

setParentViewIn:aView
    "ignored here - for now"

    "Created: 9.5.1996 / 00:19:39 / cg"
! !

!VisualComponent methodsFor:'accessing - look'!

backgroundColor:aColor
    "set my backgroundColor"

    bgColor := aColor

    "Created: 8.5.1996 / 23:47:11 / cg"
    "Modified: 9.5.1996 / 00:13:33 / cg"
!

foregroundColor:aColor
    "set my foregroundColor"

    fgColor := aColor

    "Created: 8.5.1996 / 23:47:05 / cg"
    "Modified: 9.5.1996 / 00:13:39 / cg"
! !

!VisualComponent methodsFor:'event handling'!

buttonPress:button x:x y:y
    "button was pressed over me - ignored here"

    "Modified: 9.5.1996 / 00:14:08 / cg"
!

buttonRelease:button x:x y:y
    "button was released over me - ignored here"

    "Created: 8.5.1996 / 23:38:30 / cg"
    "Modified: 9.5.1996 / 00:14:04 / cg"
!

keyPress:key x:x y:y
    "key was pressed over me - ignored here"

    "Created: 8.5.1996 / 23:46:03 / cg"
    "Modified: 9.5.1996 / 00:14:14 / cg"
!

keyRelease:key x:x y:y
    "key was released over me - ignored here"

    "Created: 8.5.1996 / 23:46:07 / cg"
    "Modified: 9.5.1996 / 00:14:19 / cg"
! !

!VisualComponent methodsFor:'initialization'!

initialize
    fgColor := Color black.
    bgColor := Color white.

    "Created: 8.5.1996 / 23:49:54 / cg"
! !

!VisualComponent methodsFor:'testing'!

containsPoint:aPoint
    "return true, if the receiver contains aPoint"

    ^ self bounds containsPoint:aPoint

    "Created: 9.5.1996 / 00:21:44 / cg"
    "Modified: 9.5.1996 / 00:22:00 / cg"
!

hasBorder
    "return true, if the receiver shows a border"

    ^ false

    "Modified: 9.5.1996 / 00:21:29 / cg"
!

intersects:aRectangle
    "return true, if the receivers bounds intersects aRectangle"

    ^ self bounds intersects:aRectangle

    "Created: 9.5.1996 / 00:21:18 / cg"
    "Modified: 9.5.1996 / 00:22:04 / cg"
! !

!VisualComponent class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/Attic/VComponent.st,v 1.4 1996-05-08 23:16:39 cg Exp $'
! !