'From Squeak3.1alpha of 28 February 2001 [latest update: #4244] on 12 August 2001 at 6:10:24 pm'! "Change Set: whomHaloGrows-sw Date: 12 August 2001 Author: Scott Wallace Adds a protocol, #setExtentFromHalo:, allowing some compound objects to intervene in the resizing-from-halo process."! !Morph methodsFor: 'miscellaneous' stamp: 'sw 7/20/2001 00:15'! setExtentFromHalo: anExtent "The user has dragged the grow box such that the receiver's extent would be anExtent. Do what's needed" self extent: anExtent! ! !HaloMorph methodsFor: 'private' stamp: 'sw 7/20/2001 00:19'! doGrow: evt with: growHandle "Called while the mouse is down in the grow handle" | newExtent extentToUse | evt hand obtainHalo: self. newExtent _ (target pointFromWorld: (target griddedPoint: evt cursorPoint - positionOffset)) - target topLeft. evt shiftPressed ifTrue: [newExtent _ (newExtent x max: newExtent y) asPoint]. (newExtent x = 0 or: [newExtent y = 0]) ifTrue: [^ self]. target renderedMorph setExtentFromHalo: (extentToUse _ newExtent). growHandle position: evt cursorPoint - (growHandle extent // 2). self layoutChanged. (self valueOfProperty: #commandInProgress) doIfNotNil: [:cmd | "Update the final extent" cmd redoTarget: target selector: #setExtentFromHalo: argument: extentToUse] ! ! !HaloMorph methodsFor: 'private' stamp: 'sw 8/12/2001 17:00'! startGrow: evt with: growHandle "Initialize resizing of my target. Launch a command representing it, to support Undo" | botRt | evt hand obtainHalo: self. growingOrRotating _ true. self removeAllHandlesBut: growHandle. "remove all other handles" botRt _ target point: target bottomRight in: owner. (self world viewBox containsPoint: botRt) ifTrue: [positionOffset _ evt cursorPoint - botRt] ifFalse: [positionOffset _ 0@0]. self setProperty: #commandInProgress toValue: (Command new cmdWording: 'resizing'; undoTarget: target selector: #setExtentFromHalo: argument: target extent)! !