'From Cuis 2.4 of 17 June 2010 [latest update: #509] on 30 June 2010 at 9:39:28 am'!

!HandMorph methodsFor: 'double click support' stamp: 'jmv 6/29/2010 20:52'!
waitForSimulatedYellow: aMorph event: evt dblClkSel: dblClkSel

	"Wait until the difference between click, double-click, or drag gesture is known, then inform the given morph what transpired. This message is sent when the given morph first receives a mouse-down event. If the mouse button goes up, then down again within DoubleClickTime, then 'doubleClick: evt' is sent to the morph. If the mouse button goes up but not down again within DoubleClickTime, then the message 'click: evt' is sent to the morph. Finally, if the button does not go up within DoubleClickTime, then 'drag: evt' is sent to the morph. In all cases, the event supplied is the original mouseDown event that initiated the gesture. mouseMove: and mouseUp: events are not sent to the morph until it becomes the mouse focus, which is typically done by the client in its click:, doubleClick:, or drag: methods." 

	mouseClickState _ 
		MouseClickState new
			client: aMorph 
			click: nil 
			dblClick: dblClkSel
			dblClickTime: DoubleClickTime 
			dblClickTimeout: nil
			drag: nil
			event: evt
			sendYellowButtonActivity: true! !


!TextEditor methodsFor: 'events' stamp: 'jmv 6/29/2010 20:57'!
doubleClick: evt

	self hasCaret
		ifTrue: [self selectWord]! !

!TextEditor methodsFor: 'events' stamp: 'jmv 6/29/2010 20:47'!
mouseUp: evt
	"An attempt to break up the old processRedButton code into threee phases"
	oldInterval ifNil: [^ self].  "Patched during clickAt: repair"
"	(self hasCaret 
		and: [oldInterval = self selectionInterval])
		ifTrue: [self selectWord]."
	self setEmphasisHereFromText.
	(self isDisjointFrom: oldInterval) ifTrue:
		[otherInterval _ oldInterval].
	self storeSelectionInParagraph! !


!TextMorph methodsFor: 'event handling' stamp: 'jmv 6/29/2010 20:58'!
doubleClick: evt
	self handleInteraction: [editor doubleClick: evt]! !


!TextMorphForEditView methodsFor: 'event handling' stamp: 'jmv 6/29/2010 20:53'!
mouseDown: event

	event yellowButtonPressed ifTrue: [^ self yellowButtonActivity: event shiftPressed].
	super mouseDown: event.
	event hand 
		waitForSimulatedYellow: self 
		event: event
		dblClkSel: #doubleClick:! !

