*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 08 May 2009 17:35:18 +0200
changeset 2666 01b3cb9faa58
parent 2665 2e57436c3213
child 2667 523afff34647
*** empty log message ***
VisualPart.st
--- a/VisualPart.st	Fri May 08 16:17:09 2009 +0200
+++ b/VisualPart.st	Fri May 08 17:35:18 2009 +0200
@@ -12,7 +12,7 @@
 "{ Package: 'stx:libview2' }"
 
 VisualComponent subclass:#VisualPart
-	instanceVariableNames:'container'
+	instanceVariableNames:'container layout name'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Compatibility-ST80-Graphics-Display Objects'
@@ -104,6 +104,14 @@
     "Modified: 9.5.1996 / 01:37:03 / cg"
 !
 
+name
+    ^ name
+!
+
+name:something
+    name := something.
+!
+
 topComponent
     "return the top component - typically the topView"
 
@@ -123,12 +131,26 @@
     "Modified: 5.6.1996 / 01:20:13 / cg"
 ! !
 
+!VisualPart methodsFor:'accessing-dimensions'!
+
+bounds:newBounds
+    frame notNil ifTrue:[
+        container invalidate:frame.
+    ].
+    frame := newBounds.
+    container invalidate:frame.
+! !
+
 !VisualPart methodsFor:'view protocol mimicri'!
 
 bottomInset
     ^ 0
 !
 
+computeCorner
+    ^ self corner
+!
+
 computeExtent
     ^ self extent
 !
@@ -146,13 +168,11 @@
 "/           show:' changed size to '; showCR:container viewRectangle.
 
     self layout notNil ifTrue:[
-        frame := self layout 
-                    rectangleRelativeTo:container bounds
-                    preferred:self preferredBounds.
-
-        "/ container invalidate:frame.
+        self bounds:(self layout 
+                        rectangleRelativeTo:container bounds
+                        preferred:self preferredBounds).
     ].
-    self invalidate.
+    "/ self invalidate.
 
     "Created: 4.6.1996 / 21:27:58 / cg"
     "Modified: 19.7.1996 / 21:20:58 / cg"
@@ -188,6 +208,26 @@
     ^ nil
 !
 
+geometryLayout
+    ^ layout 
+!
+
+geometryLayout:newLayoutOrNil
+    |container newFrame|
+
+    newLayoutOrNil notNil ifTrue:[
+        container := self container.
+        container notNil ifTrue:[
+            newFrame := newLayoutOrNil 
+                        rectangleRelativeTo:container bounds
+                        preferred:self preferredBounds.
+
+            self bounds:newFrame.
+        ].
+    ].
+    layout := newLayoutOrNil.
+!
+
 invalidate
     container notNil ifTrue:[
         container invalidate:self bounds
@@ -316,5 +356,5 @@
 !VisualPart class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.14 2009-05-08 14:17:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/VisualPart.st,v 1.15 2009-05-08 15:35:18 cg Exp $'
 ! !