readOnly fields change the backgroundColor to grey.
authorClaus Gittinger <cg@exept.de>
Mon, 27 Jul 1998 10:00:38 +0200
changeset 1609 8a0c1ee30a0a
parent 1608 ce06a6553af1
child 1610 b05a3e405b33
readOnly fields change the backgroundColor to grey.
EditField.st
--- a/EditField.st	Mon Jul 27 09:56:03 1998 +0200
+++ b/EditField.st	Mon Jul 27 10:00:38 1998 +0200
@@ -1035,6 +1035,20 @@
     "Created: 27.4.1996 / 17:09:48 / cg"
 !
 
+readOnly:aBoolean
+    "make the text readonly or writable"
+
+    super readOnly:aBoolean.
+    aBoolean ifTrue:[
+        self backgroundColor:(View defaultViewBackgroundColor)
+    ] ifFalse:[
+        self backgroundColor:DefaultBackgroundColor
+    ]
+
+    "Created: / 26.7.1998 / 21:23:17 / cg"
+    "Modified: / 26.7.1998 / 21:25:38 / cg"
+!
+
 tabAction:aBlock
     "define an action to be evaluated when the tabulator key is pressed."
 
@@ -1962,5 +1976,5 @@
 !EditField class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.108 1998-05-21 13:58:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/EditField.st,v 1.109 1998-07-27 08:00:38 cg Exp $'
 ! !