I am trying to adjust the layouts of PluggableTextMorphs to eliminate scrollers and expand the boundaries to display larger blocks of text. Left image is current state, right image is what I would like to see. The attached change set contains the method that I use to create each row.
Right image was resized using the Halo.
Perhaps the question to ask is, "How do I create a PluggableTextMorph of a given width with the height set to a value large enough to contain all of the text?"
Thanks in Advance, jrm
In case the image embedded in the email did not come through; left image == asis.png, right image ==ShouldBe.png.
Thanks!
On Sun, Apr 22, 2018 at 8:44 AM, John-Reed Maffeo jrmaffeo@gmail.com wrote:
I am trying to adjust the layouts of PluggableTextMorphs to eliminate scrollers and expand the boundaries to display larger blocks of text. Left image is current state, right image is what I would like to see. The attached change set contains the method that I use to create each row.
Right image was resized using the Halo.
Perhaps the question to ask is, "How do I create a PluggableTextMorph of a given width with the height set to a value large enough to contain all of the text?"
Thanks in Advance, jrm
Hi jrm,
LayoutFrames are only used by the ProportionalLayout, not the TableLayout. Creating such a "form layout" with TableLayout is possible if all labels get a fixed width and #hResizing to #rigid. The input fields then #hResizing to #spaceFill. Do it row by row.
Here is an example:
Here is the code, have fun :-) Yes, you should use an actual model for PluggableTextMorphs, not call #setText. Anyway :
loremIpsum := [:num | ((1 to: num) collect: [:ea | Symbol allSymbols atRandom asString]) joinSeparatedBy: ' '].
container := Morph new. container color: Color sky; layoutPolicy: TableLayout new; listDirection: #topToBottom; cellInset: 5; layoutInset: 5; extent: 500@1000. 10 timesRepeat: [ | row label inputSingle inputMulti | row := Morph new. row color: Color aqua; layoutPolicy: TableLayout new; listDirection: #leftToRight; cellPositioning: #topLeft; cellInset: 5; layoutInset: 5; hResizing: #spaceFill; vResizing: #shrinkWrap. label := Symbol allSymbols atRandom asText asMorph. label autoFit: false; width: 150. inputSingle := PluggableTextMorph new. inputSingle setText: (loremIpsum value: 3 atRandom); hResizing: #spaceFill; height: TextStyle defaultFont height * 1.5; wrapFlag: false; acceptOnCR: true; hideScrollBarsIndefinitely. inputMulti := PluggableTextMorph new. inputMulti setText: (loremIpsum value: 10 atRandom); hResizing: #spaceFill; height: (50 + 100 atRandom); wrapFlag: true; hideHScrollBarIndefinitely. row addMorphBack: label; addMorphBack: {inputSingle.inputMulti} atRandom.
container addMorphBack: row].
container openInHand.
Best, Marcel Am 23.04.2018 00:35:31 schrieb John-Reed Maffeo jrmaffeo@gmail.com: _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners In case the image embedded in the email did not come through; left image == asis.png, right image ==ShouldBe.png.
Thanks!
On Sun, Apr 22, 2018 at 8:44 AM, John-Reed Maffeo <jrmaffeo@gmail.com [mailto:jrmaffeo@gmail.com]> wrote:
I am trying to adjust the layouts of PluggableTextMorphs to eliminate scrollers and expand the boundaries to display larger blocks of text. Left image is current state, right image is what I would like to see. The attached change set contains the method that I use to create each row.
Right image was resized using the Halo.
Perhaps the question to ask is, "How do I create a PluggableTextMorph of a given width with the height set to a value large enough to contain all of the text?"
Thanks in Advance, jrm
Marcel,
Thank you. I will work through this example and see if I can use your ideas in my solution.
-jrm
On Wed, Apr 25, 2018 at 3:36 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi jrm,
LayoutFrames are only used by the ProportionalLayout, not the TableLayout. Creating such a "form layout" with TableLayout is possible if all labels get a fixed width and #hResizing to #rigid. The input fields then #hResizing to #spaceFill. Do it row by row.
Here is an example:
Here is the code, have fun :-) Yes, you should use an actual model for PluggableTextMorphs, not call #setText. Anyway :
loremIpsum := [:num | ((1 to: num) collect: [:ea | Symbol allSymbols atRandom asString]) joinSeparatedBy: ' '].
container := Morph new. container color: Color sky; layoutPolicy: TableLayout new; listDirection: #topToBottom; cellInset: 5; layoutInset: 5; extent: 500@1000. 10 timesRepeat: [ | row label inputSingle inputMulti | row := Morph new. row color: Color aqua; layoutPolicy: TableLayout new; listDirection: #leftToRight; cellPositioning: #topLeft; cellInset: 5; layoutInset: 5; hResizing: #spaceFill; vResizing: #shrinkWrap. label := Symbol allSymbols atRandom asText asMorph. label autoFit: false; width: 150. inputSingle := PluggableTextMorph new. inputSingle setText: (loremIpsum value: 3 atRandom); hResizing: #spaceFill; height: TextStyle defaultFont height * 1.5; wrapFlag: false; acceptOnCR: true; hideScrollBarsIndefinitely. inputMulti := PluggableTextMorph new. inputMulti setText: (loremIpsum value: 10 atRandom); hResizing: #spaceFill; height: (50 + 100 atRandom); wrapFlag: true; hideHScrollBarIndefinitely. row addMorphBack: label; addMorphBack: {inputSingle.inputMulti} atRandom.
container addMorphBack: row].
container openInHand.
Best, Marcel
Am 23.04.2018 00:35:31 schrieb John-Reed Maffeo jrmaffeo@gmail.com: _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation. org/mailman/listinfo/beginners In case the image embedded in the email did not come through; left image == asis.png, right image ==ShouldBe.png.
Thanks!
On Sun, Apr 22, 2018 at 8:44 AM, John-Reed Maffeo jrmaffeo@gmail.com wrote:
I am trying to adjust the layouts of PluggableTextMorphs to eliminate scrollers and expand the boundaries to display larger blocks of text. Left image is current state, right image is what I would like to see. The attached change set contains the method that I use to create each row.
Right image was resized using the Halo.
Perhaps the question to ask is, "How do I create a PluggableTextMorph of a given width with the height set to a value large enough to contain all of the text?"
Thanks in Advance, jrm
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org