[Cuis] Morphic drag and drop

H. Hirzel hannes.hirzel at gmail.com
Wed Jan 23 04:50:48 CST 2013


Hello Juan,

Thank you for adding

      DragAndDropAreaMorph

It is acutually an illustration  how to enable drag and drop on any
Morph subclass by adding the methods



   allowsMorphDrop
	"Answer whether we accept dropping morphs. Redefined to answer true."

	^ true



   allowsSubmorphDrag
	"Answer whether our morphs can just be grabbed with the hand, instead
of requiring the use of the halo. Redefined to answer true."

	^ true




It works fine as a replacement for PasteUpMorph for my current needs.

Kind regards
Hannes

On 1/23/13, Juan Vuletich <juan at jvuletich.org> wrote:
> Creating new instances of PasteUpMorph is currently broken. I'll end
> mostly rewriting this class.
>
> But you need less than that. Take a look at DragAndDropAreaMorph, and
> play with it.
>
> Cheers,
> Juan Vuletich
>
> H. Hirzel wrote:
>> P.S. Instance variable 'worldState' of the PasteUpMorph is nil.
>>
>> This is cause by the call to
>>    mouseButton2Activity
>>
>> and that activates
>>
>> invokeWorldMenu
>> 	"Put up the world menu, triggered by the passed-in event.
>> 	Perhaps a good place to disable it if needed"
>>
>> 	| menu |
>> 	menu _ (TheWorldMenu new
>> 		world: self
>> 		hand: self activeHand) buildWorldMenu.
>> 	menu addTitle: Preferences desktopMenuTitle.
>> 	menu popUpInWorld: self
>>
>>
>> This should only be done for the World PasteUpMorph and not for a
>> PasteUpMorph which is a submorph of the WorldMorph
>>
>>
>> So if I subclass
>>
>> PasteUpMorph subclass: PasteUpMorphHH
>>
>> and do the same test as mentioned in the initial mail of this thread I
>> no longer do have walkbacks.
>>
>>
>> Note aside:
>>
>> PasteUpMorphHH does not appear in the WorldMenu / New morph chooser.
>>
>> I have to open it with PasteUpMorphHH new openInWorld
>>
>>
>> --Hannes
>>
>>
>> On 1/22/13, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>
>>> Correction: I did the test of the previous email in an 4.1-1561 image.
>>>
>>> When doing the same thing 4.1-1572 the EllipseMorph sticks and I can
>>> move the PasteUpMorph around.
>>>
>>> However there is still another error:
>>>
>>> Clicking on the PasteUpMorph brings up several Debugger windows and
>>> the image freezes.
>>>
>>> See screen shot.
>>>
>>> --Hannes
>>>
>>>
>>>
>>> On 1/22/13, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>>
>>>> Hello Juan
>>>>
>>>> I saw that you had done drag and drop fixes a day ago.
>>>>
>>>> https://github.com/jvuletich/Cuis/tree/master/UpdatesSinceLastRelease
>>>>
>>>> Updates 1562 to 1572
>>>>
>>>> A drag and drop question
>>>>
>>>> I create a PasteUpMorph by choosing the World menu 'New
>>>> morph'/'Worlds'/'PasteUpMorph'.
>>>>
>>>> Then I create a basic Morph, e.g. an EllipseMorph and drop it to the
>>>> PasteUpMorph. It does not stick though the menu of the PasteUpMorph
>>>> has 'accept drops' checked. (see screen shot).
>>>>
>>>> Regards
>>>> Hannes
>>>>
>>>>
>>
>> _______________________________________________
>> Cuis mailing list
>> Cuis at jvuletich.org
>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>
>>
>>
>
>
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>




More information about the Cuis mailing list