The Inbox: MorphicExtras-ct.276.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.276.mcz

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

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

Name: MorphicExtras-ct.276
Author: ct
Time: 1 October 2019, 11:47:01.580339 pm
UUID: a183a923-fc55-3d4d-b2eb-06d26ac369bf
Ancestors: MorphicExtras-ct.267

Adds Workspace examples for demonstration of Editor and Text.

Depends on Collections-ct.855 and Kernel-ct.1270

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: Workspace class>>extraExample1 (in category '*MorphicExtras-examples') -----
+ extraExample1
+ "ToolBuilder open: Workspace extraExample1"
+
+ | quoteAttributes |
+ quoteAttributes := { TextEmphasis bold. TextColor color: Color mocha }.
+ ^ Workspace new
+ contents: (Text streamContents: [:stream | ({
+ '<i>"When in doubt, try it out!!"</i>' asHtmlText
+ addAllAttributes: quoteAttributes;
+ yourself.
+ '-- Dan Ingalls' asText
+ addAllAttributes: quoteAttributes;
+ addAttribute: TextAlignment rightFlush;
+ yourself.
+ String empty. }
+ , ((self class sourceCodeAt: #extraExampleContents1) asString lines allButFirst: 3)
+ do: [:line | stream nextPutAll: line]
+ separatedBy: [stream cr])]);
+ shouldStyle: false;
+ yourself!

Item was added:
+ ----- Method: Workspace class>>extraExample2 (in category '*MorphicExtras-examples') -----
+ extraExample2
+ "ToolBuilder open: Workspace extraExample2"
+
+ ^ self new
+ contents: (((self class sourceCodeAt: #extraExampleContents2)
+ asString lines allButFirst: 3)
+ joinSeparatedBy: Character cr);
+ yourself!

Item was added:
+ ----- Method: Workspace class>>extraExampleContents1 (in category '*MorphicExtras-examples') -----
+ extraExampleContents1
+ "This is example code for #extraExample1"
+
+ "Run the following lines by pressing <cmd>d:"
+ Transcript showln: 'Hello world!!'.
+ self inform: 'This is a dialog box. Quite easy, isn''t it?'.
+
+ "Print the result of an expression using <cmd>p"
+ 6 * 7.
+ Float pi i exp stringForReadout.
+ (16 factorial + 1) isPrime.
+ (Smalltalk allClasses gather: #selectors) size.!

Item was added:
+ ----- Method: Workspace class>>extraExampleContents2 (in category '*MorphicExtras-examples') -----
+ extraExampleContents2
+ "This is example code for #extraExample2"
+
+ "Inspect any (sub)expression result pressing <cmd>i"
+ (20 to: 40 by: 2) asOrderedCollection
+ addFirst: 16;
+ addLast: 42;
+ sort: [:x | x \\ 3] descending;
+ yourself.
+
+ "Explore any (sub)expression result by presssing <cmd>I"
+ Project current world.
+
+ "Debug any (sub)expression using <cmd>D"
+ (1 to: 9) join asNumber sqrt truncateTo: 1e-3.
+ (SystemWindow windowsIn: ActiveWorld)
+ select: [:window | window bounds isWide]
+ thenDo: [:window | window color: window color negated].!