[squeak-dev] The Trunk: MorphicExtras-mt.300.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Oct 7 14:39:53 UTC 2021

Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:

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

Name: MorphicExtras-mt.300
Author: mt
Time: 7 October 2021, 4:39:47.760277 pm
UUID: 4bc12538-f6c7-3c40-af48-9d04c8993e16
Ancestors: MorphicExtras-ct.294, MorphicExtras-ct.295, MorphicExtras-ct.299

Merge. Merge. Merge.
- Make proper use of DisplayScreen >>#restoreAfter: in SketchMorph examples.
- PianoKeyboardMorph: Don't play a sound when a menu is invoked.
- Adds FrameRateMorph to the 'Tools' category of the parts bin. I seriously use this morph for performance measuring.

=============== Diff against MorphicExtras-eem.293 ===============

Item was changed:
  ----- Method: FrameRateMorph class>>descriptionForPartsBin (in category 'parts bin') -----
  	^ self partName:	'FrameRate' translatedNoop
+ 		categories:		{'Just for Fun' translatedNoop. 'Tools' translatedNoop}
- 		categories:		{'Just for Fun' translatedNoop}
  		documentation:	'A readout that allows you to monitor the frame rate of your system' translatedNoop!

Item was added:
+ ----- Method: MovingEyeMorph class>>extraExampleSqueakGhostIsWatchingYou (in category 'examples') -----
+ extraExampleSqueakGhostIsWatchingYou
+ 	"MovingEyeMorph extraExampleSqueakGhostIsWatchingYou openInHand"
+ 	| logoMorph leftEye rightEye |
+ 	logoMorph := (Form squeakLogo collectColors: #negated) asMorph.
+ 	leftEye := (self color: Color white irisColor: Color black)
+ 		extent: logoMorph extent * (0.1 @ 0.15);
+ 		center: (logoMorph pointAtFraction: 0.39 @ 0.55);
+ 		yourself.
+ 	rightEye := (self color: Color white irisColor: Color black)
+ 		extent: logoMorph extent * (0.1 @ 0.15);
+ 		center: (logoMorph pointAtFraction: 0.59 @ 0.56);
+ 		yourself.
+ 	logoMorph addAllMorphs: {leftEye. rightEye}.
+ 	^ logoMorph.!

Item was changed:
  ----- Method: PianoKeyboardMorph>>mouseDownPitch:event:noteMorph: (in category 'simple keyboard') -----
  mouseDownPitch: midiKey event: event noteMorph: noteMorph
  	| pitch |
+ 	event redButtonPressed ifFalse: [^ self].
  	event hand hasSubmorphs ifTrue: [^ self  "no response if drag something over me"].
  	event hand mouseFocus ifNil:
  		["If dragged into me, then establish focus so I'll see moves"
  		event hand newMouseFocus: noteMorph event: event].
  	noteMorph color: playingKeyColor.
  	pitch := AbstractSound pitchForMIDIKey: midiKey + 23.
  	soundPlaying ifNotNil: [soundPlaying stopGracefully].
  	soundPlaying := soundPrototype soundForPitch: pitch dur: 100.0 loudness: 0.3.
  	SoundPlayer resumePlaying: soundPlaying quickStart: true.

Item was changed:
  ----- Method: PostscriptCanvas>>image:at:sourceRect:rule: (in category 'private') -----
  image: form at: aPoint sourceRect: sourceRect rule: rule 
  	| aForm |
  	self preserveStateDuring:
  		[:inner | inner translate: aPoint + self origin.
  		aForm := form depth <= 8 ifTrue: [form asFormOfDepth: 32] ifFalse: [form].
  		target write: ((aForm colorsUsed includes: Color transparent)
  			ifTrue: [| top f2 c2 offset |
  				"tfel: This was taken from SketchMorph, but is actually needed for all 
  				forms that use transparency"
+ 				offset := currentTransformation ifNil: [0 at 0] ifNotNil: [:t | t offset].
- 				offset := currentTransformation ifNil: [0 at 0] ifNotNilDo: [:t | t offset].
  				top := self topLevelMorph.
  				f2 := Form extent: aForm extent depth: self depth.
  				c2 := f2 getCanvas.
  				c2 fillColor: Color white.
  					translateBy: offset - self origin - aPoint
  					clippingTo: f2 boundingBox
  					during: [:c | top fullDrawOn: c].
  			ifFalse: [aForm])].

Item was changed:
  ----- Method: SketchMorph class>>extraExampleCook (in category '*MorphicExtras-examples') -----
  	"SketchMorph extraExampleCook openInWorld"
  	^ (self withForm: Form extraCook)
+ 		addMouseUpActionWith: 'Display restoreAfter: [Form toothpaste: 30]';
- 		addMouseUpActionWith: 'Form toothpaste: 30';
  		balloonText: 'Click me and then drag the cursor over the screen';

Item was changed:
  ----- Method: SketchMorph class>>extraExampleWizard (in category '*MorphicExtras-examples') -----
  	"SketchMorph extraExampleWizard openInWorld"
  	^ (self withForm: Form extraWizard)
+ 			(MessageSend receiver: Display selector: #restoreAfter: argument: [Pen new web]);
- 			(MessageSend receiver: Pen new selector: #web);
  		balloonText: 'Click me and then drag the cursor over the screen\(Trust me, I won''t turn you into a toad!!)' withCRs;

Item was added:
+ ----- Method: StringButtonMorph>>isButton (in category 'classification') -----
+ isButton
+ 	^ true!

Item was changed:
  ----- Method: Workspace class>>extraExampleContents2 (in category '*MorphicExtras-examples') -----
  	"This is example code for #extraExample2"
  "Inspect any (sub)expression result by pressing <cmd>i"
  (20 to: 40 by: 2) asOrderedCollection
  	addFirst: 16;
  	addLast: 42;
  	sort: [:x | x \\ 3] descending;
  "Explore any (sub)expression result by pressing <cmd>I"
  Project current world.
  "Debug any (sub)expression using <cmd>D"
  (1 to: 9) join asNumber sqrt truncateTo: 1e-3.
+ (SystemWindow windowsIn: self currentWorld)
- (SystemWindow windowsIn: ActiveWorld)
  	select: [:window | window bounds isWide]
  	thenDo: [:window | window color: window color negated].!

More information about the Squeak-dev mailing list