The Inbox: MorphicExtras-tcj.256.mcz

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

The Inbox: MorphicExtras-tcj.256.mcz

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

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

Name: MorphicExtras-tcj.256
Author: tcj
Time: 7 June 2019, 3:03:00.368787 pm
UUID: 14a1c7c2-1e36-4ce1-b27f-b046f640921e
Ancestors: MorphicExtras-kfr.255

Tell TextMorphs in Flaps to wrap at parent boundary, rather than extend across the whole display (as exposed by enabling debug code in TextMorph>>drawOn: ).  Must execute the following (as postscript of MorphicExtras package, perhaps) to give life to the change:

FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]

=============== Diff against MorphicExtras-kfr.255 ===============

Item was changed:
  ----- Method: FlapTab>>assumeString:font:orientation:color: (in category 'textual tabs') -----
  assumeString: aString font: aFont orientation: orientationSymbol color: aColor
  | aTextMorph workString tabStyle |
  labelString := aString asString.
  workString := orientationSymbol == #vertical
  ifTrue:
  [String streamContents:
  [:s |
  labelString do: [:c | s nextPut: c] separatedBy: [s nextPut: Character cr]]]
  ifFalse: [labelString].
  tabStyle := (TextStyle new)
  leading: 0;
  newFontArray: (Array with: aFont).
  aTextMorph := (TextMorph new setTextStyle: tabStyle)
  contents: (workString asText addAttribute: (TextKern kern: 3)).
+ aTextMorph wrapFlag: true.
  self removeAllMorphs.
  self borderStyle: (BorderStyle raised width: 2).
  aColor ifNotNil: [self color: aColor].
  self addMorph: aTextMorph centered.
  aTextMorph lock
  "
  FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
  "!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: MorphicExtras-tcj.256.mcz

Tim Johnson-2
Hi,

I found this after enabling debug code* in TextMorph>>#drawOn:





My fix is to wrap the text, thus creating this:





However, the MorphicExtras package may need the following added to its  
postscript for the change to take effect:

FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]

Thanks,
Tim J.

* by changing "false ifTrue: [...]" to "true ifTrue: [...]"

On Jun 7, 2019, at 3:02 PM, [hidden email] wrote:

> A new version of MorphicExtras was added to project The Inbox:
> http://source.squeak.org/inbox/MorphicExtras-tcj.256.mcz
>
> ==================== Summary ====================
>
> Name: MorphicExtras-tcj.256
> Author: tcj
> Time: 7 June 2019, 3:03:00.368787 pm
> UUID: 14a1c7c2-1e36-4ce1-b27f-b046f640921e
> Ancestors: MorphicExtras-kfr.255
>
> Tell TextMorphs in Flaps to wrap at parent boundary, rather than  
> extend across the whole display (as exposed by enabling debug code  
> in TextMorph>>drawOn: ).  Must execute the following (as postscript  
> of MorphicExtras package, perhaps) to give life to the change:
>
> FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
>
> =============== Diff against MorphicExtras-kfr.255 ===============
>
> Item was changed:
>  ----- Method: FlapTab>>assumeString:font:orientation:color: (in  
> category 'textual tabs') -----
>  assumeString: aString font: aFont orientation: orientationSymbol  
> color: aColor
>   | aTextMorph workString tabStyle |
>   labelString := aString asString.
>   workString := orientationSymbol == #vertical
>   ifTrue:
>   [String streamContents:
>   [:s |
>   labelString do: [:c | s nextPut: c] separatedBy: [s nextPut:  
> Character cr]]]
>   ifFalse: [labelString].
>   tabStyle := (TextStyle new)
>   leading: 0;
>   newFontArray: (Array with: aFont).
>   aTextMorph := (TextMorph new setTextStyle: tabStyle)
>   contents: (workString asText addAttribute: (TextKern kern: 3)).
> + aTextMorph wrapFlag: true.
>   self removeAllMorphs.
>   self borderStyle: (BorderStyle raised width: 2).
>   aColor ifNotNil: [self color: aColor].
>   self addMorph: aTextMorph centered.
>   aTextMorph lock
>   "
>  FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
>  "!
>
>
>



Screen Shot 2019-06-07 at 2.38.23 PM.png (31K) Download Attachment
Screen Shot 2019-06-07 at 2.38.41 PM.png (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: MorphicExtras-tcj.256.mcz

David T. Lewis
This is a straightforward change, is there any reason not to move
it to trunk? If no objections I will do so on Monday.

I note that there are other Morphic Extras items in the inbox that
need review, in particular MorphicExtras-kfr.254 which seems like
a useful update, but Karl cautions that it could be a memory hog.
Perhaps someone familiar with the use of SketchEditorMorph could
take a look and see if it makes sense?

Dave


On Fri, Jun 07, 2019 at 03:13:49PM -0700, Tim Johnson wrote:
> Hi,
>
> I found this after enabling debug code* in TextMorph>>#drawOn:
>


>
>
>
> My fix is to wrap the text, thus creating this:
>


>
>
>
> However, the MorphicExtras package may need the following added to its  
> postscript for the change to take effect:
>
> FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
>
> Thanks,
> Tim J.
>
> * by changing "false ifTrue: [...]" to "true ifTrue: [...]"
>
> On Jun 7, 2019, at 3:02 PM, [hidden email] wrote:
>
> >A new version of MorphicExtras was added to project The Inbox:
> >http://source.squeak.org/inbox/MorphicExtras-tcj.256.mcz
> >
> >==================== Summary ====================
> >
> >Name: MorphicExtras-tcj.256
> >Author: tcj
> >Time: 7 June 2019, 3:03:00.368787 pm
> >UUID: 14a1c7c2-1e36-4ce1-b27f-b046f640921e
> >Ancestors: MorphicExtras-kfr.255
> >
> >Tell TextMorphs in Flaps to wrap at parent boundary, rather than  
> >extend across the whole display (as exposed by enabling debug code  
> >in TextMorph>>drawOn: ).  Must execute the following (as postscript  
> >of MorphicExtras package, perhaps) to give life to the change:
> >
> >FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
> >
> >=============== Diff against MorphicExtras-kfr.255 ===============
> >
> >Item was changed:
> > ----- Method: FlapTab>>assumeString:font:orientation:color: (in  
> >category 'textual tabs') -----
> > assumeString: aString font: aFont orientation: orientationSymbol  
> >color: aColor
> > | aTextMorph workString tabStyle |
> > labelString := aString asString.
> > workString := orientationSymbol == #vertical
> > ifTrue:
> > [String streamContents:
> > [:s |
> > labelString do: [:c
> > | s nextPut: c]
> > separatedBy: [s
> > nextPut:  Character cr]]]
> > ifFalse: [labelString].
> > tabStyle := (TextStyle new)
> > leading: 0;
> > newFontArray: (Array with: aFont).
> > aTextMorph := (TextMorph new setTextStyle: tabStyle)
> > contents: (workString asText addAttribute:
> > (TextKern kern: 3)).
> >+ aTextMorph wrapFlag: true.
> > self removeAllMorphs.
> > self borderStyle: (BorderStyle raised width: 2).
> > aColor ifNotNil: [self color: aColor].
> > self addMorph: aTextMorph centered.
> > aTextMorph lock
> > "
> > FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
> > "!
> >
> >
> >
>

>


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: MorphicExtras-tcj.256.mcz

Karl Ramberg
MorphicExtras-kfr.254  give infinite undo to SketchEditorMorph by saving the whole form for _every_ change. You get ability to stress test the garbage collector :-)
It's not a practical solution to infinite undo though, because of the huge amount of data collected.

Best,
Karl


On Sat, Jun 8, 2019 at 4:42 PM David T. Lewis <[hidden email]> wrote:
This is a straightforward change, is there any reason not to move
it to trunk? If no objections I will do so on Monday.

I note that there are other Morphic Extras items in the inbox that
need review, in particular MorphicExtras-kfr.254 which seems like
a useful update, but Karl cautions that it could be a memory hog.
Perhaps someone familiar with the use of SketchEditorMorph could
take a look and see if it makes sense?

Dave


On Fri, Jun 07, 2019 at 03:13:49PM -0700, Tim Johnson wrote:
> Hi,
>
> I found this after enabling debug code* in TextMorph>>#drawOn:
>


>
>
>
> My fix is to wrap the text, thus creating this:
>


>
>
>
> However, the MorphicExtras package may need the following added to its 
> postscript for the change to take effect:
>
> FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
>
> Thanks,
> Tim J.
>
> * by changing "false ifTrue: [...]" to "true ifTrue: [...]"
>
> On Jun 7, 2019, at 3:02 PM, [hidden email] wrote:
>
> >A new version of MorphicExtras was added to project The Inbox:
> >http://source.squeak.org/inbox/MorphicExtras-tcj.256.mcz
> >
> >==================== Summary ====================
> >
> >Name: MorphicExtras-tcj.256
> >Author: tcj
> >Time: 7 June 2019, 3:03:00.368787 pm
> >UUID: 14a1c7c2-1e36-4ce1-b27f-b046f640921e
> >Ancestors: MorphicExtras-kfr.255
> >
> >Tell TextMorphs in Flaps to wrap at parent boundary, rather than 
> >extend across the whole display (as exposed by enabling debug code 
> >in TextMorph>>drawOn: ).  Must execute the following (as postscript 
> >of MorphicExtras package, perhaps) to give life to the change:
> >
> >FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
> >
> >=============== Diff against MorphicExtras-kfr.255 ===============
> >
> >Item was changed:
> > ----- Method: FlapTab>>assumeString:font:orientation:color: (in 
> >category 'textual tabs') -----
> > assumeString: aString font: aFont orientation: orientationSymbol 
> >color: aColor
> >     | aTextMorph workString tabStyle |
> >     labelString := aString asString.
> >     workString := orientationSymbol == #vertical
> >                             ifTrue:
> >                                     [String streamContents:
> >                                                     [:s |
> >                                                     labelString do: [:c
> >                                                     | s nextPut: c]
> >                                                     separatedBy: [s
> >                                                     nextPut:  Character cr]]]
> >                             ifFalse: [labelString].
> >     tabStyle := (TextStyle new)
> >                             leading: 0;
> >                             newFontArray: (Array with: aFont).
> >     aTextMorph := (TextMorph new setTextStyle: tabStyle)
> >                             contents: (workString asText addAttribute:
> >                             (TextKern kern: 3)).
> >+    aTextMorph wrapFlag: true.
> >     self removeAllMorphs.
> >     self borderStyle: (BorderStyle raised width: 2).
> >     aColor ifNotNil: [self color: aColor].
> >     self addMorph: aTextMorph centered.
> >     aTextMorph lock
> >     "
> > FlapTab allSubInstancesDo: [:ft | ft reformatTextualTab]
> > "!
> >
> >
> >
>

>