Levente Uzonyi uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ul.205.mcz ==================== Summary ==================== Name: MorphicExtras-ul.205 Author: ul Time: 24 April 2017, 1:05:03.685277 pm UUID: fe46b749-0a60-4228-958e-7072da23108c Ancestors: MorphicExtras-dtl.204 - rewrote senders of #clone to use #shallowCopy =============== Diff against MorphicExtras-dtl.204 =============== Item was changed: ----- Method: BookPageThumbnailMorph>>objectForDataStream: (in category 'fileIn/Out') ----- objectForDataStream: refStrm "I am about to be written on an object file. It would be bad to write a whole BookMorph out. Store a string that is the url of the book or page in my inst var." | clone bookUrl bb stem ind | (bookMorph isString) & (page isString) ifTrue: [ ^ super objectForDataStream: refStrm]. (bookMorph isNil) & (page isString) ifTrue: [ ^ super objectForDataStream: refStrm]. (bookMorph isNil) & (page url notNil) ifTrue: [ ^ super objectForDataStream: refStrm]. (bookMorph isNil) & (page url isNil) ifTrue: [ self error: 'page should already have a url' translated. "find page's book, and remember it" "bookMorph := "]. + clone := self shallowCopy. - clone := self clone. (bookUrl := bookMorph url) ifNil: [bookUrl := self valueOfProperty: #futureUrl]. bookUrl ifNil: [ bb := RectangleMorph new. "write out a dummy" bb bounds: bounds. refStrm replace: self with: bb. ^ bb] ifNotNil: [clone instVarNamed: 'bookMorph' put: bookUrl]. page url ifNil: [ "Need to assign a url to a page that will be written later. It might have bookmarks too. Don't want to recurse deeply. Have that page write out a dummy morph to save its url on the server." stem := SqueakPage stemUrl: bookUrl. ind := bookMorph pages identityIndexOf: page. page reserveUrl: stem,(ind printString),'.sp']. clone instVarNamed: 'page' put: page url. refStrm replace: self with: clone. ^ clone! Item was changed: ----- Method: SketchEditorMorph>>mouseDown: (in category 'morphic') ----- mouseDown: evt "Start a new stroke. Check if any palette setting have changed. 6/11/97 20:30 tk" | cur pfPen myAction | "verify that we are in a good state" self verifyState: evt. "includes prepareToPaint and #scalingOrRotate" pfPen := self get: #paintingFormPen for: evt. paintingForm extent = undoBuffer extent ifTrue: [ paintingForm displayOn: undoBuffer at: 0@0 rule: Form over. ] ifFalse: [ undoBuffer := paintingForm deepCopy. "know we will draw something" ]. pfPen place: (evt cursorPoint - bounds origin). myAction := self getActionFor: evt. palette colorable ifTrue:[ palette recentColor: (self getColorFor: evt)]. self set: #strokeOrigin for: evt to: evt cursorPoint. "origin point for pickup: rect: ellispe: polygon: line: star:. Always take it." myAction == #pickup: ifTrue: [ + cur := Cursor corner shallowCopy. - cur := Cursor corner clone. cur offset: 0@0 "cur offset abs". evt hand showTemporaryCursor: cur]. myAction == #polygon: ifTrue: [self polyNew: evt]. "a mode lets you drag vertices" self mouseMove: evt.! Item was changed: ----- Method: SqueakPage>>copyForSaving (in category 'accessing') ----- copyForSaving "Make a copy and configure me to be put out on the disk. When it is brought in and touched, it will turn into the object at the url." | forDisk holder | + forDisk := self shallowCopy. - forDisk := self clone. holder := MorphObjectOut new xxxSetUrl: url page: forDisk. forDisk contentsMorph: holder. ^ holder "directly representing the object"! |
Free forum by Nabble | Edit this page |