ImageView.st
changeset 3733 f7c401c2b55c
parent 3726 1ef0073283b1
child 3884 1da7ee7bcd15
--- a/ImageView.st	Fri Sep 04 23:25:42 2009 +0200
+++ b/ImageView.st	Mon Sep 07 20:45:48 2009 +0200
@@ -125,7 +125,7 @@
     ].
     imageView := self openOnImage:img.
 
-    imageView topView label:fn pathName iconLabel:(fn baseName).
+    imageView topView label:(fn pathName) iconLabel:(fn baseName).
 
     ^ imageView
 
@@ -143,9 +143,9 @@
     |top v imageView icnW icnH iconView magX magY mag lbl imgWidth imgHeight|
 
     anImage isImage ifTrue:[
-	lbl := 'an Image'
+        lbl := anImage fileName ? 'an Image'
     ] ifFalse:[
-	lbl := 'a Form'
+        lbl := 'a Form'
     ].
     top := StandardSystemView label:lbl.
 
@@ -154,56 +154,56 @@
     imageView := v scrolledView.
 
     anImage notNil ifTrue:[
-	imageView image:anImage.
+        imageView image:anImage.
 
-	"define an icon view showing a little version of image.
-	 Since some window managers cannot handle this correctly (twm),
-	 this is only done when running on an IRIS"
+        "define an icon view showing a little version of image.
+         Since some window managers cannot handle this correctly (twm),
+         this is only done when running on an IRIS"
 
-	(true "(OperatingSystem getSystemType = 'iris')" 
-	and:[StyleSheet name == #iris]) ifTrue:[
-	    iconView := ImageView new.
+        (true "(OperatingSystem getSystemType = 'iris')" 
+        and:[StyleSheet name == #iris]) ifTrue:[
+            iconView := ImageView new.
 
-	    "for now; should somehow get access to preferred iconview extent ..."
-	    icnW := 86.
-	    icnH := 68.
+            "for now; should somehow get access to preferred iconview extent ..."
+            icnW := 86.
+            icnH := 68.
 
-	    imgWidth := anImage width.
-	    imgHeight := anImage height.
+            imgWidth := anImage width.
+            imgHeight := anImage height.
 
-	    ((imgWidth <= icnW) and:[imgHeight <= icnH]) ifTrue:[
-		iconView extent:(imgWidth @ imgHeight).
-		mag := 1 @ 1
-	    ] ifFalse:[
-		magX := icnW / imgWidth.
-		magY := icnH / imgHeight.
+            ((imgWidth <= icnW) and:[imgHeight <= icnH]) ifTrue:[
+                iconView extent:(imgWidth @ imgHeight).
+                mag := 1 @ 1
+            ] ifFalse:[
+                magX := icnW / imgWidth.
+                magY := icnH / imgHeight.
 
-		"scale image"
+                "scale image"
 "
-		mag := magX @ magY.
+                mag := magX @ magY.
 "
-		"preserve ratio"
+                "preserve ratio"
 " 
-		mag := (magX min:magY) asPoint.
+                mag := (magX min:magY) asPoint.
 " 
 " "
-		mag := (magX max:magY) asPoint.
+                mag := (magX max:magY) asPoint.
 " "
 
-		iconView extent:((anImage width @ anImage height) * mag) rounded.
-	    ].
+                iconView extent:((anImage width @ anImage height) * mag) rounded.
+            ].
 
-	    top iconView:iconView.
-	].
+            top iconView:iconView.
+        ].
     ].
 
     top open.
 
     iconView notNil ifTrue:[
-	top windowGroup addView:iconView.
-	[ 
-	    iconView image:(anImage magnifiedBy:mag).
-	] forkAt:4
+        top windowGroup addView:iconView.
+        [ 
+            iconView image:(anImage magnifiedBy:mag).
+        ] forkAt:4
     ].
     ^ imageView
 
@@ -604,7 +604,7 @@
 !ImageView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.71 2009-08-03 17:18:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.72 2009-09-07 18:45:48 cg Exp $'
 ! !
 
 ImageView initialize!