# HG changeset patch # User Claus Gittinger # Date 1096457482 -7200 # Node ID 818a513a64c3049c9096f25de0632bda16581625 # Parent 2c614cc1559ca8c0b4446c7f80f1149e59d06492 *** empty log message *** diff -r 2c614cc1559c -r 818a513a64c3 ImageEditView.st --- a/ImageEditView.st Mon Sep 27 10:50:27 2004 +0200 +++ b/ImageEditView.st Wed Sep 29 13:31:22 2004 +0200 @@ -14,9 +14,9 @@ ImageView subclass:#ImageEditView instanceVariableNames:'magnification imageReaderClass resourceClass resourceSelector - mouseKeyColorMode undoImages modified editMode lastPastePoint - imageInfoHolder activityInfoHolder pickedColorHolder - drawingColors drawingPixels drawingColorHolders + mouseKeyColorMode undoImages modifiedHolder editMode + lastPastePoint imageInfoHolder activityInfoHolder + pickedColorHolder drawingColors drawingPixels drawingColorHolders drawingPixelHolders clickInfoCallBack' classVariableNames:'Clipboard ClipboardMagnified LastMagnification GridMagnificationLimit MaxUndos LastSaveDirectory LastSaveClass' @@ -42,14 +42,14 @@ documentation " - The ImageEditView is a view class which can be used by applications - like the Image Editor for modifying or inspecting images. + An ImageEditView is a view which can be used by applications + like the Image Editor for editing or inspecting (bitmap-) images. [see also:] - ImageEditor Image + ImageEditor Image [author:] - Thomas Zwick + Thomas Zwick " ! ! @@ -106,7 +106,7 @@ ! clearModified - modified := false + self modified:false ! clickInfoCallBack:aTwoArgBlock @@ -165,6 +165,14 @@ "Modified: / 31.7.1998 / 02:38:47 / cg" ! +modified:aBoolean + modifiedHolder value:aBoolean +! + +modifiedHolder + ^ modifiedHolder +! + resourceClass ^resourceClass @@ -224,7 +232,7 @@ ! setModified - modified := true + self modified:true ! undoImages @@ -1844,7 +1852,7 @@ undoImages := List new: MaxUndos. magnification := LastMagnification ? (8@8). - modified := false. + modifiedHolder := false asValue. mouseKeyColorMode := 1. resourceClass := resourceSelector := ''. drawingColorHolders := Array with:(nil asValue) with:(nil asValue). "/ left/right mouse colors @@ -2209,11 +2217,9 @@ !ImageEditView methodsFor:'release'! releasePasteDrawing - self repairDamage. (lastPastePoint notNil and: [ClipboardMagnified notNil]) - ifTrue: - [ + ifTrue: [ self redraw: ((lastPastePoint"-self viewOrigin") extent: (ClipboardMagnified extent)). "/ self repairDamage. ]. @@ -2221,28 +2227,21 @@ ! releaseUndos - undoImages removeAll. - "/ cg: what a kludge - please change to use a valueHolder, -"/ masterApplication notNil ifTrue:[ -"/ masterApplication valueOfCanUndo value: false. -"/ ]. - - "Modified: / 31.7.1998 / 02:47:21 / cg" ! ! !ImageEditView methodsFor:'testing'! checkModified - - modified ifTrue: - [ + modifiedHolder value ifTrue:[ ((YesNoBox title:(resources string:'Image was not saved. Exit anyway ?')) noText:(resources string:'Cancel'); yesText:(resources string:'Exit without Saving'); showAtPointer; - accepted) ifFalse: [^false]. - modified := false + accepted + ) ifFalse: [^false]. + + self modified:false. ]. ^ true @@ -2252,7 +2251,7 @@ !ImageEditView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.195 2004-03-29 14:16:30 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.196 2004-09-29 11:31:22 cg Exp $' ! ! ImageEditView initialize! diff -r 2c614cc1559c -r 818a513a64c3 ImageView.st --- a/ImageView.st Mon Sep 27 10:50:27 2004 +0200 +++ b/ImageView.st Wed Sep 29 13:31:22 2004 +0200 @@ -37,38 +37,38 @@ documentation " - This View knows how to display an image (or form). + This View knows how to display a (bitmap-)image (or form). You can display an image with: - ImageView openOn:anImageFileName + ImageView openOn:anImageFileName or: - ImageView openOnImage:anImage + ImageView openOnImage:anImage or: - ImageView new image:anImage + ImageView new image:anImage i.e. - ImageView openOn:'bitmaps/gifImages/garfield.gif' - ImageView openOn:'bitmaps/SBrowser.xbm' + ImageView openOn:'bitmaps/gifImages/garfield.gif' + ImageView openOn:'bitmaps/SBrowser.xbm' - ImageView openOnImage:(Image fromFile:'bitmaps/gifImages/garfield.gif') - ImageView openOnImage:(Image fromFile:'bitmaps/SBrowser.xbm') + ImageView openOnImage:(Image fromFile:'bitmaps/gifImages/garfield.gif') + ImageView openOnImage:(Image fromFile:'bitmaps/SBrowser.xbm') adjust: - controls how images are displayed; - can be one of: - #topLeft - image is displayed as usual - #center - image is shown centered - #fitBig - big images are shrunk to make it fit the view - #fitSmall - small images are magnified to make it fit the view, - #fit - all images are magnified to fit the view + controls how images are displayed; + can be one of: + #topLeft - image is displayed as usual + #center - image is shown centered + #fitBig - big images are shrunk to make it fit the view + #fitSmall - small images are magnified to make it fit the view, + #fit - all images are magnified to fit the view [author:] - Claus Gittinger + Claus Gittinger [see also:] - Image Form + Image Form " ! ! @@ -97,13 +97,13 @@ img := Image fromFile:fn. img isNil ifTrue:[ - fn exists ifTrue:[ - e := 'unknown/unsupported image format' - ] ifFalse:[ - e := 'no such image'. - ]. - self warn:e. - ^ nil + fn exists ifTrue:[ + e := 'Unknown or unsupported image format.' + ] ifFalse:[ + e := 'No such image file.'. + ]. + self warn:(self resources string:e). + ^ nil ]. imageView := self openOnImage:img. @@ -506,7 +506,7 @@ !ImageView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.59 2004-02-26 12:19:42 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/ImageView.st,v 1.60 2004-09-29 11:31:09 cg Exp $' ! ! ImageView initialize!