Tim Felgentreff uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-tfel.244.mcz ==================== Summary ==================== Name: EToys-tfel.244 Author: tfel Time: 23 September 2016, 11:14:39.343418 am UUID: 92cd544d-1e83-614e-a7e5-62b8d4215044 Ancestors: EToys-tfel.243 - move the BookMorph>>storeAsDataStream methods to SISS - when editing the Kedama drawing, don't include the patch in the painting, only the turtles (this way we can now e.g. pause the forest fire, erase some trees to create a firebreak, and then continue running the fire :)) - re-add the code from Squeakland to draw large arrows on mouse over =============== Diff against EToys-tfel.243 =============== Item was removed: - ----- Method: BookMorph>>storeAsDataStream (in category '*Etoys-Squeakland-fileIn/out') ----- - storeAsDataStream - - self storeAsDataStreamNamed: Project current name, '.sexp.data.gz'.! Item was removed: - ----- Method: BookMorph>>storeAsDataStreamNamed: (in category '*Etoys-Squeakland-fileIn/out') ----- - storeAsDataStreamNamed: zippedFileName - - | f d bytes zipped | - bytes := WriteStream on: ByteArray new. - d := DataStream on: bytes. - d nextPut: self pagesAndColorInSISSFormat. - d close. - f := FileStream newFileNamed: zippedFileName. - f binary; setFileTypeToObject. - zipped := GZipWriteStream on: f. - zipped nextPutAll: bytes contents. - zipped close. - f close - ! Item was changed: ----- Method: KedamaMorph>>editDrawing (in category 'menu') ----- editDrawing + | bnds sketchEditor delBlock myForm mySketch canvas | - | bnds sketchEditor delBlock myForm mySketch | self world assureNotPaintingElse: [^self]. self world prepareToPaint; displayWorld. bnds := self boundsInWorld. sketchEditor := SketchEditorMorph new. self comeToFront. + canvas := Display defaultCanvasClass extent: self fullBounds extent depth: 32. + canvas fillRectangle: (self bounds) color: self color. + patchVarDisplayForm fillColor: self color. + self drawTurtlesOnForm: patchVarDisplayForm. + pixelsPerPatch = 1 + ifTrue: [canvas drawImage: patchVarDisplayForm at: 0@0] + ifFalse: [canvas warpImage: patchVarDisplayForm transform: (MatrixTransform2x3 withScale: pixelsPerPatch) at: 0@0]. + myForm := canvas form. - myForm := self imageForm clippedToSize: (bnds extent - 2). myForm mapColor: self color to: Color transparent. mySketch := SketchMorph withForm: myForm. mySketch position: self position. self world addMorphFront: sketchEditor. sketchEditor initializeFor: mySketch inBounds: bnds pasteUpMorph: self world. delBlock := [self world paintingFlapTab ifNotNil: [:pt | pt hideFlap] ifNil: [self world paintBox ifNotNil: [:pb | pb delete]]]. sketchEditor afterNewPicDo: [:aForm :aRect | aForm offset: aRect topLeft - self topLeft. self acceptFormFromDrawing: aForm. delBlock value] ifNoBits: [delBlock value]! Item was changed: + ----- Method: TileMorph>>fixLayoutOfSubmorphsNotIn: (in category 'layout') ----- - ----- Method: TileMorph>>fixLayoutOfSubmorphsNotIn: (in category 'as yet unclassified') ----- fixLayoutOfSubmorphsNotIn: aCollection self allMorphsDo: [:m | (aCollection includes: m) ifFalse: [(m respondsTo: #fixLayoutOfSubmorphsNotIn:) ifTrue: [m ~~ self ifTrue: [m fixLayoutOfSubmorphsNotIn: aCollection]] ifFalse: [m layoutChanged]. aCollection add: m]]. self layoutChanged; fullBounds! Item was added: + ----- Method: TileMorph>>handlesMouseOver: (in category 'event handling') ----- + handlesMouseOver: evt + ^ self isPopArrowNeeded + or: [^super handlesMouseOver: evt]! Item was added: + ----- Method: TileMorph>>layoutChanged (in category 'layout') ----- + layoutChanged + | vpanel hpanel popArrows | + super layoutChanged. + self labelMorph + ifNil: [^ self]. + popArrows := self activeHand ifNil: [^ self] ifNotNilDo: [:ac | + ac valueOfProperty: #popArrows + ifAbsent: [^ self]]. + popArrows first == self + ifFalse: [^ self]. + vpanel := popArrows second. + hpanel := popArrows third. + vpanel + ifNotNil: [vpanel openInWorld. + vpanel center: self labelMorph center. + vpanel right: self labelMorph left - 2]. + hpanel + ifNotNil: [hpanel openInWorld. + hpanel center: self labelMorph center. + hpanel left: self labelMorph right + 2]! Item was added: + ----- Method: TileMorph>>morphToDropInPasteUp: (in category 'event handling') ----- + morphToDropInPasteUp: aPasteUp + "Answer the morph to drop in aPasteUp, given that the receiver is the putative droppee" + + ^ ScriptingTileHolder around: self! Item was added: + ----- Method: TileMorph>>mouseEnter: (in category 'event handling') ----- + mouseEnter: evt + + super mouseEnter:evt. + ^self showPopArrows! Item was added: + ----- Method: TileMorph>>mouseLeave: (in category 'event handling') ----- + mouseLeave: evt + "When the mouse is leaving and next object is not a pop arrow, remove + pop arrows." + | popArrows vpanel hpanel | + popArrows := evt hand + valueOfProperty: #popArrows + ifAbsent: [^super mouseLeave: evt]. + vpanel := popArrows second. + hpanel := popArrows third. + (vpanel notNil + and: [vpanel containsPoint: evt position]) + ifTrue: [^super mouseLeave: evt]. + (hpanel notNil + and: [hpanel containsPoint: evt position]) + ifTrue: [^super mouseLeave: evt]. + self hidePopArrows. + ^super mouseLeave: evt! Item was changed: ----- Method: TileMorph>>showPopArrows (in category '*Etoys-Squeakland-arrows popup') ----- showPopArrows | vpanel hpanel | Preferences usePopUpArrows ifFalse: [^ self]. self hidePopArrows. self isPopArrowNeeded ifFalse: [^ self]. + 1 haltOnce. vpanel := self buildVPopArrows. hpanel := self buildHPopArrows. self activeHand setProperty: #popArrows toValue: {self. vpanel. hpanel}. self layoutChanged! |
Free forum by Nabble | Edit this page |