*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Sun, 02 Nov 1997 18:39:14 +0100
changeset 1374 578f71a242f7
parent 1373 ffd73dd21ccd
child 1375 667de5b52ccb
*** empty log message ***
Label.st
--- a/Label.st	Sun Nov 02 18:35:07 1997 +0100
+++ b/Label.st	Sun Nov 02 18:39:14 1997 +0100
@@ -494,7 +494,7 @@
                                                                         [exEnd]
 
 
-     Channel operation (controlling gf, bg and labelText via ValueHolders)
+     Channel operation (controlling fg, bg and labelText via ValueHolders)
      -----------------
                                                                         [exBegin]
         |top panel logoChannel fgChannel bgChannel l b|
@@ -821,10 +821,12 @@
 
     DefaultForegroundColor := StyleSheet colorAt:'label.foregroundColor'.
     DefaultForegroundColor isNil ifTrue:[
+        "/ fallBack: comon value
         DefaultForegroundColor := StyleSheet colorAt:'foregroundColor' default:Black.
     ].
     DefaultBackgroundColor := StyleSheet colorAt:'label.backgroundColor'.
     DefaultBackgroundColor isNil ifTrue:[
+        "/ fallBack: comon value
         DefaultBackgroundColor := StyleSheet colorAt:'backgroundColor'.
     ].
     DefaultFont := StyleSheet fontAt:'label.font'.
@@ -833,59 +835,73 @@
      self updateStyleCache
     "
 
-    "Modified: 20.10.1997 / 13:55:25 / cg"
+    "Modified: / 31.10.1997 / 14:53:48 / cg"
 ! !
 
 !Label methodsFor:'accessing-channels'!
 
 backgroundChannel
+    "return the backgroundChannel - or nil"
+
     ^ backgroundChannel.
 
-    "Created: 16.12.1995 / 15:50:08 / cg"
+    "Created: / 16.12.1995 / 15:50:08 / cg"
+    "Modified: / 31.10.1997 / 14:42:49 / cg"
 !
 
 backgroundChannel:aValueHolder
+    "set the foregroundChannel - a valueHolder holding a color"
+
     |prev|
 
     prev := backgroundChannel.
-    aValueHolder ~~ prev ifTrue:[
-        backgroundChannel := aValueHolder.
-        self setupChannel:aValueHolder for:#backgroundChannelChanged withOld:prev 
-    ]
+    backgroundChannel := aValueHolder.
+    self setupChannel:aValueHolder for:nil withOld:prev
 
-    "Modified: 28.3.1997 / 20:43:39 / cg"
+    "Modified: / 31.10.1997 / 14:39:05 / cg"
 !
 
 foregroundChannel
+    "return the foregroundChannel - or nil"
+
     ^ foregroundChannel.
 
-    "Created: 16.12.1995 / 15:50:01 / cg"
+    "Created: / 16.12.1995 / 15:50:01 / cg"
+    "Modified: / 31.10.1997 / 14:43:05 / cg"
 !
 
 foregroundChannel:aValueHolder
+    "set the foregroundChannel - a valueHolder holding a color"
+
     |prev|
 
     prev := foregroundChannel.
-    aValueHolder ~~ prev ifTrue:[
-        foregroundChannel := aValueHolder.
-        self setupChannel:aValueHolder for:#foregroundChannelChanged withOld:prev 
-    ]
+    foregroundChannel := aValueHolder.
+    self setupChannel:aValueHolder for:nil withOld:prev
 
-    "Modified: 28.3.1997 / 20:43:17 / cg"
+    "Modified: / 31.10.1997 / 14:38:38 / cg"
 !
 
 labelChannel
+    "return the labelChannel - or nil"
+
     ^ labelChannel.
 
-    "Created: 16.12.1995 / 15:50:18 / cg"
+    "Created: / 16.12.1995 / 15:50:18 / cg"
+    "Modified: / 31.10.1997 / 14:43:14 / cg"
 !
 
 labelChannel:aValueHolder
+    "set the labelChannel - a valueHolder holding a string or image
+     which is shown as my logo"
+
     |prev|
 
     prev := labelChannel.
     labelChannel := aValueHolder.
-    self setupChannel:aValueHolder for:#labelChannelChanged withOld:prev 
+    self setupChannel:aValueHolder for:nil withOld:prev
+
+    "Modified: / 31.10.1997 / 14:37:02 / cg"
 ! !
 
 !Label methodsFor:'accessing-colors'!
@@ -1194,28 +1210,33 @@
 
 !Label methodsFor:'change & update'!
 
-backgroundChannelChanged
-    self backgroundColor:(backgroundChannel value)
-!
-
-foregroundChannelChanged
-    self foregroundColor:(foregroundChannel value)
-!
-
-labelChannelChanged
-    self label:(labelChannel value)
-!
-
 update:something with:aParameter from:changedObject
     "the MVC way of changing the label ..."
 
-    changedObject == model ifTrue:[
-	something == aspectMsg ifTrue:[
-	    self getLabelFromModel.
-	    ^ self.
-	]
+    changedObject notNil ifTrue:[
+        changedObject == backgroundChannel ifTrue:[
+            self backgroundColor:(backgroundChannel value).
+            ^ self
+        ].
+        changedObject == foregroundChannel ifTrue:[
+            self foregroundColor:(foregroundChannel value).
+            ^ self
+        ].
+        changedObject == labelChannel ifTrue:[
+            self label:(labelChannel value).
+            ^ self
+        ].
+
+        changedObject == model ifTrue:[
+            something == aspectMsg ifTrue:[
+                self getLabelFromModel.
+                ^ self.
+            ]
+        ].
     ].
     ^ super update:something with:aParameter from:changedObject
+
+    "Modified: / 31.10.1997 / 14:32:02 / cg"
 ! !
 
 !Label methodsFor:'event handling'!
@@ -1271,9 +1292,12 @@
         fgColor := DefaultForegroundColor
     ] ifFalse:[
         fgColor := Black.
+    ].
+    self class == Label ifTrue:[
+        borderWidth := 0.
     ]
 
-    "Modified: 22.1.1997 / 11:57:19 / cg"
+    "Modified: / 31.10.1997 / 14:57:23 / cg"
 !
 
 initialize
@@ -1679,5 +1703,5 @@
 !Label class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.83 1997-10-29 16:12:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.84 1997-11-02 17:39:14 cg Exp $'
 ! !