<div dir="ltr"><div>I tested drag and drop of morphs into a "bare" TextMorph and that works quite nice. <br></div><div>But trying to drop stuff into the text in a Workspace and or a ScrollingText is not easy to enable.</div><div>I'm sure it is possible to set up, but had no luck with it.</div><br><div>Best,<br></div><div>Karl</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 3, 2019 at 10:58 PM Chris Muller <<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Karl, I'm not sure what or how you tested, but "drag and drop of<br>
morph on text in windows" works fine when the appropriate handlers are<br>
set up (#mouseEnter:, etc.).<br>
<br>
You can see it in action if you're willing to load Maui into a trunk<br>
image (from SqueakMap).  It has a class MauiTextEditor, which is just<br>
a subclass of PluggableTextMorph with the handlers.<br>
<br>
    MauiTextEditor new openInWorld<br>
<br>
type some text,<br>
grab any Morph and, while holding Shift,<br>
drag it into the text window.<br>
<br>
An outline of the proposed position is shown, when you let go, the<br>
morph is dropped and embedded as a character.  Works with clipboard, etc.<br>
<br>
 - Chris<br>
<br>
<br>
 - Chris<br>
<br>
On Wed, Jul 3, 2019 at 3:36 PM karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>> wrote:<br>
><br>
> I did some more testing and found the drag and drop of morph on text in windows practically non functional.<br>
> So I don't think you could break anything :-)<br>
><br>
> Best,<br>
> Karl<br>
><br>
><br>
> On Wed, Jul 3, 2019 at 8:26 PM Rein, Patrick <<a href="mailto:Patrick.Rein@hpi.de" target="_blank">Patrick.Rein@hpi.de</a>> wrote:<br>
>><br>
>> Hi Karl,<br>
>><br>
>> I agree that the drag and drop handling of TextMorphs is somewhat complex by now.  While looking into the issue I found two kinds of issues: some more general ones and one related to layouting.<br>
>><br>
>> ## General Occlusion Bug<br>
>><br>
>> I have to admit that I was not aware of the avoid occlusions feature. I dug into it a little and<br>
>> found TextContainer and the class comment which explains the feature. Then I constructed<br>
>> the following example:<br>
>><br>
>> o := Morph new.<br>
>> tm := TextMorph new<br>
>>         contents: 'This is a very long text with a lot of characters<br>
>> spanning multiple lines overall and throughout the<br>
>> place in order to trigger the occlusion thing';<br>
>>         yourself.<br>
>> m := RectangleMorph new.<br>
>> m position: tm topLeft + (10@10).<br>
>> tm occlusionsOnOff.<br>
>> o addMorph: tm.<br>
>> o addMorph: m.<br>
>> o openInWorld.<br>
>><br>
>> I tried it in trunk and Squeak 3.8 and in both it results in errors in NewParagraph>>#adjustRightX as<br>
>> it expects container to behave like a rectangle.<br>
>><br>
>> However, the root cause seems to be that #adjustRightX does not make sense when having a fixed<br>
>> TextContainer as it describes the individual rectangles in which the text can be set. One solution is<br>
>> to set `tm wrapFlag: true` before turning avoidOcclusions on (otherwise #wrapFlag triggers a relayout<br>
>> without tm having an owner which does not work...).<br>
>><br>
>> To make this more robust I would propose:<br>
>> 1.) When activating occlusion we also set the wrapFlag<br>
>> 2.) We do not try to avoid occlusions as long as the morph does not have an owner yet.<br>
>><br>
>> ## Text Anchor Related<br>
>><br>
>> Maybe this is more what you were thinking about Karl: I found that when having the above example<br>
>> plus an anchored morph which is layouted inline most things work fine. Except for the layout issue<br>
>> you can see in the attachment (the first morph in the third line is the anchored morph, the second one<br>
>> is the m from the example above). The second part of the third line does not adhere to the offset of the<br>
>> first part of the line. @Karl: Did you refer to that? (Not sure how to fix this yet...)<br>
>><br>
>> Bests<br>
>> Patrick<br>
>> ________________________________________<br>
>> From: Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>> on behalf of karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>><br>
>> Sent: Monday, July 1, 2019 11:44:34 AM<br>
>> To: Chris Muller<br>
>> Cc: The general-purpose Squeak developers list<br>
>> Subject: Re: [squeak-dev] Proposal: Morphs in Text<br>
>><br>
>> One big issue with the drag and drop is that it is often not clear which morph one drop into.<br>
>> There are so many layers of morphs in a text window so it gets confusing to know which morph to actually<br>
>> enable to accepting the drop.<br>
>><br>
>> But drag and drop are probably a separate issue from text anchors constructed from<br>
>> code. Just don't break it to badly  :-)<br>
>><br>
>><br>
>> Best,<br>
>> Karl<br>
>><br>
>><br>
>><br>
>> Best.<br>
>> Karl<br>
>><br>
>><br>
>><br>
>> On Mon, Jul 1, 2019 at 2:19 AM Chris Muller <<a href="mailto:ma.chris.m@gmail.com" target="_blank">ma.chris.m@gmail.com</a><mailto:<a href="mailto:ma.chris.m@gmail.com" target="_blank">ma.chris.m@gmail.com</a>>> wrote:<br>
>> > I'm a little late here.<br>
>> > TextMorph does not really need TextAnchor I think.<br>
>> > You can just drop morphs on the text and select avoid occlusions in the menu.<br>
>> > What are the use of text anchors instead just dropped in morphs ?<br>
>> > I filed in TextAnchorPlacement change set and it interferes somewhat with the avoid occlusions functions.<br>
>><br>
>> I was wondering about the 'avoid occlusions' but spent all my focus on<br>
>> the alignment testing, thanks for testing that too!<br>
>><br>
>> We should not break that.  I like this new alignment capability, but<br>
>> classic DTP text-handling is one of Squeak's most impressive<br>
>> capabilities.  Hopefully an easy fix..?<br>
>><br>
>><br>
>>  - Chris<br>
>><br>
<br>
</blockquote></div>