'From Squeak2.9BJ of 22 September 2000 [latest update: #3347] on 3 February 2001 at 7:59:16 pm'! "Change Set: FocusFix-ar Date: 3 February 2001 Author: Andreas Raab Fixes a problem with focus handling in text morphs."! !Morph methodsFor: 'event handling' stamp: '??? 2/3/2001 19:54'! maybeLostFocus: evt "The user clicked somewhere outside the receiver while the receiver was holding the keyboard focus. Do whatever is appropriate."! ! !HandMorph methodsFor: 'event handling' stamp: '??? 2/3/2001 19:56'! handleMouseDown: evt "Dispatch a mouseDown event." | m localEvt rootForGrab aHalo | "if carrying morphs, just drop them" self hasSubmorphs ifTrue: [^ self dropMorphsEvent: evt]. clickState ~~ #idle ifTrue: [^ self checkForDoubleClick: evt]. m _ self recipientForMouseDown: evt. "Transcript show: m printString; cr." m ifNotNil: [aHalo _ m world haloMorphOrNil. (aHalo == nil or: [aHalo staysUpWhenMouseIsDownIn: m]) ifFalse: [m world abandonAllHalos]. (keyboardFocus notNil and:[keyboardFocus ~~ m]) ifTrue:[keyboardFocus maybeLostFocus: evt]. m deleteBalloon. (m handlesMouseDown: evt) ifTrue: ["start a mouse transaction on m" (self newMouseFocus: m) ifNil: [^ self]. localEvt _ self transformEvent: evt. targetOffset _ localEvt cursorPoint - m position. m mouseDown: localEvt. clickState == #firstClickDown ifTrue: [clickClient click: firstClickEvent] ifFalse: ["ensure that at least one mouseMove: is reported for each mouse transaction:" m mouseMove: (localEvt copy setType: #mouseMove). (m handlesMouseOverDragging: localEvt) ifTrue: ["If m also handles dragOver, enter it in the list" dragOverMorphs add: m. mouseOverMorphs remove: m ifAbsent: []]]] ifFalse: ["grab m by the appropriate root" menuTargetOffset _ targetOffset _ evt cursorPoint. rootForGrab _ m rootForGrabOf: m. rootForGrab ifNotNil: [self grabMorph: rootForGrab] ifNil: [self newMouseFocus: m "trigger automatic viewing, for example"]]. mouseOverTimes removeKey: m ifAbsent: []]! ! !StringMorph methodsFor: 'editing' stamp: '??? 2/3/2001 19:56'! maybeLostFocus: evt "we don't keep it on clicks" evt hand newKeyboardFocus: nil.! ! !StringMorphEditor methodsFor: 'all' stamp: '??? 2/3/2001 19:57'! maybeLostFocus: evt "The user clicked somewhere outside the receiver while the receiver was holding the keyboard focus. Do whatever is appropriate." owner ifNotNil:[owner maybeLostFocus: evt].! !