textedit wordwrap and print wordwrap

Started by David Z., May 03, 2010, 08:16:35 PM

Previous topic - Next topic

David Z.

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

.

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 (per) Select

0123456
[c]
[te     ]


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.

David Z.

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