The Inbox: Morphic-ct.1644.mcz

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

The Inbox: Morphic-ct.1644.mcz

commits-2
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1644.mcz

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

Name: Morphic-ct.1644
Author: ct
Time: 7 April 2020, 1:32:26.01443 pm
UUID: a0c6db46-f0e7-0c44-85c1-04826d179915
Ancestors: Morphic-mt.1643

Proposal: Make #openInWindow... use #openAsTool rather than manual #addMorph.

Advantage: Things like [CalendarMorph new openInWindow] follow the #openToolsAttachedToMouseCursor preference.

Possible disadvantage: Dependency from Morphic to ToolBuilder-Morphic. Do we want this dependency? There is already a small number of dependencies in the same direction ...

=============== Diff against Morphic-mt.1643 ===============

Item was changed:
  ----- Method: Morph>>openInWindowLabeled:inWorld: (in category 'initialization') -----
  openInWindowLabeled: aString inWorld: aWorld
 
+ | window |
+ window := self wrapIntoWindowLabeled: aString inWorld: aWorld.
+ window openAsTool.
+ ^ window!
- | window extent |
-
- window := (SystemWindow labelled: aString) model: nil.
- window
- " guess at initial extent"
- bounds:  (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
- addMorph: self frame: (0@0 extent: 1@1);
- updatePaneColors.
- " calculate extent after adding in case any size related attributes were changed.  Use
- fullBounds in order to trigger re-layout of layout morphs"
- extent := self fullBounds extent
- + (window extent - window layoutBounds extent).
- window extent: extent.
- aWorld addMorph: window.
- window beKeyWindow.
- aWorld startSteppingSubmorphsOf: window.
- ^window
- !

Item was added:
+ ----- Method: Morph>>wrapIntoWindowLabeled:inWorld: (in category 'initialization') -----
+ wrapIntoWindowLabeled: aString inWorld: aWorld
+
+ | window extent |
+ window := (SystemWindow labelled: aString) model: nil.
+ window
+ "Guess at initial extent"
+ bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
+ addMorph: self frame: (0 @ 0 extent: 1 @ 1);
+ updatePaneColors.
+
+ "Calculate extent after adding in case any size related attributes were changed.
+ Use fullBounds in order to trigger re-layout of layout morphs."
+ extent := self fullBounds extent
+ + (window extent - window layoutBounds extent).
+ window extent: extent.
+
+ aWorld startSteppingSubmorphsOf: window.
+
+ ^ window!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

Jakob Reschke
Aren't SystemWindows something ToolBuilder-specific anyway? But the
class is in Morphic, hmm...

Am Di., 7. Apr. 2020 um 13:32 Uhr schrieb <[hidden email]>:

>
> Christoph Thiede uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-ct.1644.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-ct.1644
> Author: ct
> Time: 7 April 2020, 1:32:26.01443 pm
> UUID: a0c6db46-f0e7-0c44-85c1-04826d179915
> Ancestors: Morphic-mt.1643
>
> Proposal: Make #openInWindow... use #openAsTool rather than manual #addMorph.
>
> Advantage: Things like [CalendarMorph new openInWindow] follow the #openToolsAttachedToMouseCursor preference.
>
> Possible disadvantage: Dependency from Morphic to ToolBuilder-Morphic. Do we want this dependency? There is already a small number of dependencies in the same direction ...
>
> =============== Diff against Morphic-mt.1643 ===============
>
> Item was changed:
>   ----- Method: Morph>>openInWindowLabeled:inWorld: (in category 'initialization') -----
>   openInWindowLabeled: aString inWorld: aWorld
>
> +       | window |
> +       window := self wrapIntoWindowLabeled: aString inWorld: aWorld.
> +       window openAsTool.
> +       ^ window!
> -       | window extent |
> -
> -       window := (SystemWindow labelled: aString) model: nil.
> -       window
> -               " guess at initial extent"
> -               bounds:  (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> -               addMorph: self frame: (0@0 extent: 1@1);
> -               updatePaneColors.
> -       " calculate extent after adding in case any size related attributes were changed.  Use
> -       fullBounds in order to trigger re-layout of layout morphs"
> -       extent := self fullBounds extent
> -               + (window extent - window layoutBounds extent).
> -       window extent: extent.
> -       aWorld addMorph: window.
> -       window beKeyWindow.
> -       aWorld startSteppingSubmorphsOf: window.
> -       ^window
> - !
>
> Item was added:
> + ----- Method: Morph>>wrapIntoWindowLabeled:inWorld: (in category 'initialization') -----
> + wrapIntoWindowLabeled: aString inWorld: aWorld
> +
> +       | window extent |
> +       window := (SystemWindow labelled: aString) model: nil.
> +       window
> +               "Guess at initial extent"
> +               bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> +               addMorph: self frame: (0 @ 0 extent: 1 @ 1);
> +               updatePaneColors.
> +
> +       "Calculate extent after adding in case any size related attributes were changed.
> +       Use fullBounds in order to trigger re-layout of layout morphs."
> +       extent := self fullBounds extent
> +               + (window extent - window layoutBounds extent).
> +       window extent: extent.
> +
> +       aWorld startSteppingSubmorphsOf: window.
> +
> +       ^ window!
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

marcel.taeumel
SystemWindow in Morphic is the pendant for SystemView in ST80. We can only use #openAsTool in #openInWindow if we manage to lift that concept from Morphic into the independent ToolBuilder or Tools package. As long as "window" and "system window" are backed into Morphic framework, we should not use #openAsTool there.

Best,
Marcel

Am 11.04.2020 21:25:00 schrieb Jakob Reschke <[hidden email]>:

Aren't SystemWindows something ToolBuilder-specific anyway? But the
class is in Morphic, hmm...

Am Di., 7. Apr. 2020 um 13:32 Uhr schrieb :
>
> Christoph Thiede uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-ct.1644.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-ct.1644
> Author: ct
> Time: 7 April 2020, 1:32:26.01443 pm
> UUID: a0c6db46-f0e7-0c44-85c1-04826d179915
> Ancestors: Morphic-mt.1643
>
> Proposal: Make #openInWindow... use #openAsTool rather than manual #addMorph.
>
> Advantage: Things like [CalendarMorph new openInWindow] follow the #openToolsAttachedToMouseCursor preference.
>
> Possible disadvantage: Dependency from Morphic to ToolBuilder-Morphic. Do we want this dependency? There is already a small number of dependencies in the same direction ...
>
> =============== Diff against Morphic-mt.1643 ===============
>
> Item was changed:
> ----- Method: Morph>>openInWindowLabeled:inWorld: (in category 'initialization') -----
> openInWindowLabeled: aString inWorld: aWorld
>
> + | window |
> + window := self wrapIntoWindowLabeled: aString inWorld: aWorld.
> + window openAsTool.
> + ^ window!
> - | window extent |
> -
> - window := (SystemWindow labelled: aString) model: nil.
> - window
> - " guess at initial extent"
> - bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> - addMorph: self frame: (0@0 extent: 1@1);
> - updatePaneColors.
> - " calculate extent after adding in case any size related attributes were changed. Use
> - fullBounds in order to trigger re-layout of layout morphs"
> - extent := self fullBounds extent
> - + (window extent - window layoutBounds extent).
> - window extent: extent.
> - aWorld addMorph: window.
> - window beKeyWindow.
> - aWorld startSteppingSubmorphsOf: window.
> - ^window
> - !
>
> Item was added:
> + ----- Method: Morph>>wrapIntoWindowLabeled:inWorld: (in category 'initialization') -----
> + wrapIntoWindowLabeled: aString inWorld: aWorld
> +
> + | window extent |
> + window := (SystemWindow labelled: aString) model: nil.
> + window
> + "Guess at initial extent"
> + bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> + addMorph: self frame: (0 @ 0 extent: 1 @ 1);
> + updatePaneColors.
> +
> + "Calculate extent after adding in case any size related attributes were changed.
> + Use fullBounds in order to trigger re-layout of layout morphs."
> + extent := self fullBounds extent
> + + (window extent - window layoutBounds extent).
> + window extent: extent.
> +
> + aWorld startSteppingSubmorphsOf: window.
> +
> + ^ window!
>
>



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

Jakob Reschke
Am Mo., 20. Apr. 2020 um 18:08 Uhr schrieb Marcel Taeumel
<[hidden email]>:
>
> SystemWindow in Morphic is the pendant for SystemView in ST80.

I mean, if it weren't for ToolBuilder, there would be no conceptual
need for SystemWindow in Morphic, right?

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

marcel.taeumel
SystemWindow should actually be named SystemWindowMorph. It does exist outside ToolBuilder. You might be thinking of PluggableSystemWindow, which got added along with ToolBuilder.

There is no independent (or generic) understanding of "window" reified as a class or object in Squeak yet. Independent from MVC or Morphic.

Best,
Marcel

Am 20.04.2020 20:09:44 schrieb Jakob Reschke <[hidden email]>:

Am Mo., 20. Apr. 2020 um 18:08 Uhr schrieb Marcel Taeumel
:
>
> SystemWindow in Morphic is the pendant for SystemView in ST80.

I mean, if it weren't for ToolBuilder, there would be no conceptual
need for SystemWindow in Morphic, right?



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

Jakob Reschke
Am Di., 21. Apr. 2020 um 16:56 Uhr schrieb Marcel Taeumel
<[hidden email]>:
>
> You might be thinking of PluggableSystemWindow

Ah, I suppose that's true. :-)

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1644.mcz

Christoph Thiede

Hi Marcel,


We can only use #openAsTool in #openInWindow if we manage to lift that concept from Morphic into the independent ToolBuilder or Tools package.


Couldn't we move Morph >> #openAsTool into a native (not extension) category and overwrite it by the ToolBuilder package?
Then without loading ToolBuilder, it would work the same as #openInHand, and when ToolBuilder is loaded, the preference is respected.

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von Jakob Reschke <[hidden email]>
Gesendet: Dienstag, 21. April 2020 17:34:00
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1644.mcz
 
Am Di., 21. Apr. 2020 um 16:56 Uhr schrieb Marcel Taeumel
<[hidden email]>:
>
> You might be thinking of PluggableSystemWindow

Ah, I suppose that's true. :-)



Carpe Squeak!