Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

TppMemo vs TMemo not WYSIWYG

edited March 2005 in General
Hi,

I want to have a true WYSIWYG memo. On screen, I'm using a TMemo, with font
Arial 11 Bold. On the report, I'm using a TppMemo, with the same font.

The text is often one paragraph, but sometimes more than one, with standard
CR/LF for line breaks.

Depending on the text in the memo, word wrap does not always occur between
the same word on screen and in the report. I notice that the width of the
TppMemo have to be larger than the TMemo, because the Tmemo seems to have
some margins within the memo. Fine. So I increase the width (in screen
pixel) of the TppMemo until this text wrap exactly as on screen, but with
another text, I have to decrease it. There is no unique width value that fit
all texts !!

I saw that TppMemo use its own code to wrap text, which is definitively
different than the Windows API.

I'm using a JITPipeline in one unit, and reports in different units. I don't
want reports units to 'uses' forms units, only the pipeline.

One workaround (I have not tried yet) may be to copy the content of the
TMemo.Lines line by line in another pipeline field with a CR/LF on each end
of lines, and use that field instead, but, humm, I don't like that.

Any other workaround?

(Using D5, RB603, Win2000)
(Soon D2005, RB9, Win2000)

Thanks,
Jocelyn Cyr.

Comments

  • edited March 2005
    Hi Jocelyn,

    The TppMemo object was not designed to emmulate the behavior of the TMemo
    object (or the Windows Multiline Edit Control). It was our own design to
    easily output multiple lines of text on a report.

    If you would like to exactly represent a TMemo on a report, you will
    probably need to transfer the text of the TMemo line by line (using the
    Lines property) to the TppMemo.Lines property. Once these match up, all you
    would need to do is determine the length of the longest line in the memo and
    size the TppMemo object accordingly.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.