[Etoys] [fix] PasteUpMorph shall not accept ScriptEditorMorph

Karl karl.ramberg at chello.se
Fri Dec 1 10:52:55 EST 2006

When you have a Playfield/PasteUpMorph open in the world you had to be 
careful where you placed the ScriptEditorMorphs otherwise they would 
embed them self into the Playfield and some annoying cropping would occur.
-------------- next part --------------
'From OLPC2.0 of ''24 October 2006'' [latest update: #1134] on 1 December 2006 at 4:47:57 pm'!

!PasteUpMorph methodsFor: 'dropping/grabbing' stamp: 'kfr 12/1/2006 12:55'!
acceptDroppingMorph: dropped event: evt
	"The supplied morph, known to be acceptable to the receiver, is now to be assimilated; the precipitating event is supplied"

	| mm tfm aMorph |
	aMorph _ self morphToDropFrom: dropped.
	self isWorldMorph
		ifTrue:["Add the given morph to this world and start stepping it if it wants to be."
				self addMorphFront: aMorph.
				(aMorph fullBounds intersects: self viewBox) ifFalse:
					[Beeper beep.  aMorph position: self bounds center]]
		ifFalse:[(dropped isKindOf: ScriptEditorMorph)
			ifTrue:[self world acceptDroppingMorph: aMorph event: evt]
			ifFalse:[super acceptDroppingMorph: aMorph event: evt]].

	aMorph submorphsDo: [:m | (m isKindOf: HaloMorph) ifTrue: [m delete]].
	aMorph allMorphsDo:  "Establish any penDown morphs in new world"
		[:m | 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
			[aMorph isPartsDonor: true.
			aMorph stopSteppingSelfAndSubmorphs.
			aMorph suspendEventHandler]
			[self world startSteppingSubmorphsOf: aMorph].

	self presenter morph: aMorph droppedIntoPasteUpMorph: self.

	self showingListView ifTrue:
		[self sortSubmorphsBy: (self valueOfProperty: #sortOrder).
		self currentWorld abandonAllHalos]! !

More information about the Etoys mailing list