--- a/VisualComponent.st Mon May 13 10:30:42 1996 +0200
+++ b/VisualComponent.st Mon May 13 10:50:38 1996 +0200
@@ -40,10 +40,23 @@
documentation
"
abstract superclass for all kinds of visual components.
- This is still being constructed - not yet finished.
+ This class and its subclasses (currently) exist mostly for
+ ST-80 compatibility - to provide a home for ported PD classes,
+ which depend on the VisualComponent 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
"
! !
@@ -115,6 +128,21 @@
"Modified: 9.5.1996 / 00:13:39 / cg"
! !
+!VisualComponent methodsFor:'displaying'!
+
+displayOn:aGC x:x y:y
+ |oldTranslation|
+
+ oldTranslation := aGC translation.
+ aGC translation:(x @ y).
+
+ self displayOn:aGC.
+
+ aGC translation:oldTranslation
+
+ "Created: 13.5.1996 / 10:18:43 / cg"
+! !
+
!VisualComponent methodsFor:'event handling'!
buttonPress:button x:x y:y
@@ -153,6 +181,29 @@
"Created: 8.5.1996 / 23:49:54 / cg"
! !
+!VisualComponent methodsFor:'queries'!
+
+heightOn:aGC
+ "return my height, if displayed on aGC;
+ I assume that my height is independent of the device, and return
+ the bounds height"
+
+ ^ self bounds height
+
+ "Modified: 13.5.1996 / 10:15:13 / cg"
+!
+
+widthOn:aGC
+ "return my width, if displayed on aGC;
+ I assume that my width is independent of the device, and return
+ the bounds width"
+
+ ^ self bounds width
+
+ "Created: 13.5.1996 / 10:14:44 / cg"
+ "Modified: 13.5.1996 / 10:15:17 / cg"
+! !
+
!VisualComponent methodsFor:'testing'!
containsPoint:aPoint
@@ -184,5 +235,5 @@
!VisualComponent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.4 1996-05-08 23:16:39 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.5 1996-05-13 08:50:38 cg Exp $'
! !