[squeak-dev] The Inbox: Morphic-pre.1329.mcz
Rein, Patrick
Patrick.Rein at hpi.de
Thu Mar 23 15:13:23 UTC 2017
This allows for more "intuitive" drag and drop behavior. When I drop something into the world and a morph is opened for it than the morph is displayed at the position where the element was dropped. For a simple example so the gif attached.
To avoid confusions: I have already moved the change into trunk. However, I am thankful for you bringing this up as I am not sure about all implications yet.
________________________________________
From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on behalf of H. Hirzel <hannes.hirzel at gmail.com>
Sent: Wednesday, March 22, 2017 10:02
To: squeak-dev at lists.squeakfoundation.org
Subject: Re: [squeak-dev] The Inbox: Morphic-pre.1329.mcz
Could you please give more details and a use case? (screen shot)
--Hannes
On Wed, 15 Mar 2017 15:16:31 0000, commits at source.squeak.org
<commits at source.squeak.org> wrote:
> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-pre.1329.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-pre.1329
> Author: pre
> Time: 15 March 2017, 4:16:07.772309 pm
> UUID: bb5c49b1-402a-9443-b129-ae2e0f250f8f
> Ancestors: Morphic-edc.1328
>
> Changes the accept dropping behavior of the world to open the morph for a
> dropped object where it was dropped.
>
> =============== Diff against Morphic-edc.1328 ===============
>
> 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 |
> aMorph := self morphToDropFrom: dropped.
> self isWorldMorph
> ifTrue:["Add the given morph to this world and start stepping it if it
> wants to be."
> + aMorph position: evt position.
> self addMorphFront: aMorph.
> (aMorph fullBounds intersects: self viewBox) ifFalse:
> [Beeper beep. aMorph position: self bounds center]]
> 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 | | 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 griddingOn ifTrue: [aMorph position: (self gridPoint: aMorph
> position)].
> self showingListView ifTrue:
> [self sortSubmorphsBy: (self valueOfProperty: #sortOrder).
> self currentWorld abandonAllHalos].
>
> self bringTopmostsToFront.
> !
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dndrop.gif
Type: image/gif
Size: 199504 bytes
Desc: dndrop.gif
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20170323/4b2f8fc5/attachment-0001.gif>
More information about the Squeak-dev
mailing list
|