'From Cuis 2.3 of 22 March 2010 [latest update: #472] on 12 April 2010 at 3:26:40 pm'!

!Morph methodsFor: 'geometry' stamp: 'jmv 4/5/2010 11:46'!
worldBoundsForHalo
	"Answer the rectangle to be used as the inner dimension of my halos.
	Allow for showing either bounds or fullBounds, and compensate for the optional bounds rectangle."

	| r |
	r _ (Preferences haloEnclosesFullBounds)
		ifFalse: [ self boundsInWorld ]
		ifTrue: [ self fullBoundsInWorld ].
	Preferences showBoundsInHalo ifTrue: [ ^r outsetBy: 1 ].
	^r! !


!BalloonMorph class methodsFor: 'private' stamp: 'jmv 4/5/2010 11:23'!
getBestLocation: vertices for: morph corner: cornerName
	"Experimental. Just use the hand position. This should be cleaned up and perhaps enhanced."
	^vertices collect: [ :p | p + morph activeHand position - vertices first ]! !


!NewParagraph methodsFor: 'editing' stamp: 'jmv 4/5/2010 11:48'!
clickAt: clickPoint for: model
	"Give sensitive text a chance to fire.  Display flash: (100@100 extent: 100@100)."
	| startBlock action target range boxes box |
	action _ false.
	startBlock _ self characterBlockAtPoint: clickPoint.
	(text attributesAt: startBlock stringIndex) do: [ :att | 
		att mayActOnClick ifTrue:
				[(target _ model) ifNil: [ target _ editor morph].
				range _ text rangeOf: att startingAt: startBlock stringIndex.
				boxes _ self selectionRectsFrom: (self characterBlockForIndex: range first) 
							to: (self characterBlockForIndex: range last+1).
				box _ boxes detect: [:each | each containsPoint: clickPoint] ifNone: nil.
				box ifNotNil: [
					box _ editor morph boundsInWorld.
					editor morph allOwnersDo: [ :m | box _ box intersect: (m boundsInWorld) ].
					Utilities
						awaitMouseUpIn: box
						repeating: nil
						ifSucceed: [(att actOnClickFor: target in: self at: clickPoint editor: editor) ifTrue: [action _ true]].
					Cursor currentCursor == Cursor webLink ifTrue:[Cursor normal show].
				]]].
	^ action! !


!Point methodsFor: 'converting' stamp: 'jmv 4/5/2010 13:40'!
enclosingRectangleWith: aPoint 
	"Answer a Rectangle with integer coordinates that includes self and aPoint."

	self flag: #revisarM3.
	^Rectangle
		origin: (x min: aPoint x) floor @ (y min: aPoint y) floor 
		corner: (x max: aPoint x) ceiling @ (y max: aPoint y ceiling) +1! !


!SystemWindow methodsFor: 'events' stamp: 'jmv 4/5/2010 11:45'!
doFastFrameDrag: grabPoint
	"Do fast frame dragging from the given point"
	"modified from doFastFrameDrag."

	| offset newBounds outerWorldBounds |
	outerWorldBounds _ self boundsInWorld.
	offset _ outerWorldBounds origin - grabPoint.
	newBounds _ outerWorldBounds newRectFrom: [:f | 
		Sensor cursorPoint + offset extent: outerWorldBounds extent].
	self position: (self internalizePositionToOwner: newBounds topLeft from: nil); comeToFront! !

IndentingListItemMorph removeSelector: #boundsForBalloon!
StringMorph removeSelector: #boundsForBalloon!
Pen removeSelector: #arrowHead!
Pen removeSelector: #arrowHeadForArrowSpec:!
Pen removeSelector: #arrowHeadFrom:to:arrowSpec:!
Pen removeSelector: #putDotOfDiameter:at:!
Morph removeSelector: #boundsForBalloon!
Morph removeSelector: #boundsIn:!
