revised version
authortz
Tue, 24 Feb 1998 19:42:22 +0100
changeset 783 c81a097b84b8
parent 782 ee819aeade4b
child 784 f521b359ec84
revised version
ImageEditView.st
ImgEditV.st
--- a/ImageEditView.st	Tue Feb 24 16:42:16 1998 +0100
+++ b/ImageEditView.st	Tue Feb 24 19:42:22 1998 +0100
@@ -324,7 +324,7 @@
 
     super pointerLeave: state.
 
-    self drawLabel: ''.
+    self drawLabel: self imageInfoString.
     Cursor normal show
 ! !
 
@@ -518,9 +518,9 @@
 
 drawCursorAt: aPoint
 
-    image isNil ifTrue: [self drawLabel: ''. ^Cursor stop show].
+    image isNil ifTrue: [self drawLabel: self imageInfoString. ^Cursor stop show].
     ((0@0 extent: image extent * magnification) containsPoint: aPoint)
-         ifFalse:[self drawLabel: ''. Cursor stop show]
+         ifFalse:[self drawLabel: self imageInfoString. Cursor stop show]
          ifTrue: [self drawLabel: (aPoint//magnification + 1) printString.Cursor crossHair show].
 
 !
@@ -748,8 +748,8 @@
     super initialize.
 
     self enableMotionEvents.
-    magnification := 1@1.
     GridMagnification := GridMagnification ? (8@8).
+    magnification := GridMagnification + 2.
     modified := false.
     mouseKeyColorMode := 1.
     resourceClass := resourceSelector := ''.
@@ -952,6 +952,21 @@
         [((0@0 corner:(image extent) - 1) containsPoint: (((aPoint - margin + 1) / magnification) floor))]
 !
 
+imageInfoString
+
+    |imageInfoString usedColors|
+    image isNil ifTrue: [imageInfoString := 'No image loaded.'] ifFalse: [
+    image colorMap isNil ifTrue: [usedColors := '?'] ifFalse: [usedColors := image usedColors size].
+    imageInfoString := image width printString, 'x',
+        image height printString, 'x',
+        (2 raisedTo: image depth) printString,
+        (image mask notNil ifTrue: [' (mask + '] ifFalse: ['(']),
+        usedColors printString,
+        ' used colors)'].
+
+    ^imageInfoString
+!
+
 widthOfContents
 
     image isNil ifTrue:[^0].
@@ -988,5 +1003,5 @@
 !ImageEditView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.68 1998-02-07 17:09:38 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.69 1998-02-24 18:42:22 tz Exp $'
 ! !
--- a/ImgEditV.st	Tue Feb 24 16:42:16 1998 +0100
+++ b/ImgEditV.st	Tue Feb 24 19:42:22 1998 +0100
@@ -324,7 +324,7 @@
 
     super pointerLeave: state.
 
-    self drawLabel: ''.
+    self drawLabel: self imageInfoString.
     Cursor normal show
 ! !
 
@@ -518,9 +518,9 @@
 
 drawCursorAt: aPoint
 
-    image isNil ifTrue: [self drawLabel: ''. ^Cursor stop show].
+    image isNil ifTrue: [self drawLabel: self imageInfoString. ^Cursor stop show].
     ((0@0 extent: image extent * magnification) containsPoint: aPoint)
-         ifFalse:[self drawLabel: ''. Cursor stop show]
+         ifFalse:[self drawLabel: self imageInfoString. Cursor stop show]
          ifTrue: [self drawLabel: (aPoint//magnification + 1) printString.Cursor crossHair show].
 
 !
@@ -748,8 +748,8 @@
     super initialize.
 
     self enableMotionEvents.
-    magnification := 1@1.
     GridMagnification := GridMagnification ? (8@8).
+    magnification := GridMagnification + 2.
     modified := false.
     mouseKeyColorMode := 1.
     resourceClass := resourceSelector := ''.
@@ -952,6 +952,21 @@
         [((0@0 corner:(image extent) - 1) containsPoint: (((aPoint - margin + 1) / magnification) floor))]
 !
 
+imageInfoString
+
+    |imageInfoString usedColors|
+    image isNil ifTrue: [imageInfoString := 'No image loaded.'] ifFalse: [
+    image colorMap isNil ifTrue: [usedColors := '?'] ifFalse: [usedColors := image usedColors size].
+    imageInfoString := image width printString, 'x',
+        image height printString, 'x',
+        (2 raisedTo: image depth) printString,
+        (image mask notNil ifTrue: [' (mask + '] ifFalse: ['(']),
+        usedColors printString,
+        ' used colors)'].
+
+    ^imageInfoString
+!
+
 widthOfContents
 
     image isNil ifTrue:[^0].
@@ -988,5 +1003,5 @@
 !ImageEditView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/ImgEditV.st,v 1.68 1998-02-07 17:09:38 tz Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/Attic/ImgEditV.st,v 1.69 1998-02-24 18:42:22 tz Exp $'
 ! !