The Trunk: Morphic-mt.1133.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-mt.1133.mcz

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

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

Name: Morphic-mt.1133
Author: mt
Time: 4 May 2016, 3:43:34.666971 pm
UUID: 3b022579-b00b-c84b-90be-1b1534c5586f
Ancestors: Morphic-nice.1132

Until we find a better way, let projects provide generic means of composing DisplayText into a Form. Used, for example, for our emergency debugger.

=============== Diff against Morphic-nice.1132 ===============

Item was removed:
- ----- Method: DisplayText>>composeForm (in category '*Morphic-Text') -----
- composeForm
- "For the TT strings in MVC widgets in a Morphic world such as a progress bar, the form is created by Morphic machinery."
- | canvas tmpText |
- Smalltalk isMorphic
- ifTrue:
- [tmpText := TextMorph new contentsAsIs: text deepCopy.
- foreColor ifNotNil: [tmpText text addAttribute: (TextColor color: foreColor)].
- backColor ifNotNil: [tmpText backgroundColor: backColor].
- tmpText setTextStyle: textStyle.
- canvas := FormCanvas on: (Form extent: tmpText extent depth: 32).
- tmpText drawOn: canvas.
- form := canvas form.
- ]
- ifFalse: [form := self asParagraph asForm]!

Item was added:
+ ----- Method: MorphicProject>>composeDisplayTextIntoForm: (in category 'utilities') -----
+ composeDisplayTextIntoForm: displayText
+
+ | tmpText canvas |
+ tmpText := TextMorph new contentsAsIs: displayText text deepCopy.
+ displayText foregroundColor ifNotNil: [:color |
+ tmpText text addAttribute: (TextColor color: color)].
+ displayText backgroundColor ifNotNil: [:color |
+ tmpText backgroundColor: color].
+ tmpText setTextStyle: displayText textStyle.
+ canvas := FormCanvas on: (Form extent: tmpText extent depth: 32).
+ tmpText drawOn: canvas.
+ ^ canvas form!