The split screen technique: Two questions

    • Offizieller Beitrag
    Zitat

    1. I notice in the splitscreen demo that if you start writing, the
    characters appear simultaneously in the two windows. If you paste a lot of text and then start writing, the other window is not updated until you click in it. Is this correct?

    The windows are not connect in a 'hard' way. Both windows use a message loop to process the paint commands "when there is time". Otherwise it would not respond quickly.

    If you paste text into one window that will respond before window two does. But window two will be updated when the operation if finished, not if you click into it. Maybe it has to do with the focus since window two will not scroll (for obvious reasons)

    Zitat

    2. Is it possible to move the current position in the first window to the current position in the other window when you move the cursor, click in or scroll the other window (so you always see the same text in both windows)?

    WPTools 5 only uses ONE current position. This means the current position in window one is the current position in window two. Also the selections are the same.

    When I created this concept I thought about handling different cursor position but that would make the handling much more difficult and UNDO hardly possible. So the UNDOSTACK and the cursor is property of the TWPRTFDataCollection and so shared between the editors.

    If you want to scroll the second window according to the first (syncronize both) use Memo.ShowCursor in the OnChangeCursorPos event of the WPRichText 1 and 2. (Do not use the ShowCursor procedure in TWPRichText since that triggers OnChangeCursorPos )

  • OK, this works. When I scroll and click in one of the WPRichtexts, the other scrolls too. The second window is updated after a few seconds when I have added some characters in the first.

    Now, would it also be possible to PREVENT updating of WPRichText1 when writing in WPRichText2 until I click an update button?

    • Offizieller Beitrag

    Hi,

    >>Now, would it also be possible to PREVENT updating of WPRichText1 when writing in WPRichText2 until I click an update button?<<

    No this is not possible. Both editors are actually working with the same data so if the date is changed by one of the editos the other will show the change, too. (Priciple of "splitscreen")

    Julian

  • I am writing an educational applicaton where I want to draw attention to certain sentences in the document. It would be nice to have the relevant part of the text appear in a separate small window, together with some advice, for editing there. The corresponding text in the main window would also be visible.

    It would be nice if either the changing text appears in both windows simultaneously. Alternatively, the changed text does not appear in the main window until the second window is closed.

    It appears from your answer that the second option is impossible. My experiments with the demo suggests that there usually is a delay before the main window is updated, and that does not look good. Is there a way to turn on a rapid update of the main window when the second window is shown, and off when it is hidden? (I understand that a permanent rapid update would decrease performance).