Beiträge von toreo

    I did a buildall, and I know that only images which are pasted after the new build are supposed to be compressed. Nevertheless when I copy a 100 kB image from the web, paste it and save, the result is a rtf-file of almost 2000 kB.

    I have mailed you a small demo.

    I can't get the compression of pasted bitmaps to work. I have defined COMPRESSBITMAPASJPEG in the project and in WPInc, but the file size is still not reduced when I save a document with pasted images.

    5.17.4, D7.

    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).

    I have implemented a highlighter pen (as in MS Word). When the pen is active, I set the highlight color to for instance clYellow, and when the mouse is released, the background of the selected text is set to yellow.

    A slight problem: When text is selected till the end of the document, new text which is added at the end appears with the yellow background.
    Here is a code snippet from the OnMouseUp event, which does not work in this respect:

    Editor.SelectedTextAttr.SetBGColor(Editor.HighlightColor);
    Editor.CPPosition := Editor.SelStart + Editor.SelLength;
    Editor.SelLength := 0;
    Editor.CurrAttr.BKColor := Editor.PaperColor;

    How can I remove the yellow background for new text?

    I would like to have both of them, but especially Ctrl+Enter. In MS Word, this restores the attributes to those of the Normal template. Very useful.

    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?

    I use bookmarks for storing information which may appear in a popup menu. Some text is selected and the bookmark name inserted.

    Sometimes the user will select text which already contains a bookmark somewhere. The old bookmark must then be deleted before a new one is inserted.

    Essentially I use the following code:

    Select text and click an Insert button.

    Code
    DeleteBookmarkInSelection(WPRichText1);WPRichText1.BookmarkInput('TEST');

    The procedureDeleteBookmarkInSelection is:

    There is a slight problem: After the bookmark deletion the selection is shifted one character to the right so the bookmark starts at the second character of the first selected word.

    Is there an obscure bug in my code or is there a problem with BookmarkDelete?

    Julian: I have sent you a demo which shows the effect.

    If you insert text in the mailmerge demo so as to push the fields into page two, the hint form does not display any more. It probably appears outside the screen.

    My guess is that there is a bug in the GetPointFromParLin function.

    Maybe this note may save somebody a few minutes of headscratching:

    If a WPRichText is aligned to client and layoutmode is normal, then if you activate the autosize mode in EditboxModes D7 freezes. If you do it in code the program crashes.

    Not a big issue, but perhaps it can be easily fixed?

    I have been experimenting with InsertCopy to insert a picture from a TImage. The image is distorted to be always square after insertion in a WPRichText.

    This may be seen if you replace the included WPTools image in the TextObjects demo. Why the rectangular WPTools image is not also distorted is a small mystery to me. Am I overlooking something or is there a bug?

    When text is deselected in the demo wordprocessor by clicking outside it , there is a quite noticeable delay before the baxkground color vanishes. This is on a fast XP PC.

    Other issues:

    A horizontal line is not inserted until you click somewhere else in the text.

    The table creation grid is mixed up until you move the cursor into it.

    Thank you.

    However, the source code seems to be for an older version, which does not include the Insert, OLE object menu.

    It seems not to be sufficient to set the ObjectWritingMode to Standard. The OLE object is still not saved, only an empty container.

    >I hope I can create an example which inserts a true OLE object into the text for V5.

    In the meantime, could you tell me how to save the OLE info with the document? The "Impressive Sample wordprocessor" does this, but I don't have the source code for this program.