[ENH] snapShot-wiz (sm)

Peace Jerome peace_the_dreamer at yahoo.com
Sat May 22 16:24:54 UTC 2004


I've been frustrated with the crudeness of trying to
use the sketchMorph editor and a fast mouse as a
drawing tool.


This change adds a shift action to the dup halo.
Shift-dup creates an ImageMorph snapshot of the
current morph.

This is an important extension because it closes the
image feedback loop. Each morph now becomes an image
editor and all sorts of animation stuff should become
possible.


Most recently I've added a frame border around the
image to serve as a visual clue to distinguish the
snapshot from the actual morph. This should probably
be setable by a preference but I don't have the time
or inclination right now to learn how preferences
work.

If you don't like the boarder please edit
ImageMorph>>withSnapshotBorder.

If you like the borders in general but want to use an
image w/o then just change it with the property sheet.

One of the fun things to do with this is to create
borders within borders mixing and matching styles as
you go.
 
"!


!Morph methodsFor: 'meta-actions' stamp: 'wiz 4/7/2004
15:12'!
duplicateMorphImage: evt 
	"Make and return a imageMorph of the receiver's
argument imageForm"
	| dup |
	dup := self imageForm asMorph withSnapshotBorder.
	dup bounds: self bounds.
	evt hand grabMorph: dup from: owner.
	"duplicate was ownerless so use #grabMorph:from:
here"
	^ dup! !


!HaloMorph methodsFor: 'private' stamp: 'wiz 6/15/2003
22:12'!
doDup: evt with: dupHandle 
	"Ask hand to duplicate my target."
	(target isKindOf: SelectionMorph)
		ifTrue: [^ target
				doDup: evt
				fromHalo: self
				handle: dupHandle].
	self obtainHaloForEvent: evt andRemoveAllHandlesBut:
dupHandle.
	self
		setTarget: (evt shiftPressed ifFalse: [(target
duplicateMorph: evt)] ifTrue: [target
duplicateMorphImage: evt]).
	evt hand grabMorph: target.
	self step.
	"update position if necessary"
	evt hand addMouseListener: self! !


!ImageMorph methodsFor: 'accessing' stamp: 'wiz
4/7/2004 15:10'!
withSnapshotBorder
	self borderStyle: ((ComplexBorder style:
#complexFramed)
			color: (Color
					r: 0.613
					g: 1.0
					b: 0.516);
			 width: 1;
			
			 yourself)! !

attached is gzipped copy of the changeset.

Yours in service, Jerome Peace (wiz)





	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snapshot-wiz.1.cs.gz
Type: application/x-gzip
Size: 1147 bytes
Desc: snapshot-wiz.1.cs.gz
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040522/9d885399/snapshot-wiz.1.cs.bin


More information about the Squeak-dev mailing list