'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 13 August 2008 at 9:09:36 am'!

!DisplayText methodsFor: 'displaying' stamp: 'jmv 8/11/2008 15:44'!
displayOn: aDisplayMedium at: aDisplayPoint clippingBox: clipRectangle rule: ruleInteger fillColor: aForm
	"For TT font, rule 34 is used if possible."
		"jmv: NO!! Asuming that depth = 32 implies that it is a TT font is wrong"
	"Refer to the comment in 
	DisplayObject|displayOn:at:clippingBox:rule:mask:."

	| form1 rule |
	form1 _ self form.
	rule _ (ruleInteger = Form over and: [backColor isTransparent])
				ifTrue: [(form1 depth = 32 and: [foreColor = Color black]) ifTrue: [rule _ 28] ifFalse: [Form paint]]
				ifFalse: [ruleInteger].
	self disableCode: [ form1 depth = 32 ifTrue: [rule _ 34] ].
	form1
		displayOn: aDisplayMedium
		at: aDisplayPoint + offset
		clippingBox: clipRectangle
		rule: rule
		fillColor: aForm! !


!LightWidget methodsFor: 'focus handling' stamp: 'jmv 8/13/2008 09:03'!
seizesNavigationFocus
	^false! !


!Morph methodsFor: 'focus handling' stamp: 'jmv 8/13/2008 09:03'!
seizesNavigationFocus
	^false! !


!OldMorph methodsFor: 'focus handling' stamp: 'jmv 8/13/2008 09:03'!
seizesNavigationFocus
	^false! !


!OldHandMorph methodsFor: 'events-processing' stamp: 'jmv 8/13/2008 09:06'!
handleEvent: anEvent
	| evt ofs k |
	owner ifNil:[^self].
	evt _ anEvent.

	EventStats ifNil:[EventStats _ IdentityDictionary new].
	EventStats at: #count put: (EventStats at: #count ifAbsent:[0]) + 1.
	EventStats at: evt type put: (EventStats at: evt type ifAbsent:[0]) + 1.

	evt isMouseOver ifTrue:[^self sendMouseEvent: evt].

ShowEvents == true ifTrue:[
	Display fill: (0@0 extent: 450@120) rule: Form over fillColor: Color white.
	ofs _ (owner hands indexOf: self) - 1 * 60.
	evt printString displayAt: (0@ofs) + (evt isKeyboard ifTrue:[0@30] ifFalse:[0@0]).
	(self keyboardFocus printString,
		'    ', self navigationFocus printString) displayAt: (0@ofs)+(0@45).
].
	"Notify listeners"
	self sendListenEvent: evt to: self eventListeners.

	evt isKeyboard ifTrue:[
		(evt commandKeyPressed and: [evt isKeystroke]) ifTrue: [
			(navigationFocus notNil and: [ navigationFocus seizesNavigationFocus ]) ifFalse: [
				k _ evt keyValue.
				k = 28 ifTrue: [
					self navigationFocusOut.
					^self mouseOverHandler processMouseOver: lastMouseEvent].
				k = 29 ifTrue: [
					self navigationFocusIn.
					^self mouseOverHandler processMouseOver: lastMouseEvent].
				k = 30 ifTrue: [
					self navigationFocusPrevious.
					^self mouseOverHandler processMouseOver: lastMouseEvent].
				k = 31 ifTrue: [
					self navigationFocusNext.
					^self mouseOverHandler processMouseOver: lastMouseEvent].
			].
		].
		self sendListenEvent: evt to: self keyboardListeners.
		self sendKeyboardEvent: evt.
		^self mouseOverHandler processMouseOver: lastMouseEvent].

	evt isDropEvent ifTrue:[
		self sendEvent: evt focus: nil.
		^self mouseOverHandler processMouseOver: lastMouseEvent].

	evt isMouse ifTrue:[
		self sendListenEvent: evt to: self mouseListeners.
		lastMouseEvent _ evt].

	"Check for pending drag or double click operations."
	mouseClickState ifNotNil:[
		(mouseClickState handleEvent: evt from: self) ifFalse:[
			"Possibly dispatched #click: or something and will not re-establish otherwise"
			^self mouseOverHandler processMouseOver: lastMouseEvent]].

	evt isMove ifTrue:[
		self position: evt position.
		self sendMouseEvent: evt.
	] ifFalse:[
		"Issue a synthetic move event if we're not at the position of the event"
		(evt position = self position) ifFalse:[self moveToEvent: evt].
		"Drop submorphs on button events"
		(self hasSubmorphs) 
			ifTrue:[self dropMorphs: evt]
			ifFalse:[self sendMouseEvent: evt].
	].
	ShowEvents == true ifTrue:[self mouseFocus printString displayAt: (0@ofs) + (0@15)].
	self mouseOverHandler processMouseOver: lastMouseEvent.
! !

