[Etoys] [fix] PasteUpMorph shall not accept ScriptEditorMorph version 3

Karl karl.ramberg at chello.se
Sat Dec 2 11:28:18 EST 2006

Karl wrote:
> Karl wrote:
>> 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.
>> karl
>> ------------------------------------------------------------------------
> Fixed issue with PhraseTileMorph embedding in same manner as 
> ScriptEditorMorph.
> karl
Fixed issue with watchers and some more tiles
-------------- next part --------------
'From OLPC2.0 of ''24 October 2006'' [latest update: #1134] on 2 December 2006 at 5:26:54 pm'!

!PasteUpMorph methodsFor: 'dropping/grabbing' stamp: 'kfr 12/2/2006 17:25'!
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: TileLikeMorph) 
			ifTrue:[^ self world acceptDroppingMorph: aMorph event: evt].
			((dropped isKindOf: ScriptEditorMorph) or:[ (dropped isKindOf: WatcherWrapper)])
			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