VisualComponent.st
changeset 2659 0583c55f7000
parent 2233 7245ea01ade1
child 2664 be1086ed7c1c
--- a/VisualComponent.st	Fri May 08 13:22:02 2009 +0200
+++ b/VisualComponent.st	Fri May 08 13:47:57 2009 +0200
@@ -9,13 +9,10 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
-
-
 "{ Package: 'stx:libview2' }"
 
-Object subclass:#VisualComponent
-	instanceVariableNames:'bounds'
+DisplayObject subclass:#VisualComponent
+	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Compatibility-ST80-Graphics-Display Objects'
@@ -128,6 +125,12 @@
     "Created: / 18.6.1998 / 16:14:53 / cg"
 !
 
+geometryLayout
+    "ignored here"
+
+    ^ nil
+!
+
 geometryLayout:aLayout
     "ignored here"
 
@@ -186,10 +189,12 @@
     "Created: / 6.7.1998 / 13:48:35 / cg"
 !
 
-layout:newLayout
+layout
+    ^ self geometryLayout
+!
 
-    "Modified: / 6.7.1998 / 13:46:17 / cg"
-    "Created: / 6.7.1998 / 13:48:35 / cg"
+layout:newLayout
+    self geometryLayout:newLayout
 !
 
 level
@@ -203,6 +208,18 @@
 
     "Modified: / 6.7.1998 / 13:46:17 / cg"
     "Created: / 6.7.1998 / 13:47:43 / cg"
+!
+
+name
+    ^ self printString
+!
+
+realized
+    ^ true
+!
+
+viewBackground
+    ^ self backgroundColor
 ! !
 
 !VisualComponent methodsFor:'accessing-dimensions'!
@@ -219,19 +236,22 @@
 bounds
     "return my bounds"
 
-    ^ bounds
-
-    "Created: 8.5.1996 / 23:35:19 / cg"
-    "Modified: 9.5.1996 / 00:12:00 / cg"
+    frame isNil ifTrue:[
+        self computeBoundingBox.
+    ].
+    ^ frame
 !
 
 bounds:aRectangle
     "set my bounds"
 
-    bounds := aRectangle
+    frame := aRectangle
+!
 
-    "Created: 8.5.1996 / 23:36:07 / cg"
-    "Modified: 9.5.1996 / 00:13:12 / cg"
+extent:anExtent
+    "set my extent"
+
+    frame := frame copy extent:anExtent
 !
 
 left
@@ -246,10 +266,10 @@
 origin:newOrigin
     "move my bounds"
 
-    bounds isNil ifTrue:[
+    frame isNil ifTrue:[
         self containerChangedSize
     ].
-    bounds := newOrigin extent:(bounds extent).
+    frame := newOrigin extent:(frame extent).
 
     "Created: 8.5.1996 / 23:36:07 / cg"
     "Modified: 9.5.1996 / 00:13:12 / cg"
@@ -539,5 +559,5 @@
 !VisualComponent class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.22 2006-09-19 17:22:16 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.23 2009-05-08 11:47:57 cg Exp $'
 ! !