The Trunk: Morphic-ct.1527.mcz

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

The Trunk: Morphic-ct.1527.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1527.mcz

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

Name: Morphic-ct.1527
Author: ct
Time: 20 September 2019, 8:25:26.969726 pm
UUID: 92cf521a-6df8-784b-b6c7-7be9cdcf8493
Ancestors: Morphic-mt.1526

Allow for constructing CollapsedMorphs for different owners

Primarily, it was not possible to create a CollapsedMorph for a Morph not-yet-in-world before. Now you can do:

(CollapsedMorph createReplacementFor: Morph new in: World) centerWithWrappees: 100 @ 100

=============== Diff against Morphic-mt.1526 ===============

Item was added:
+ ----- Method: CollapsedMorph class>>createReplacementFor:in: (in category 'instance creation') -----
+ createReplacementFor: aMorph in: anOwner
+
+ ^ self new
+ beReplacementFor: aMorph in: anOwner;
+ yourself!

Item was changed:
  ----- Method: CollapsedMorph>>beReplacementFor: (in category 'collapse/expand') -----
  beReplacementFor: aMorph
+ "Encapsulate aMorph with the CollapsedMorph and display the latter"
 
+ | itsWorld |
- | itsWorld priorPosition |
  (itsWorld := aMorph world) ifNil: [^self].
+ self beReplacementFor: aMorph in: itsWorld.!
- uncollapsedMorph := aMorph.
-
- self setLabel: aMorph externalName.
- aMorph delete.
- itsWorld addMorphFront: self.
- self collapseOrExpand.
- (priorPosition := aMorph valueOfProperty: #collapsedPosition ifAbsent: [nil])
- ifNotNil:
- [self position: priorPosition].
- !

Item was added:
+ ----- Method: CollapsedMorph>>beReplacementFor:in: (in category 'collapse/expand') -----
+ beReplacementFor: aMorph in: anOwner
+ "Encapsulate aMorph with the CollapsedMorph and display the latter in anOwner"
+
+ | priorPosition |
+ uncollapsedMorph := aMorph.
+
+ self setLabel: aMorph externalName.
+ aMorph delete.
+ self privateOwner: anOwner. "lest RealEstateAgent fail at positioning me"
+ self collapseOrExpand.
+ anOwner addMorphFront: self.
+ (priorPosition := aMorph valueOfProperty: #collapsedPosition ifAbsent: [nil])
+ ifNotNil: [self position: priorPosition].!

Item was added:
+ ----- Method: CollapsedMorph>>centerWithWrappees: (in category 'adjusting') -----
+ centerWithWrappees: aPoint
+
+ self center: aPoint.
+ uncollapsedMorph center: aPoint.!

Item was added:
+ ----- Method: CollapsedMorph>>uncollapsedMorph (in category 'accessing') -----
+ uncollapsedMorph
+
+ ^ uncollapsedMorph!