DSVLabelView.st
changeset 1408 1cda0a4fb566
parent 1269 f33ad4d38b5b
child 1426 9a067c26db45
--- a/DSVLabelView.st	Fri Jun 11 19:17:52 1999 +0200
+++ b/DSVLabelView.st	Fri Jun 11 19:22:15 1999 +0200
@@ -120,28 +120,21 @@
 
 !DSVLabelView methodsFor:'drawing'!
 
-redraw
-    "redraw complete view
+invalidateItem:anItem
+    "invalidate rectangle assigned to an item
     "
-    self redrawX:0 y:0 width:(self width) height:(self height).
-
+    shown ifTrue:[
+        self invalidate:(anItem layout)
+    ]
 !
 
-redrawItem:anItem
-    "redraw rectangle assigned to an item
+invalidateX:x y:y width:w height:h
+    "invalidate a rectangle
     "
-    |layout|
-
-    layout := anItem layout.
-
-    self redrawX:(layout left)
-               y:(layout top)
-           width:(layout width)
-          height:(layout height).
-
-! !
-
-!DSVLabelView methodsFor:'drawing basics'!
+    shown ifTrue:[
+        self invalidate:(Rectangle left:x top:y width:w height:h)
+    ].
+!
 
 redrawX:x y:y width:w height:h
     "redraw a rectangle
@@ -223,7 +216,7 @@
          and:[(item := self detectItemAtX:x y:y) notNil
          and:[item isSelectable]]]
         ) ifTrue:[
-            self redrawItem:(selection := item)
+            self invalidateItem:(selection := item)
         ]
     ].
     super buttonPress:button x:x y:y
@@ -245,7 +238,7 @@
         layout    := item layout.
         selection := nil.
 
-        self redrawItem:item.
+        self invalidateItem:item.
 
         same ifTrue:[
             item sendClickMsgTo:(self application)
@@ -266,13 +259,13 @@
 
     prevEntered notNil ifTrue:[
         prevEntered isSelectable ifTrue:[
-            self redrawItem:prevEntered
+            self invalidateItem:prevEntered
         ]
     ].
 
     enteredItem notNil ifTrue:[
         enteredItem isSelectable ifTrue:[
-            self redrawItem:enteredItem
+            self invalidateItem:enteredItem
         ]
     ]
 !
@@ -309,7 +302,7 @@
         self columnsSizeChanged
     ] ifTrue:[
         self updateLayoutsHeight:(self height).
-        self redraw.
+        self invalidate.
     ].
 
 
@@ -323,22 +316,19 @@
     (pX := aPoint x) == 0 ifTrue:[
         ^ self
     ].
-
+    (self sensor hasExposeEventFor:self) ifTrue:[
+        ^ self invalidate
+    ].
     point := Point x:(aPoint x) y:0.
     items do:[:anItem| anItem originChanged:point].
 
-    (self sensor hasExposeEventFor:self) ifTrue:[
-        ^ self invalidateRepairNow:true
-    ].
+    x := pX abs.
 
-    x := pX abs.
-    w := self width - x.
+    (w := self width - x) < 20 ifTrue:[
+        ^ self invalidate
+    ].
     h := self height.
 
-    w < 20 ifTrue:[
-        ^ self redraw
-    ].
-
     self catchExpose.
 
     pX < 0 ifTrue:[
@@ -347,8 +337,8 @@
     ] ifFalse:[
         self copyFrom:self x:x y:0 toX:0 y:0 width:w height:h async:true.
     ].
-    self redrawX:w y:0 width:x height:h.
     self waitForExpose.
+    self invalidateX:w y:0 width:x height:h.
 
 
 !
@@ -373,7 +363,7 @@
         self updateLayoutsHeight:height.
         self bottomInset:height negated.
     ].
-    self redraw.
+    self invalidate.
 
 ! !
 
@@ -409,5 +399,5 @@
 !DSVLabelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.21 1999-03-19 21:22:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.22 1999-06-11 17:22:04 cg Exp $'
 ! !