[squeak-dev] The Trunk: Morphic-mt.2051.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 28 08:38:23 UTC 2022


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

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

Name: Morphic-mt.2051
Author: mt
Time: 28 October 2022, 10:38:21.823861 am
UUID: 3cec8211-57c2-9943-812f-871fa3bb1347
Ancestors: Morphic-ct.2050

Inspector fields can now be dropped into the world to represent compact watchers. Click on the watcher to open up the inspector again.

Works with regular inspectors and from the ones embedded in debuggers.

Complements Tools-mt.1178.

=============== Diff against Morphic-ct.2050 ===============

Item was changed:
  ----- Method: PasteUpMorph>>acceptDroppingMorph:event: (in category 'dropping/grabbing') -----
  acceptDroppingMorph: dropped event: evt
  	"The supplied morph, known to be acceptable to the receiver, is now to be assimilated; the precipitating event is supplied"
  
  	| aMorph |
  	(self isWorldMorph and: [dropped isTransferMorph]
  		and: [self hasTransferMorphConverter not])
  			ifTrue: [
  				dropped dragTransferType = #filesAndDirectories
  					ifTrue: [^ self dropFiles: dropped passenger event: evt].
  				dropped dragTransferType = #sourceCode
+ 					ifTrue: [^ self dropSourceCode: dropped passenger event: evt].
+ 				dropped dragTransferType = #inspectorField "See Tools-Inspector"
+ 					ifTrue: [^ self dropInspectorField: dropped passenger event: evt]].
- 					ifTrue: [^ self dropSourceCode: dropped passenger event: evt]].
  	
  	aMorph := self morphToDropFrom: dropped.
  	self isWorldMorph
  		ifFalse: [super acceptDroppingMorph: aMorph event: evt]
  		ifTrue: 
  			["Add the given morph to this world and start stepping it if it wants to be."
  			aMorph isInWorld ifFalse: [aMorph position: evt position].
  			self addMorphFront: aMorph.
  			(aMorph fullBounds intersects: self viewBox) ifFalse:
  				[Beeper beep.
  				aMorph position: self bounds center]].
  	
  	aMorph submorphsDo: [:m | (m isKindOf: HaloMorph) ifTrue: [m delete]].
  	aMorph allMorphsDo:  "Establish any penDown morphs in new world"
  		[:m | | tfm mm |
  		m player ifNotNil:
  			[m player getPenDown ifTrue:
  				[((mm := m player costume) notNil and: [(tfm := mm owner transformFrom: self) notNil])
  					ifTrue: [self noteNewLocation: (tfm localPointToGlobal: mm referencePosition)
  									forPlayer: m player]]]].
  	
  	self isPartsBin
  		ifTrue:
  			[aMorph isPartsDonor: true.
  			aMorph stopSteppingSelfAndSubmorphs.
  			aMorph suspendEventHandler]
  		ifFalse:
  			[self world startSteppingSubmorphsOf: aMorph].
  	
  "	self presenter morph: aMorph droppedIntoPasteUpMorph: self."
  	self showingListView ifTrue:
  		[self sortSubmorphsBy: (self valueOfProperty: #sortOrder).
  		self currentWorld abandonAllHalos].
  	
  	self bringTopmostsToFront.!

Item was added:
+ ----- Method: PasteUpMorph>>dropInspectorField:event: (in category 'event handling') -----
+ dropInspectorField: anInspectorField event: evt
+ 	"Create a self-updating morph that serves as a compact watcher for the dropped inspector field."
+ 
+ 	| watcher |
+ 	watcher := PluggableButtonMorph new
+ 		changeTableLayout;
+ 		cellPositioning: #topLeft;
+ 		model: [anInspectorField inspector object inspect];
+ 		action: #value;
+ 		yourself.
+ 
+ 	watcher
+ 		addMorph: ((UpdatingStringMorph on: anInspectorField selector: #value)
+ 			stepTime: 1000 "msecs";
+ 			yourself);
+ 		addMorph: (('of ', (anInspectorField inspector object printString truncateWithElipsisTo: 40)) asMorph
+ 			font: Preferences standardBalloonHelpFont
+ 			yourself);
+ 		addMorph: (anInspectorField name asString asMorph
+ 			font: Preferences standardBalloonHelpFont
+ 			emphasis: TextEmphasis bold emphasisCode;
+ 			yourself).
+ 
+ 	watcher center: evt position.
+ 	watcher bounds: (watcher bounds translatedToBeWithin: self bounds).
+ 	watcher openInWorld.!

Item was changed:
  ----- Method: PasteUpMorph>>wantsDroppedTransferMorph: (in category 'dropping/grabbing') -----
  wantsDroppedTransferMorph: transferMorph
  
+ 	^ ((self hasTransferMorphConverter
+ 		or: [transferMorph dragTransferType = #filesAndDirectories])
+ 		or: [transferMorph dragTransferType = #sourceCode])
+ 		or: [transferMorph dragTransferType = #inspectorField "See Tools-Inspector"]!
- 	^ self hasTransferMorphConverter
- 		or: [transferMorph dragTransferType = #filesAndDirectories]
- 		or: [transferMorph dragTransferType = #sourceCode]!



More information about the Squeak-dev mailing list