eliminated direct refs to paint instvar
authorClaus Gittinger <cg@exept.de>
Wed, 18 Feb 1998 12:55:01 +0100
changeset 1449 2a54bdfff203
parent 1448 4220c80ab099
child 1450 4ae9757ed852
eliminated direct refs to paint instvar
ETxtView.st
EditTextView.st
--- a/ETxtView.st	Fri Feb 13 22:56:03 1998 +0100
+++ b/ETxtView.st	Wed Feb 18 12:55:01 1998 +0100
@@ -1211,76 +1211,76 @@
     "draw a cursor; the argument cursorType specifies what type
      of cursor should be drawn.
      Currently, supported are: #block, #frame, #ibeam, #caret, #solidCaret
-			       #bigCaret and #bigSolidCaret"
+                               #bigCaret and #bigSolidCaret"
 
     |x y w char y2 x1 x2 oldPaint oldClip|
 
     self hasSelection ifTrue:[
-	"
-	 hide cursor, if there is a selection
-	"
-	^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+        "
+         hide cursor, if there is a selection
+        "
+        ^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
     ].
 
     cursorType == #none ifTrue:[
-	^ self
+        ^ self
     ].
 
     cursorType == #block ifTrue:[
-	super drawVisibleLine:cursorVisibleLine 
-			  col:cursorCol 
-			 with:fgColor
-			  and:bgColor.
-	^ self
+        super drawVisibleLine:cursorVisibleLine 
+                          col:cursorCol 
+                         with:fgColor
+                          and:bgColor.
+        ^ self
     ].
     x := (self xOfCol:cursorCol inVisibleLine:cursorVisibleLine) - leftOffset.
     y := self yOfVisibleLine:cursorVisibleLine.
 
-    oldPaint := paint. "/ do not clobber GC
+    oldPaint := self paint. "/ do not clobber GC
     cursorType == #frame ifTrue:[
-	super redrawVisibleLine:cursorVisibleLine col:cursorCol.
-
-	char := self characterUnderCursor asString.
-	self paint:bgColor.
-	self displayRectangleX:x y:y 
-			 width:(font widthOf:char) height:fontHeight.
+        super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+
+        char := self characterUnderCursor asString.
+        self paint:bgColor.
+        self displayRectangleX:x y:y 
+                         width:(font widthOf:char) height:fontHeight.
     ] ifFalse:[
-	self paint:bgColor.
-	cursorType == #ibeam ifTrue:[
-	    x1 := x - 1.
-	    y2 := y + fontHeight - 1.
-	    self displayLineFromX:x1 y:y toX:x1 y:y2. 
-	    self displayLineFromX:x y:y toX:x y:y2. 
-	    ^ self
-	] ifFalse:[
-	    y := y + fontHeight - 3.
-	    ((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
-		w := (fontWidth * 2 // 3) max:4.
-		y2 := y + w + (w//2).
-	    ] ifFalse:[
-		w := (fontWidth // 2) max:4.
-		y2 := y + w.
-	    ].
-	    x1 := x - w.
-	    x2 := x + w.
-
-	    oldClip := self clippingRectangleOrNil.
-	    self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
-
-	    cursorType == #caret ifTrue:[
-		self lineWidth:2.
-		self displayLineFromX:x1 y:y2 toX:x y:y. 
-		self displayLineFromX:x y:y toX:x2 y:y2. 
-	    ] ifFalse:[
-		"anything else: solidCaret"
-
-		self fillPolygon:(Array with:(x1 @ y2)
-					with:(x @ y)
-					with:(x2 @ y2))
-	    ].
-
-	    self clippingRectangle:oldClip
-	]
+        self paint:bgColor.
+        cursorType == #ibeam ifTrue:[
+            x1 := x - 1.
+            y2 := y + fontHeight - 1.
+            self displayLineFromX:x1 y:y toX:x1 y:y2. 
+            self displayLineFromX:x y:y toX:x y:y2. 
+            ^ self
+        ] ifFalse:[
+            y := y + fontHeight - 3.
+            ((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
+                w := (fontWidth * 2 // 3) max:4.
+                y2 := y + w + (w//2).
+            ] ifFalse:[
+                w := (fontWidth // 2) max:4.
+                y2 := y + w.
+            ].
+            x1 := x - w.
+            x2 := x + w.
+
+            oldClip := self clippingRectangleOrNil.
+            self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
+
+            cursorType == #caret ifTrue:[
+                self lineWidth:2.
+                self displayLineFromX:x1 y:y2 toX:x y:y. 
+                self displayLineFromX:x y:y toX:x2 y:y2. 
+            ] ifFalse:[
+                "anything else: solidCaret"
+
+                self fillPolygon:(Array with:(x1 @ y2)
+                                        with:(x @ y)
+                                        with:(x2 @ y2))
+            ].
+
+            self clippingRectangle:oldClip
+        ]
     ].
     self paint:oldPaint.
 
@@ -4179,5 +4179,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.147 1998-02-06 11:58:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ETxtView.st,v 1.148 1998-02-18 11:55:01 cg Exp $'
 ! !
--- a/EditTextView.st	Fri Feb 13 22:56:03 1998 +0100
+++ b/EditTextView.st	Wed Feb 18 12:55:01 1998 +0100
@@ -1211,76 +1211,76 @@
     "draw a cursor; the argument cursorType specifies what type
      of cursor should be drawn.
      Currently, supported are: #block, #frame, #ibeam, #caret, #solidCaret
-			       #bigCaret and #bigSolidCaret"
+                               #bigCaret and #bigSolidCaret"
 
     |x y w char y2 x1 x2 oldPaint oldClip|
 
     self hasSelection ifTrue:[
-	"
-	 hide cursor, if there is a selection
-	"
-	^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+        "
+         hide cursor, if there is a selection
+        "
+        ^ super redrawVisibleLine:cursorVisibleLine col:cursorCol.
     ].
 
     cursorType == #none ifTrue:[
-	^ self
+        ^ self
     ].
 
     cursorType == #block ifTrue:[
-	super drawVisibleLine:cursorVisibleLine 
-			  col:cursorCol 
-			 with:fgColor
-			  and:bgColor.
-	^ self
+        super drawVisibleLine:cursorVisibleLine 
+                          col:cursorCol 
+                         with:fgColor
+                          and:bgColor.
+        ^ self
     ].
     x := (self xOfCol:cursorCol inVisibleLine:cursorVisibleLine) - leftOffset.
     y := self yOfVisibleLine:cursorVisibleLine.
 
-    oldPaint := paint. "/ do not clobber GC
+    oldPaint := self paint. "/ do not clobber GC
     cursorType == #frame ifTrue:[
-	super redrawVisibleLine:cursorVisibleLine col:cursorCol.
-
-	char := self characterUnderCursor asString.
-	self paint:bgColor.
-	self displayRectangleX:x y:y 
-			 width:(font widthOf:char) height:fontHeight.
+        super redrawVisibleLine:cursorVisibleLine col:cursorCol.
+
+        char := self characterUnderCursor asString.
+        self paint:bgColor.
+        self displayRectangleX:x y:y 
+                         width:(font widthOf:char) height:fontHeight.
     ] ifFalse:[
-	self paint:bgColor.
-	cursorType == #ibeam ifTrue:[
-	    x1 := x - 1.
-	    y2 := y + fontHeight - 1.
-	    self displayLineFromX:x1 y:y toX:x1 y:y2. 
-	    self displayLineFromX:x y:y toX:x y:y2. 
-	    ^ self
-	] ifFalse:[
-	    y := y + fontHeight - 3.
-	    ((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
-		w := (fontWidth * 2 // 3) max:4.
-		y2 := y + w + (w//2).
-	    ] ifFalse:[
-		w := (fontWidth // 2) max:4.
-		y2 := y + w.
-	    ].
-	    x1 := x - w.
-	    x2 := x + w.
-
-	    oldClip := self clippingRectangleOrNil.
-	    self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
-
-	    cursorType == #caret ifTrue:[
-		self lineWidth:2.
-		self displayLineFromX:x1 y:y2 toX:x y:y. 
-		self displayLineFromX:x y:y toX:x2 y:y2. 
-	    ] ifFalse:[
-		"anything else: solidCaret"
-
-		self fillPolygon:(Array with:(x1 @ y2)
-					with:(x @ y)
-					with:(x2 @ y2))
-	    ].
-
-	    self clippingRectangle:oldClip
-	]
+        self paint:bgColor.
+        cursorType == #ibeam ifTrue:[
+            x1 := x - 1.
+            y2 := y + fontHeight - 1.
+            self displayLineFromX:x1 y:y toX:x1 y:y2. 
+            self displayLineFromX:x y:y toX:x y:y2. 
+            ^ self
+        ] ifFalse:[
+            y := y + fontHeight - 3.
+            ((cursorType == #bigCaret) or:[cursorType == #bigSolidCaret]) ifTrue:[
+                w := (fontWidth * 2 // 3) max:4.
+                y2 := y + w + (w//2).
+            ] ifFalse:[
+                w := (fontWidth // 2) max:4.
+                y2 := y + w.
+            ].
+            x1 := x - w.
+            x2 := x + w.
+
+            oldClip := self clippingRectangleOrNil.
+            self clippingRectangle:(margin@margin extent:(width-margin) @ (height-margin)).
+
+            cursorType == #caret ifTrue:[
+                self lineWidth:2.
+                self displayLineFromX:x1 y:y2 toX:x y:y. 
+                self displayLineFromX:x y:y toX:x2 y:y2. 
+            ] ifFalse:[
+                "anything else: solidCaret"
+
+                self fillPolygon:(Array with:(x1 @ y2)
+                                        with:(x @ y)
+                                        with:(x2 @ y2))
+            ].
+
+            self clippingRectangle:oldClip
+        ]
     ].
     self paint:oldPaint.
 
@@ -4179,5 +4179,5 @@
 !EditTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.147 1998-02-06 11:58:28 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditTextView.st,v 1.148 1998-02-18 11:55:01 cg Exp $'
 ! !