The Inbox: MorphicExtras-ct.268.mcz

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

The Inbox: MorphicExtras-ct.268.mcz

commits-2
A new version of MorphicExtras was added to project The Inbox:
http://source.squeak.org/inbox/MorphicExtras-ct.268.mcz

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

Name: MorphicExtras-ct.268
Author: ct
Time: 1 October 2019, 6:31:46.944339 pm
UUID: 82578cf0-8147-8f47-9f9a-fd3b7aaad5c5
Ancestors: MorphicExtras-ct.267

Adds PolygonMorph examples

Depends on ST80-ct.240.

This commit is part of reconstruction of Objectland (also known as "The Worlds of Squeak"). For more information, see: http://forum.world.st/The-Inbox-MorphicExtras-ct-267-mcz-td5104764.html

=============== Diff against MorphicExtras-ct.267 ===============

Item was added:
+ ----- Method: PolygonMorph class>>extraCircularVertices (in category '*MorphicExtras-examples') -----
+ extraCircularVertices
+
+ ^ ((Circle center: 400 @ 300 radius: 200 quadrant: 1) computeVertices: 5) reverse
+ , ((Circle center: 400 @ 300 radius: 200 quadrant: 4) computeVertices: 5) reverse
+ , ((Circle center: 400 @ 400 radius: 100 quadrant: 4) computeVertices: 5)
+ , ((Circle center: 400 @ 400 radius: 100 quadrant: 1) computeVertices: 5)
+ , ((Circle center: 400 @ 200 radius: 100 quadrant: 3) computeVertices: 5) reverse
+ , ((Circle center: 400 @ 200 radius: 100 quadrant: 2) computeVertices: 5) reverse!

Item was added:
+ ----- Method: PolygonMorph class>>extraExampleTextFlow (in category '*MorphicExtras-examples') -----
+ extraExampleTextFlow
+ "PolygonMorph extraExampleTextFlow openInHand"
+
+ | polygon text obstacle |
+ polygon := self new.
+ polygon
+ setVertices: self extraCircularVertices;
+ extent: 309 asPoint;
+ beSmoothCurve;
+ color: Color lightGray;
+ addHandles.
+
+ text := (TextMorph
+ string: 'TextMorphs can be chained together, causing their contents to flow between containers as either the contents or the containers change. If a TextMorph is embedded in another Morph, you can ask it to have fill the shape of that Morph. Moreover, you can ask it to avoid occlusions, in which case it will do its best to avoid collisions with siblings being in front of it. If a TextMorph is embedded in a CurveMorph, you can ask it to have the text follow the curve, as illustrated here.' asTextMorph
+ fontName: #BitstreamVeraSans
+ size: 14)
+ textColor: Color white;
+ fillsOwner: true;
+ yourself.
+ obstacle := StarMorph new
+ center: polygon center - (50 @ 25);
+ extent: 81 asPoint;
+ color: Color orchid;
+ yourself.
+
+ polygon
+ addMorph: text;
+ addMorph: obstacle.
+ text centered.
+ text container avoidsOcclusions: true.
+ ^ polygon!

Item was added:
+ ----- Method: PolygonMorph class>>extraExampleTrapeze (in category '*MorphicExtras-examples') -----
+ extraExampleTrapeze
+ "PolygonMorph extraExampleTrapeze openInHand"
+
+ | polygon text |
+ polygon := self new.
+ polygon
+ setVertices: {0 @ 100. 275 @ 100. 200 @ 0. 75 @ 0};
+ addHandles ;
+ balloonText: 'Click and drag the handles to change my shape'.
+ text := '<b>Polygons</b> can be closed or open, filled or empty as well as lined or convex and can have directed arrows, bevelled borders and last but not least adapted handles.' asHtmlText asMorph
+ beAllFont: (TextStyle default fontOfSize: 14);
+ fillsOwner: true;
+ yourself.
+ polygon addMorph: text.
+ text centered.
+ ^ polygon!

Item was added:
+ ----- Method: PolygonMorph class>>extraExampleTrapezePlus (in category '*MorphicExtras-examples') -----
+ extraExampleTrapezePlus
+ "PolygonMorph extraExampleTrapezePlus openInHand"
+ "Some additional decoration"
+
+ ^ self extraExampleTrapeze
+ fillStyle: ((GradientFillStyle
+ ramp: { 0.0 -> Color orange. 0.7 -> Color magenta twiceLighter. 1.0 -> Color red muchLighter })
+ origin: 0 @ 0; direction: 275 @ 100;
+ yourself);
+ borderWidth: 2;
+ borderColor: Color blue;
+ dashedBorder: {35. 20. Color yellow};
+ yourself!