Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: David Z. on May 03, 2010, 08:16:35 pm



Title: textedit wordwrap and print wordwrap
Post by: David Z. on May 03, 2010, 08:16:35 pm
Is there a way (without a lot of programming) to get a textedit field to wordwrap at the same place when I print? When I print, I can tell it what the right column is. Any way to set the right column in a textedit?

Thanks


Title: Re: textedit wordwrap and print wordwrap
Post by: . on May 03, 2010, 09:38:13 pm
In GDC, Textedit wraps at widget boundary, while report wraps at x character.
This has been introduced as TextEdit can resize and it makes more sense to wrap at the widget border than at xx characters and a lots of blank space, or to see half of the text.

If you really need to have the same wrap, you can acheive that respecting following rules:
- use fontpitch=fixed (so TextEdit width will be exactly xx characters) and no stretch
- use no horizontal scrollbar (if any, there is no wordwrap)
- set wrapPolicy attribute to "anywhere", so the wrap will be done exactly at xx characters
- ensure your textedit is exactly the one defined in the .per

For the last point, I would have suggested to use Hbox tags, but it seems there is a conflict between the hbox and the stretchable capacity of the textedit (we're investigating and a Bz is likely to be created).
So I would the suggest :
- either you put your textedit alone in its GRID container
- either to ensure nothing has an effect on your text edit:
for intstance:

Code
  1. 0123456
  2. [c]
  3. [te     ]
  4.  

if c is a label with a long title, this will influence the textedit's width, so you've to avoid this construction.

Following these advices should lead to the same result ; another option is maybe to use a "Traditional" window (in Traditional mode, "fixed font' windows can be mixed with "modern" ones).

This may sound tricky, but built-in report comes from fixed-font age and today the report writer allows you to create much more powerful and fancy reports, therefore we're not focusing on "old" report anymore.


Title: Re: textedit wordwrap and print wordwrap
Post by: David Z. on May 03, 2010, 10:20:49 pm
You gave me the hint I needed!! I had tried most of your suggestions. Putting it in its own grid (with fontpitch=fixed -- which was already done) did the trick.

Thanks