[Pkg] The Trunk: MorphicTests-mt.41.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jul 1 12:57:47 UTC 2017


Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.41.mcz

==================== Summary ====================

Name: MorphicTests-mt.41
Author: mt
Time: 1 July 2017, 2:57:41.428352 pm
UUID: ee05a5f6-3c62-1c46-af81-607c453de86c
Ancestors: MorphicTests-nice.40

Adds a test for event handler and red/blue/yellow mouse down.

=============== Diff against MorphicTests-nice.40 ===============

Item was added:
+ ----- Method: MorphicEventTests>>test03EventHandler (in category 'tests') -----
+ test03EventHandler
+ 
+ 	| m |
+ 	m := Morph new.
+ 	m extent: 20 at 20; topLeft: 0 at 0.
+ 
+ 	m wantsHaloFromClick: false.
+ 	m wantsYellowButtonMenu: false.
+ 	m wantsMetaMenu: false.
+ 
+ 	m on: #mouseDown send: #value: to:[:evt|
+ 		evt redButtonPressed ifTrue:[m color: Color red].
+ 		evt yellowButtonPressed ifTrue:[m color: Color yellow].
+ 		evt blueButtonPressed ifTrue:[m color: Color blue]]. 
+ 
+ 	m openInWorld: world.
+ 	
+ 	hand handleEvent: (self redMouseDownAt: m center).
+ 	self assert: Color red equals: m color.
+ 
+ 	hand handleEvent: (self yellowMouseDownAt: m center).
+ 	self assert: Color yellow equals: m color.
+ 	
+ 	hand handleEvent: (self blueMouseDownAt: m center).
+ 	self assert: Color blue equals: m color.!

Item was added:
+ ----- Method: UserInputEventTests>>blueMouseDownAt: (in category 'support') -----
+ blueMouseDownAt: point
+ 
+ 	^ MouseButtonEvent new
+ 		setType: #mouseDown
+ 		position: point
+ 		which: 2r000 "no change"
+ 		buttons: 2r001 "blue pressed"
+ 		hand: hand
+ 		stamp: Time millisecondClockValue!

Item was added:
+ ----- Method: UserInputEventTests>>yellowMouseDownAt: (in category 'support') -----
+ yellowMouseDownAt: point
+ 
+ 	^ MouseButtonEvent new
+ 		setType: #mouseDown
+ 		position: point
+ 		which: 2r000 "no change"
+ 		buttons: 2r010 "yellow pressed"
+ 		hand: hand
+ 		stamp: Time millisecondClockValue!



More information about the Packages mailing list