Posts by ehimmer

    I tried to do this in my own Paste action (and turn it back on after):

    1. if not (
    2.   ClipBoard.HasFormat(CF_METAFILEPICT) or
    3.   ClipBoard.HasFormat(CF_ENHMETAFILE) or
    4.   ClipBoard.HasFormat(CF_BITMAP) or
    5.   ClipBoard.HasFormat(CF_PICTURE) ) then
    6. begin
    7.   WPRichText1.ClipboardOptions := WPRichText1.ClipboardOptions - [wpcoDontPasteGraphics];
    8. end;

    But noticed that you also use the wpcoDontPasteGraphics as if it was a wpcoDontCopyGraphics as well, so I cannot copy linked images when that option is set. Can you add a wpcoDontPasteGraphics option to the clipboard options so it can bet set separately?

    I wanted to use your clipboard option to prevent pasting of bitmaps and other graphics into a WPRichText because I only want linked images. I can paste a linked image in code, but I cannot copy and paste that same linked image into the same or another WPRichText when that option is set.

    Is there a way to allow a clipboard copy/paste of a linked image yet still prevent copy/paste of a non-linked image?

    When I enable the wpDisableTouch in EditOptionsEx2 (v9.2.002), I cannot scroll with my fingers at all. In 9.2.001, I with DELPHI_TOUCH switch off, I could still scroll using two fingers. I prefer the single finger scrolling as with wpDisableTouch off, but I lose some functionality with selecting text and then moving the selected text to a new location (with fingers).

    Just installed v9.2.002, seems mostly consistent between layout modes but not fully. It still could also be a little bit more forgiving as well because as soon as the mouse moves just below the center of the circle it thinks I want to move to the next line when in fact I was just trying to slide it to the right. Worse with my finger. I also cannot select text and then drag it to a new location with my finger. I can with a mouse, but not a finger (except on rare occurrences, just not sure what I do to make it move)

    Here is a video showing the differences between the two layout modes. You will see that the circle changes color at different points within the circle between modes and how it too easily moves to the next line. The first part of the video is in wplayShowManualPageBreaks, the 2nd part is in wplayFullLayout.

    Hope you can see what I mean.


    My users want to be able to scroll and select like it was before in our older app that used WPTools5, which they really liked. The new DELPHI_TOUCH methods are just too difficult and confusing for inspectors since they want their finger to act just like a mouse.

    Functionality they like from WPTools5:

    • If a single finger starts moving up or down, then it is a scroll function.
    • If a single finger is on text and you start left or right, then it starts a select.
    • If it is on an image, it is a move image operation.

    All this is just like your finger is a mouse (yes, they have that tablet (Surface Pro) option set to make a pen act like a mouse but only applies to a pen not a finger).

    I was hoping disabling the DELPHI_TOUCH switch would revert back to the old functionality, but while it comes very very close, the one exception is that you need to use two fingers to scroll which means any single finger movement is a select.

    Our inspectors tend to hold the tablet with one hand and want to scroll with the same hand using their thumb much like you do on a phone. Either that, or they might be holding another tool in the other hand and can only manage one finger on that other hand to control the tablet without first putting down that tool. Try it... hold a flashlight in one hand, the tablet in the other and try a two finger scroll.

    I had to disable the DELPHI_TOUCH switch for better tablet operation for our users to be more like it was in the the older WPTools (specifically WPTools 5). However, this prevents a finger scroll of the Print Preview window.

    I did find a way to get it to work. However, I have to use two fingers, and my customers want a single finger scroll capability (they are inspectors, and the way they hold a tablet and other tools, they would like to use one hand to hold the tablet and scroll at the same time with the same hand, such as with their thumb like you typically do on phone. Either that, or they might be holding another tool in the other hand and can only manage one finger on that other hand to control the tablet without first putting down that tool. Try it... hold a flashlight in one hand, the tablet in the other and try a two finger scroll.

    I had to add this to the TWPPreviewForm.FormCreate to at least allow a two finger scroll, but it is not good enough:

    1. WPPreview1.Touch.InteractiveGestures := [igPan, igZoom];

    WPTools 9.2.001

    Delphi 10.4.1

    Is there a way to make the markers a bit more forgiving? If I attempt to drag the circle part, it moves to the next line if my mouse grabbed it below the mid point of the circle it seems. And if I use my finger (when in wplayFullLayout anyway since it doesn't work when wplayShowManualPageBreaks), I always have to touch it above the circle. IMHO, it could be more forgiving... quite annoying for me at the moment as the markers seem to jump all over the place too much in real world conditions. Getting more frustrating to use, sorry.

    For completeness, I now paint the "link" image only if the image is within bookmarked text. Code follows:

    Works perfectly, thanks! I still have to add some code to optionally paint the link overlay, but this is what I did in case it helps anyone:

    When in layout mode of wplayFullLayout with wppInteractiveSelectionMarker enabled, moving the markers works well. However, when the layout mode is wplayShowManualPageBreaks it does not work at all other than showing the markers.

    For example, in wplayFullLayout when I move the mouse over a selection marker, it changes color (blue to light blue, then orange when dragging). But in wplayShowManualPageBreaks it doesn't change color at all and you cannot drag them. If you try, they just disappear.

    WPRichText 9.2.001

    Delphi 10.4.1

    For text, I use the BookmarkTextAttribute to show a double underline in green. However, If I just bookmark an image (linked), or an image is part of the bookmarked text, it does not show this double underline under the image (as expected I guess). Can you think of anything I can do to indicate that an image is bookmarked other than showing the bookmark indicator in the gutter? Maybe even an overly that is only visible in the editor but not in print preview or the PDF?

    To fix this issue on my end I had to process the style change completion message doing this:

    Maybe that will help?

    When the active caret is in a WPRichText and I change VCL styles, the caret disappears but is still in the WPRichText because I can type but there is no caret until I move focus away and come back to the WPRichText. Note that the caret does not disappear if in a TEdit component for example, just a WPRichText from what I can tell.

    WPRichText 9.2.000

    Delphi 10.4.1

    If I drag a table bottom border down to increase its height, and then add just enough lines above the table to cause the table to get pushed to a new page, the height of the table is lost and it reverts to what I would call the default height. If I add additional lines above the table once on a new page, the table height is recovered. Also a hard page break works fine and does not affect the temporary table height issue.

    WPRichText 9.1.820

    If I add a table, and offset it from left margin, the ruler is not visually reflecting the table cell. Hope you can see the images... they are blocked for some reason, but show up if you click on the links): Note, this is on Layout Mode of wplayShowManualPageBreaks. It seems OK when in wplayFullLayout.

    Table at left margin:

    [Blocked Image:]

    Moved the table left border inwards (ruler not visually correct, IMHO)

    [Blocked Image:]

    Two cell with left border moved inwards (cursor is in 2nd column or lower table):

    [Blocked Image:]

    I don't mean to be a pain, but I do select multiple whole paragraphs and the hit the DEL key and the OnDestroy event does get invoked. But if I select ALL paragraphs it does not invoke the OnDestroy event. This is why I ask what the different is.

    My bad, yes, OnDestroy in which I set the event to my ImageDeleted procedure. So why the difference if I select all vs select most followed by the DEL key? I don't do anything different, but does deleting all go thru a different path? I really need to know when an image gets deleted by any method. So for now in the case when everything was deleted, I have to use the WPRichText's OnChange event and if it is empty I loop thru all ImageObjects (I keep a list of them for purposes like this), and in code I force a call to my ImageDeleted function which gets me by. I don't like that, but if that is what I have to do, then that is what I have to do. I still don't understand why Select all + DEL is not doing the same thing as Select some/most + DEL in regards to OnDestroy since they are being destroyed in both instances. If it has to do with the Undo buffer, why do they not both do the same thing?

    Sorry, not sure I understand. Take for example a WPRichText with many paragraphs and about 10 linked images. I can select everything except one word, and hit the DEL key, and all images get their OnDelete event triggered. However, if I select ALL text, they do not trigger their OnDelete event.

    I assign an OnDestroy event to image TextObjects to occur when deleting an image in order to do some house cleaning. Deleting a selected image works, even selecting text that includes all the images (but not all the text) works. However, if I do a SelectAll (Ctrl+A) or use the mouse select everything and hit the delete key, the OnDestroy for the images is not being invoked. Any idea what is wrong?

    WPRichText 9.1.820

    Delphi 10.4.1