The Trunk: Morphic-pre.1556.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-pre.1556.mcz

commits-2
Patrick Rein uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-pre.1556.mcz

==================== Summary ====================

Name: Morphic-pre.1556
Author: pre
Time: 4 October 2019, 4:21:37.806303 pm
UUID: 47327636-d19c-cf45-a282-baf3d5edf2c4
Ancestors: Morphic-pre.1555

Updates the examples and code references in the comment for TextAnchor to correspond to the new infrastructure.

=============== Diff against Morphic-pre.1555 ===============

Item was changed:
  TextAttribute subclass: #TextAnchor
  instanceVariableNames: 'anchoredMorph'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Morphic-Text Support'!
 
+ !TextAnchor commentStamp: 'pre 10/4/2019 16:11' prior: 0!
+ TextAnchors support anchoring of images in text. A TextAnchor exists as an attribute of text emphasis. Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively.  The coordination between composition, display, and selection can best be understood by browsing the various implementations of placeEmbeddedObjectFrom:.
- !TextAnchor commentStamp: 'md 8/10/2006 11:52' prior: 0!
- TextAnchors support anchoring of images in text.  A TextAnchor exists as an attribute of text emphasis, and it gets control like a FontReference, through the emphasizeScanner: message.  Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively.  The coordination between composition, display and selection can best be understood by browsing the various implementations of placeEmbeddedObject:.
 
+ In the morphic world, you can embed any form or morph in text by adding a startOfHeader character and adding the TextAnchor attribute to it.
- In the morphic world, simply embed any form or morph in text.
 
  Workspace new
+ contents: (Text withAll: 'foo') , (Text string: Character startOfHeader asString attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll: 'bar');
- contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll: 'bar');
  openLabel: 'Text with Form'.
 
  Workspace new
+ contents: (Text withAll: 'foo') , (Text string: Character startOfHeader asString attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
+ openLabel: 'Text with Morph'.!
- contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
- openLabel: 'Text with Morph'.
-
- In this case you select a piece of the screen, and it gets anchored to a one-character text in the editor's past buffer.  If you then paste into some other text, you will see the image as an embedded image.!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-pre.1556.mcz

Hannes Hirzel
Good to see the example updated working with the new system of embedding morphs!

How would an example look like where the embedded morph is on its own line?

--Hannes

On Fri, 4 Oct 2019 14:21:47 0000, [hidden email]
<[hidden email]> wrote:

> Patrick Rein uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-pre.1556.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-pre.1556
> Author: pre
> Time: 4 October 2019, 4:21:37.806303 pm
> UUID: 47327636-d19c-cf45-a282-baf3d5edf2c4
> Ancestors: Morphic-pre.1555
>
> Updates the examples and code references in the comment for TextAnchor to
> correspond to the new infrastructure.
>
> =============== Diff against Morphic-pre.1555 ===============
>
> Item was changed:
>   TextAttribute subclass: #TextAnchor
>   instanceVariableNames: 'anchoredMorph'
>   classVariableNames: ''
>   poolDictionaries: ''
>   category: 'Morphic-Text Support'!
>
> + !TextAnchor commentStamp: 'pre 10/4/2019 16:11' prior: 0!
> + TextAnchors support anchoring of images in text. A TextAnchor exists as an
> attribute of text emphasis. Depending on whether its anchoredMorph is a
> Morph or a Form, it repositions the morph, or displays the form
> respectively.  The coordination between composition, display, and selection
> can best be understood by browsing the various implementations of
> placeEmbeddedObjectFrom:.
> - !TextAnchor commentStamp: 'md 8/10/2006 11:52' prior: 0!
> - TextAnchors support anchoring of images in text.  A TextAnchor exists as
> an attribute of text emphasis, and it gets control like a FontReference,
> through the emphasizeScanner: message.  Depending on whether its
> anchoredMorph is a Morph or a Form, it repositions the morph, or displays
> the form respectively.  The coordination between composition, display and
> selection can best be understood by browsing the various implementations of
> placeEmbeddedObject:.
>
> + In the morphic world, you can embed any form or morph in text by adding a
> startOfHeader character and adding the TextAnchor attribute to it.
> - In the morphic world, simply embed any form or morph in text.
>
>   Workspace new
> + contents: (Text withAll: 'foo') , (Text string: Character startOfHeader
> asString attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) ,
> (Text withAll: 'bar');
> - contents: (Text withAll: 'foo') , (Text string: '*' attribute:
> (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll:
> 'bar');
>   openLabel: 'Text with Form'.
>
>   Workspace new
> + contents: (Text withAll: 'foo') , (Text string: Character startOfHeader
> asString attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) ,
> (Text withAll: 'bar');
> + openLabel: 'Text with Morph'.!
> - contents: (Text withAll: 'foo') , (Text string: '*' attribute:
> (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
> - openLabel: 'Text with Morph'.
> -
> - In this case you select a piece of the screen, and it gets anchored to a
> one-character text in the editor's past buffer.  If you then paste into some
> other text, you will see the image as an embedded image.!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-pre.1556.mcz

Patrick R.
In reply to this post by commits-2
Having embedded Morphs on their own line is not supported anymore. #paragraph/#document were not really distinguished before. Do you think it would be worth having it again? It would not be too much work to add it.

Bests
Patrick
________________________________________
From: Squeak-dev <[hidden email]> on behalf of [hidden email] <[hidden email]>
Sent: Friday, October 4, 2019 4:21:47 PM
To: [hidden email]; [hidden email]
Subject: [squeak-dev] The Trunk: Morphic-pre.1556.mcz

Patrick Rein uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-pre.1556.mcz

==================== Summary ====================

Name: Morphic-pre.1556
Author: pre
Time: 4 October 2019, 4:21:37.806303 pm
UUID: 47327636-d19c-cf45-a282-baf3d5edf2c4
Ancestors: Morphic-pre.1555

Updates the examples and code references in the comment for TextAnchor to correspond to the new infrastructure.

=============== Diff against Morphic-pre.1555 ===============

Item was changed:
  TextAttribute subclass: #TextAnchor
        instanceVariableNames: 'anchoredMorph'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Morphic-Text Support'!

+ !TextAnchor commentStamp: 'pre 10/4/2019 16:11' prior: 0!
+ TextAnchors support anchoring of images in text. A TextAnchor exists as an attribute of text emphasis. Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively.  The coordination between composition, display, and selection can best be understood by browsing the various implementations of placeEmbeddedObjectFrom:.
- !TextAnchor commentStamp: 'md 8/10/2006 11:52' prior: 0!
- TextAnchors support anchoring of images in text.  A TextAnchor exists as an attribute of text emphasis, and it gets control like a FontReference, through the emphasizeScanner: message.  Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively.  The coordination between composition, display and selection can best be understood by browsing the various implementations of placeEmbeddedObject:.

+ In the morphic world, you can embed any form or morph in text by adding a startOfHeader character and adding the TextAnchor attribute to it.
- In the morphic world, simply embed any form or morph in text.

        Workspace new
+               contents: (Text withAll: 'foo') , (Text string: Character startOfHeader asString attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll: 'bar');
-               contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text withAll: 'bar');
                openLabel: 'Text with Form'.

        Workspace new
+               contents: (Text withAll: 'foo') , (Text string: Character startOfHeader asString attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
+               openLabel: 'Text with Morph'.!
-               contents: (Text withAll: 'foo') , (Text string: '*' attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text withAll: 'bar');
-               openLabel: 'Text with Morph'.
-
- In this case you select a piece of the screen, and it gets anchored to a one-character text in the editor's past buffer.  If you then paste into some other text, you will see the image as an embedded image.!



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-pre.1556.mcz

Hannes Hirzel
Hello Patrick

Yes, I think it is a typical use case to have a morph (e.g. picture)
centered without text in front or at the back of it.

However this might be achieved by having a
    Character lf
after the preceding text and also after the morph (first attachment).

I wonder why the text does not reflow after a change in size of the
morph by means of a resize halo.

Best
Hannes




On 10/4/19, Rein, Patrick <[hidden email]> wrote:

> Having embedded Morphs on their own line is not supported anymore.
> #paragraph/#document were not really distinguished before. Do you think it
> would be worth having it again? It would not be too much work to add it.
>
> Bests
> Patrick
> ________________________________________
> From: Squeak-dev <[hidden email]> on behalf
> of [hidden email] <[hidden email]>
> Sent: Friday, October 4, 2019 4:21:47 PM
> To: [hidden email];
> [hidden email]
> Subject: [squeak-dev] The Trunk: Morphic-pre.1556.mcz
>
> Patrick Rein uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-pre.1556.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-pre.1556
> Author: pre
> Time: 4 October 2019, 4:21:37.806303 pm
> UUID: 47327636-d19c-cf45-a282-baf3d5edf2c4
> Ancestors: Morphic-pre.1555
>
> Updates the examples and code references in the comment for TextAnchor to
> correspond to the new infrastructure.
>
> =============== Diff against Morphic-pre.1555 ===============
>
> Item was changed:
>   TextAttribute subclass: #TextAnchor
>         instanceVariableNames: 'anchoredMorph'
>         classVariableNames: ''
>         poolDictionaries: ''
>         category: 'Morphic-Text Support'!
>
> + !TextAnchor commentStamp: 'pre 10/4/2019 16:11' prior: 0!
> + TextAnchors support anchoring of images in text. A TextAnchor exists as an
> attribute of text emphasis. Depending on whether its anchoredMorph is a
> Morph or a Form, it repositions the morph, or displays the form
> respectively.  The coordination between composition, display, and selection
> can best be understood by browsing the various implementations of
> placeEmbeddedObjectFrom:.
> - !TextAnchor commentStamp: 'md 8/10/2006 11:52' prior: 0!
> - TextAnchors support anchoring of images in text.  A TextAnchor exists as
> an attribute of text emphasis, and it gets control like a FontReference,
> through the emphasizeScanner: message.  Depending on whether its
> anchoredMorph is a Morph or a Form, it repositions the morph, or displays
> the form respectively.  The coordination between composition, display and
> selection can best be understood by browsing the various implementations of
> placeEmbeddedObject:.
>
> + In the morphic world, you can embed any form or morph in text by adding a
> startOfHeader character and adding the TextAnchor attribute to it.
> - In the morphic world, simply embed any form or morph in text.
>
>         Workspace new
> +               contents: (Text withAll: 'foo') , (Text string: Character
> startOfHeader asString attribute: (TextAnchor new anchoredMorph: MenuIcons
> confirmIcon)) , (Text withAll: 'bar');
> -               contents: (Text withAll: 'foo') , (Text string: '*'
> attribute: (TextAnchor new anchoredMorph: MenuIcons confirmIcon)) , (Text
> withAll: 'bar');
>                 openLabel: 'Text with Form'.
>
>         Workspace new
> +               contents: (Text withAll: 'foo') , (Text string: Character
> startOfHeader asString attribute: (TextAnchor new anchoredMorph:
> EllipseMorph new)) , (Text withAll: 'bar');
> +               openLabel: 'Text with Morph'.!
> -               contents: (Text withAll: 'foo') , (Text string: '*'
> attribute: (TextAnchor new anchoredMorph: EllipseMorph new)) , (Text
> withAll: 'bar');
> -               openLabel: 'Text with Morph'.
> -
> - In this case you select a piece of the screen, and it gets anchored to a
> one-character text in the editor's past buffer.  If you then paste into some
> other text, you will see the image as an embedded image.!
>
>
>
>



Text_with_Morph.png (22K) Download Attachment
Text_with_Morph_resized.png (22K) Download Attachment