care for non-existing images.
authorClaus Gittinger <cg@exept.de>
Wed, 12 Aug 1998 12:47:16 +0200
changeset 1070 856d037fe133
parent 1069 f60477320495
child 1071 981c97fe54de
care for non-existing images.
SelTreeV.st
SelectionInTreeView.st
--- a/SelTreeV.st	Tue Aug 11 21:43:02 1998 +0200
+++ b/SelTreeV.st	Wed Aug 12 12:47:16 1998 +0200
@@ -475,14 +475,16 @@
     |img|
 
     img := anImage.
-
-    img device ~~ device ifTrue:[
-        img := img copy.
+    img notNil ifTrue:[
+        img device ~~ device ifTrue:[
+            img := img copy.
+        ].
+        img := img on:device.
+        img := img clearMaskedPixels.
     ].
-    img := img on:device.
-    img := img clearMaskedPixels.
-  ^ img
+    ^ img
 
+    "Modified: / 12.8.1998 / 12:46:38 / cg"
 !
 
 imageOpened
@@ -1364,23 +1366,30 @@
     "
     |img x y keysAndIcons|
 
+    x := y := 0.
     imageOpened isNil ifTrue:[
         imageOpened := self imageOnDevice:(self class imageOpened)
     ].
+    imageOpened notNil ifTrue:[
+        x := x max:(imageOpened width).
+        y := y max:(imageOpened height).
+    ].
 
     imageClosed isNil ifTrue:[
         imageClosed := self imageOnDevice:(self class imageClosed)
     ].
-
-    x := (imageOpened width)  max:(imageClosed width).
-    y := (imageOpened height) max:(imageClosed height).
+    imageClosed notNil ifTrue:[
+        x := x max:(imageClosed width).
+        y := y max:(imageClosed height).
+    ].
 
     imageItem isNil ifTrue:[
         imageItem := self imageOnDevice:(self class imageItem)
     ].
-
-    x := (imageItem width)  max:x.
-    y := (imageItem height) max:y.
+    imageItem notNil ifTrue:[
+        x := x max:(imageItem width).
+        y := y max:(imageItem height).
+    ].
 
     (keysAndIcons := self fetchDefaultImages) notNil ifTrue:[
         keysAndIcons keysAndValuesDo:[:aKey :anIcon|
@@ -1399,6 +1408,8 @@
         y := (img height) max:y.
     ].
     ^ x @ y
+
+    "Modified: / 12.8.1998 / 12:45:53 / cg"
 !
 
 getFontParameters
@@ -2100,5 +2111,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.63 1998-08-07 17:58:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.64 1998-08-12 10:47:16 cg Exp $'
 ! !
--- a/SelectionInTreeView.st	Tue Aug 11 21:43:02 1998 +0200
+++ b/SelectionInTreeView.st	Wed Aug 12 12:47:16 1998 +0200
@@ -475,14 +475,16 @@
     |img|
 
     img := anImage.
-
-    img device ~~ device ifTrue:[
-        img := img copy.
+    img notNil ifTrue:[
+        img device ~~ device ifTrue:[
+            img := img copy.
+        ].
+        img := img on:device.
+        img := img clearMaskedPixels.
     ].
-    img := img on:device.
-    img := img clearMaskedPixels.
-  ^ img
+    ^ img
 
+    "Modified: / 12.8.1998 / 12:46:38 / cg"
 !
 
 imageOpened
@@ -1364,23 +1366,30 @@
     "
     |img x y keysAndIcons|
 
+    x := y := 0.
     imageOpened isNil ifTrue:[
         imageOpened := self imageOnDevice:(self class imageOpened)
     ].
+    imageOpened notNil ifTrue:[
+        x := x max:(imageOpened width).
+        y := y max:(imageOpened height).
+    ].
 
     imageClosed isNil ifTrue:[
         imageClosed := self imageOnDevice:(self class imageClosed)
     ].
-
-    x := (imageOpened width)  max:(imageClosed width).
-    y := (imageOpened height) max:(imageClosed height).
+    imageClosed notNil ifTrue:[
+        x := x max:(imageClosed width).
+        y := y max:(imageClosed height).
+    ].
 
     imageItem isNil ifTrue:[
         imageItem := self imageOnDevice:(self class imageItem)
     ].
-
-    x := (imageItem width)  max:x.
-    y := (imageItem height) max:y.
+    imageItem notNil ifTrue:[
+        x := x max:(imageItem width).
+        y := y max:(imageItem height).
+    ].
 
     (keysAndIcons := self fetchDefaultImages) notNil ifTrue:[
         keysAndIcons keysAndValuesDo:[:aKey :anIcon|
@@ -1399,6 +1408,8 @@
         y := (img height) max:y.
     ].
     ^ x @ y
+
+    "Modified: / 12.8.1998 / 12:45:53 / cg"
 !
 
 getFontParameters
@@ -2100,5 +2111,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.63 1998-08-07 17:58:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.64 1998-08-12 10:47:16 cg Exp $'
 ! !