Beiträge von pfand

    Hello,
    I think, that Your grabber doesn't grabb correktly!!!

    RTF has a syntax and if your grabber doesn't know this syntax, the results will be unpredictable!

    The rtf-snippy in your first posting has an illegal format:
    - it starts with a closing '}'
    - and endsup with an uncomplete rtf-tag.
    so you should not wonder about the errormessage!

    Hello,

    I think, Your loop doesn't terminate when You found the first #13
    insert a break or exit command like the following:

    repeat
    if Ord(WPRichText1.CPChar^)= 13 then
    begin
    endp := WPRichText1.CPPosition;
    WPRichText1.SetSelPosLen(start, endp-start);

    break; // exits the repeat loop
    { OR }
    exit; // exits the procedure SelectUntilEOL

    end;
    until not(WPRichText1.CPMoveNext);

    This should work.
    Perhaps You have to adapt the 'endp' because at the moment it will include the #13 (I think)

    Hello Julian

    I think the solution you mentioned creates a lot of undolevels.

    Zitat

    You can add this
    if Key=#32 then FMemo.RTFData.NewUndolevel;
    before line 2568 (= 4th last "end" of KeyPress(var Key: Char); ) to get a new undo level afeter each space. I put this into the official code, too.

    Other wordprocessors create a new undolevel when the user changes his action.
    Example: You are typing text and then you press <delete> this will create a new level
    But pressing <backspace> while entering text will not create a new level, because this is a corecting of a typo.

    I think it would be greate if it would be configurable which 'actions' (typing a special character) crate a new undolevel extra to the standard (cursor movement)

    Andreas