TextFlow: How to apply certain rules to it?

  • In my application I use the wonderful ability of WPRichEdit
    to "link" a few controls together, so that the text can flow
    from one to another in case it doesn't fit entirely. By using
    this feature, I can do multi-column output in my reports, and
    similar "split" functionality, like placing parts of the text
    in separate blocks on different pages. (For those of you who
    missed it - check out TextFlow sample).

    Here is what I'm missing there: ability to affect the rules for
    calculating the "break", i.e. the place in the document
    where the split occurs. Currently, it is fully automatic, and
    the break happens on the first line, which doesn't fit.

    Here is a sample of the text, which demonstrates the need in
    more intelligent rules:

    I'd like to suggest to the engine somehow, that I prefer
    break to happen on a "subtitle" line, so that it always
    stays together with the subsequent paragraph(s).
    This is just one example - in fact, there are different
    cases like this, and they may have more complex rules.
    So it'd be nice to introduce some "user-controlled" logic
    there...

    What's the best way to approach this?

    Thanks!

    Mik

    • Offizieller Beitrag

    The text path feature in V4 uses streams to save and reload text. So each editor is on its own and the text is seperated into different parts.

    So, if you need rules you can change the way the engine select the text which flows 'out' - fo examle change the paragraph pointers to select one paragraph less. I am not sure if this will work though.

    WPTools V5 uses a completely different approach for text paths which is much better. The text is stored in one TWPRTFStorage and each attached editor only displays one 'page' (ok, this are really small pages) from it. So the text is not seprated and the formatting routine which does the page breaks usually is also used for the distribution on this small pages.

    Julian