use new #invalidate instead of redraw
authorClaus Gittinger <cg@exept.de>
Tue, 28 May 1996 22:11:10 +0200
changeset 711 c830bb66598b
parent 710 4e1f1023d9ae
child 712 9d6da14413a7
use new #invalidate instead of redraw
Button.st
ButtonC.st
ButtonController.st
Label.st
Toggle.st
--- a/Button.st	Tue May 28 22:05:47 1996 +0200
+++ b/Button.st	Tue May 28 22:11:10 1996 +0200
@@ -1158,10 +1158,12 @@
     onLevel := aNumber.
     (controller notNil
     and:[controller pressed]) ifTrue:[
-	self level:onLevel.
-	margin := onLevel abs max:offLevel abs.
-	self redraw
+        self level:onLevel.
+        margin := onLevel abs max:offLevel abs.
+        self invalidate. "/ redraw
     ]
+
+    "Modified: 26.5.1996 / 18:08:44 / cg"
 !
 
 activeLogo:anImageOrString
@@ -1182,17 +1184,18 @@
      (i.e. windows buttons)."
 
     self 
-	extent:(labelWidth @ labelHeight);
-	sizeFixed:true; 
-	borderWidth:0;
-	onLevel:0; 
-	offLevel:0; 
-	horizontalSpace:0; 
-	verticalSpace:0;
-	newLayout.
+        extent:(labelWidth @ labelHeight);
+        sizeFixed:true; 
+        borderWidth:0;
+        activeLevel:0; 
+        passiveLevel:0; 
+        horizontalSpace:0; 
+        verticalSpace:0;
+        newLayout.
 
     "Created: 17.9.1995 / 20:41:47 / claus"
     "Modified: 19.9.1995 / 16:34:08 / claus"
+    "Modified: 28.5.1996 / 22:04:14 / cg"
 !
 
 beReturnButton
@@ -1338,10 +1341,12 @@
     offLevel := aNumber.
     (controller notNil
     and:[controller pressed not]) ifTrue:[
-	self level:offLevel.
-	margin := onLevel abs max:offLevel abs.
-	self redraw
+        self level:offLevel.
+        margin := onLevel abs max:offLevel abs.
+        self invalidate.
     ]
+
+    "Modified: 28.5.1996 / 22:07:28 / cg"
 !
 
 passiveLogo:anImageOrString
@@ -1384,10 +1389,10 @@
         controller active:false.
         level := offLevel.
         margin := level abs.
-        self redraw
+        self invalidate
     ]
 
-    "Modified: 8.2.1996 / 15:28:06 / cg"
+    "Modified: 26.5.1996 / 18:08:58 / cg"
 !
 
 turnOffWithAction
@@ -1401,11 +1406,11 @@
             self logo:passiveLogo
         ].
         self turnOffWithoutRedraw.
-        self redraw
+        self invalidate
     ]
 
     "Created: 15.11.1995 / 16:55:37 / cg"
-    "Modified: 8.2.1996 / 15:28:36 / cg"
+    "Modified: 26.5.1996 / 18:09:00 / cg"
 !
 
 turnOffWithoutRedraw
@@ -1440,11 +1445,11 @@
         level := onLevel.
         margin := level abs.
 
-        self redraw
+        self invalidate
     ]
 
     "Created: 14.11.1995 / 22:00:45 / cg"
-    "Modified: 8.2.1996 / 15:28:24 / cg"
+    "Modified: 26.5.1996 / 18:09:01 / cg"
 !
 
 turnOnWithAction
@@ -1458,11 +1463,11 @@
             self logo:activeLogo
         ].
         self turnOnWithoutRedraw.
-        self redraw
+        self invalidate
     ]
 
     "Created: 15.11.1995 / 16:55:56 / cg"
-    "Modified: 8.2.1996 / 15:29:07 / cg"
+    "Modified: 26.5.1996 / 18:09:02 / cg"
 !
 
 turnOnWithoutRedraw
@@ -1963,28 +1968,32 @@
     "redraw myself as active (i.e. busy)"
 
     onLevel ~~ level ifTrue:[
-	self level:onLevel.
+        self level:onLevel.
     ].
     (activeLogo notNil and:[activeLogo ~~ logo]) ifTrue:[
-	self logo:activeLogo
+        self logo:activeLogo
     ].
-    self redraw.
+    self invalidate
+
+    "Modified: 26.5.1996 / 18:08:52 / cg"
 !
 
 showPassive
     "redraw myself as passive"
 
     offLevel ~~ level ifTrue:[
-	self level:offLevel.
+        self level:offLevel.
     ].
     (passiveLogo notNil and:[passiveLogo ~~ logo]) ifTrue:[
-	self logo:passiveLogo
+        self logo:passiveLogo
     ].
-    self redraw.
+    self invalidate.
+
+    "Modified: 26.5.1996 / 18:08:56 / cg"
 ! !
 
 !Button class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.60 1996-05-28 19:11:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Button.st,v 1.61 1996-05-28 20:09:52 cg Exp $'
 ! !
--- a/ButtonC.st	Tue May 28 22:05:47 1996 +0200
+++ b/ButtonC.st	Tue May 28 22:11:10 1996 +0200
@@ -479,22 +479,24 @@
 
     entered := true.
     enableChannel value ifTrue:[
-	pressed ifTrue:[
-	    "
-	     reentered after a leave with mouse-button down;
-	     restart autorepeating and/or if I am a button with
-	     triggerOnDown, show active again.
-	    "
-	    autoRepeat ifTrue:[
-		Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
-	    ].
-	    isTriggerOnDown ifFalse:[
-		view showActive.
-	    ]
-	] ifFalse:[
-	    view redraw
-	]
+        pressed ifTrue:[
+            "
+             reentered after a leave with mouse-button down;
+             restart autorepeating and/or if I am a button with
+             triggerOnDown, show active again.
+            "
+            autoRepeat ifTrue:[
+                Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
+            ].
+            isTriggerOnDown ifFalse:[
+                view showActive.
+            ]
+        ] ifFalse:[
+            view invalidate
+        ]
     ]
+
+    "Modified: 26.5.1996 / 18:09:06 / cg"
 !
 
 pointerLeave:state
@@ -503,22 +505,24 @@
 
     entered := false.
     pressed ifTrue:[
-	"
-	 leave with mouse-button down;
-	 stop autorepeating and/or if I am a button with
-	 action on release, show passive
-	"
-	autoRepeat ifTrue:[
-	    Processor removeTimedBlock:repeatBlock
-	].
-	isTriggerOnDown ifFalse:[
-	    view showPassive.
-	]
+        "
+         leave with mouse-button down;
+         stop autorepeating and/or if I am a button with
+         action on release, show passive
+        "
+        autoRepeat ifTrue:[
+            Processor removeTimedBlock:repeatBlock
+        ].
+        isTriggerOnDown ifFalse:[
+            view showPassive.
+        ]
     ] ifFalse:[
-	enableChannel value ifTrue:[
-	    view redraw
-	]
+        enableChannel value ifTrue:[
+            view invalidate
+        ]
     ]
+
+    "Modified: 26.5.1996 / 18:09:08 / cg"
 !
 
 repeat
@@ -573,5 +577,5 @@
 !ButtonController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.33 1996-05-28 18:32:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ButtonC.st,v 1.34 1996-05-28 20:11:10 cg Exp $'
 ! !
--- a/ButtonController.st	Tue May 28 22:05:47 1996 +0200
+++ b/ButtonController.st	Tue May 28 22:11:10 1996 +0200
@@ -479,22 +479,24 @@
 
     entered := true.
     enableChannel value ifTrue:[
-	pressed ifTrue:[
-	    "
-	     reentered after a leave with mouse-button down;
-	     restart autorepeating and/or if I am a button with
-	     triggerOnDown, show active again.
-	    "
-	    autoRepeat ifTrue:[
-		Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
-	    ].
-	    isTriggerOnDown ifFalse:[
-		view showActive.
-	    ]
-	] ifFalse:[
-	    view redraw
-	]
+        pressed ifTrue:[
+            "
+             reentered after a leave with mouse-button down;
+             restart autorepeating and/or if I am a button with
+             triggerOnDown, show active again.
+            "
+            autoRepeat ifTrue:[
+                Processor addTimedBlock:repeatBlock afterSeconds:initialDelay
+            ].
+            isTriggerOnDown ifFalse:[
+                view showActive.
+            ]
+        ] ifFalse:[
+            view invalidate
+        ]
     ]
+
+    "Modified: 26.5.1996 / 18:09:06 / cg"
 !
 
 pointerLeave:state
@@ -503,22 +505,24 @@
 
     entered := false.
     pressed ifTrue:[
-	"
-	 leave with mouse-button down;
-	 stop autorepeating and/or if I am a button with
-	 action on release, show passive
-	"
-	autoRepeat ifTrue:[
-	    Processor removeTimedBlock:repeatBlock
-	].
-	isTriggerOnDown ifFalse:[
-	    view showPassive.
-	]
+        "
+         leave with mouse-button down;
+         stop autorepeating and/or if I am a button with
+         action on release, show passive
+        "
+        autoRepeat ifTrue:[
+            Processor removeTimedBlock:repeatBlock
+        ].
+        isTriggerOnDown ifFalse:[
+            view showPassive.
+        ]
     ] ifFalse:[
-	enableChannel value ifTrue:[
-	    view redraw
-	]
+        enableChannel value ifTrue:[
+            view invalidate
+        ]
     ]
+
+    "Modified: 26.5.1996 / 18:09:08 / cg"
 !
 
 repeat
@@ -573,5 +577,5 @@
 !ButtonController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.33 1996-05-28 18:32:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ButtonController.st,v 1.34 1996-05-28 20:11:10 cg Exp $'
 ! !
--- a/Label.st	Tue May 28 22:05:47 1996 +0200
+++ b/Label.st	Tue May 28 22:11:10 1996 +0200
@@ -886,11 +886,11 @@
     "set the background color"
 
     aColor ~~ bgColor ifTrue:[
-	bgColor := aColor on:device.
-	shown ifTrue:[self redraw]
+        bgColor := aColor on:device.
+        shown ifTrue:[self invalidate.]
     ]
 
-    "Modified: 17.12.1995 / 15:09:03 / cg"
+    "Modified: 28.5.1996 / 22:08:10 / cg"
 !
 
 foregroundColor
@@ -903,11 +903,11 @@
     "set the foreground color"
 
     aColor ~~ fgColor ifTrue:[
-	fgColor := aColor on:device.
-	shown ifTrue:[self redraw]
+        fgColor := aColor on:device.
+        shown ifTrue:[self invalidate.]
     ].
 
-    "Modified: 17.12.1995 / 15:09:15 / cg"
+    "Modified: 28.5.1996 / 22:08:13 / cg"
 !
 
 foregroundColor:fg backgroundColor:bg
@@ -915,7 +915,9 @@
 
     fgColor := fg on:device.
     bgColor := bg on:device.
-    shown ifTrue:[self redraw]
+    shown ifTrue:[self invalidate.]
+
+    "Modified: 28.5.1996 / 22:08:16 / cg"
 ! !
 
 !Label methodsFor:'accessing-contents'!
@@ -948,7 +950,7 @@
                     logo extent = aStringOrFormOrImage extent ifTrue:[
                         logo := aStringOrFormOrImage.
                         shown ifTrue:[
-                            self redraw
+                            self invalidate
                         ].
                         ^ self
                     ]
@@ -963,7 +965,7 @@
         self newLayout
     ]
 
-    "Modified: 8.5.1996 / 08:20:46 / cg"
+    "Modified: 26.5.1996 / 18:09:49 / cg"
 !
 
 labelString:aString
@@ -1184,14 +1186,16 @@
     prevPosition := labelOriginX.
     self computeLabelOrigin
     shown ifTrue:[
-	(adjust == #fit
-	or:[labelOriginX ~~ prevPosition 
-	or:[how ~~ #smaller]]) ifTrue:[
-	    "/ self clear.
-	    self redraw.
-	    self redrawEdges
-	]
+        (adjust == #fit
+        or:[labelOriginX ~~ prevPosition 
+        or:[how ~~ #smaller]]) ifTrue:[
+            "/ self clear.
+            self invalidate.
+"/            self redrawEdges
+        ]
     ]
+
+    "Modified: 26.5.1996 / 18:09:58 / cg"
 ! !
 
 !Label methodsFor:'initialization'!
@@ -1387,13 +1391,15 @@
 
     self computeLabelSize.
     fixSize ifFalse:[
-	self resize
+        self resize
     ] ifTrue:[
-	self computeLabelOrigin
+        self computeLabelOrigin
     ].
     shown ifTrue:[
-	self redraw
+        self invalidate
     ]
+
+    "Modified: 26.5.1996 / 18:09:52 / cg"
 ! !
 
 !Label methodsFor:'queries'!
@@ -1582,5 +1588,5 @@
 !Label class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.62 1996-05-22 11:24:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.63 1996-05-28 20:09:26 cg Exp $'
 ! !
--- a/Toggle.st	Tue May 28 22:05:47 1996 +0200
+++ b/Toggle.st	Tue May 28 22:11:10 1996 +0200
@@ -208,21 +208,6 @@
                                                                         [exEnd]
 
 
-      changing lamps color & size:
-                                                                        [exBegin]
-        |v t|
-
-        v := StandardSystemView new extent:200@200.
-        t := Toggle label:'off' in:v.
-        t showLamp:true.
-        t lampColor:Color red.
-        t origin:10 @ 10.
-        t pressAction:[Transcript showCR:'on'. t label:'on'.].
-        t releaseAction:[Transcript showCR:'off'. t label:'off'.].
-        v open
-                                                                        [exEnd]
-
-
       lamp only - no '3D going-in' (this is the default with IRIS style)
                                                                         [exBegin]
         |v t|
@@ -393,8 +378,10 @@
 
     lampColor := aColor.
     (shown and:[showLamp and:[controller pressed]]) ifTrue:[
-	self redraw
+        self invalidate
     ]
+
+    "Modified: 28.5.1996 / 21:39:44 / cg"
 !
 
 showLamp
@@ -525,5 +512,5 @@
 !Toggle class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.30 1996-05-18 15:42:54 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Toggle.st,v 1.31 1996-05-28 20:10:12 cg Exp $'
 ! !