Beiträge von ehimmer

    I created a new project, so nothing but defaults except for the AcceptFiles option is now true in the WPRichText. I pre-loaded a shaded table with a transparent PNG in one cell. Created the PDF and it is not transparent. I then dragged that same PNG image I used in your demo, and dropped it into the other cell. PDF again created without transparency.

    I will send you the sample. I am at a loss as to what might be different between your demo and my basic sample app.

    OK, Instead of using the Insert Image option in your demo which did not give me the option for PNG images, I tried dragging the image into the table cell which accepted it. Creating the PDF worked fine as you said.

    Maybe it has something to do with linked images? Or perhaps I have some PDF creation setting set wrong. I'll dig into it more and let you know what I find.

    Sorry, I do not see a GDIPP switch in WPObj_Image. Could it be "USEGPP"? I tried disabling USEGPP and it made no difference.

    Also, how did you test it in your demo? I downloaded WPCubedWordprocessorDemo and could not find a way to insert a PNG image to test.

    To test, I created a one row two column table. I then shade the table cells and insert a linked PNG image into one of the cells. Print preview shows it correct, but then creating the PDF is where it is not transparent, i.e. the cell color does not come through the transparent parts of the image.

    Thanks for the info on the cursor width (I'll see what I can do about using the Windows configured width).

    One thing to note on the blinking is that the caret blinking duration is controlled by Windows 10, and they now stop it after 5 seconds by default:

    https://superuser.com/questions/1436…s-on-windows-10

    And I hate that as do so many others! Not sure why Microsoft decided to do that and not give users an easy way to configure it. Feels like something has locked up or is busy doing something when it isn't, and as such makes it hard to find where the cursor is in some cases. Not your concern, just me venting. ;)

    Windows 10 allow a user to adjust the width of the text cursor (caret) in the Ease of Access settings, however, WPTools does not seem to honor that setting. Could this be changed or maybe point me to where in code I could change this? (yes, your text cursor is wider than some apps, but apparently some customers want it even thicker on smaller screen devices I guess)

    We have several customers complaining about this as well as where Windows 10 stops it from blinking after 5 seconds. There is a registry fix for the blinking, but I had no answer for the width.

    In WPT5 I did not need to use SetFocus. I was just trying to figure out why I have to manually focus the WPRichText in WPT9 using the standard dialog. Still haven't figured that out yet. The manual focus only works after the standard dialog itself (not your OnSerchReplaceMessage event) reports that it didn't find anything (even thought there is a match). After that dialog, I can click in the WPRichText and select find, and it works until the next load of the WPRichText.

    I tried your new dialog, and that issue is not present which is good, but have other questions/problems:

    Why does TWPSearchReplaceDialog always start with the Replace checkbox set even though my options are all cleared? I might want to find, not replace:

    WPSearchReplaceDlg1.Options := [];

    I ended up replacing my first few test texts with blank when I thought I was just doing a find. But was lucky it didn't save because the replace didn't invoke the OnChange event, which is a problem in itself.

    When doing a replace, the Count parameter in the OnSearchRepalceMessage is always 0. What is this Count? I can't find anything in the documentation, sorry.

    Is there a way to autofill the search box? For example, if my text cursor is on a word, I'd like to just do a CRTL+F and the dialog pops up with that word (WPRichText1.CPWord) in the dialog.

    One last thing for future consideration in your dialogs...

    As I've mention in the past, it would be nice if you allow the programmer to decide where the dialog should show up. Currently it always shows up in the top left corner, which is not nice on a 4K 40" monitor when my app is a relatively small form in the middle of the monitor. Like the old baseball reference "out in left field" in the literal sense. ;)

    Thanks, I will check out the new dialog.

    FYI, I do not use TDBWPRichText, just the normal TWPRichText. My app does not lend itself to be able to use a TDBWPRichText. Depending on what the user is doing, I load a specific record from the database and need to analyze it before loading the TWPRichText. So for spell checking all the pertinent database records, I navigate through a TreeView and pull the corresponding record via a class object. I won't go into any more detail, but using TDBWPRichText is not an option.

    So, when clicking next, and there are no more matches, I do the next treeview item that can be searched on and load that specific record. I need and event to tell me that no more matches exist in the current WPRichText where I can then move to the next treeview item and begin again, seamlessly. The treeview items are a random order of objects that relate to database objects, and the user needs to see where they are in relation to the treeview.

    I did use Finder in WPT5 and it worked well. For WPT9 I even tried setting focus in code on the newly loaded WPRichText, but had the issue I mentioned in my previous post where I had to manually focus the WPRichText to get it to find next.

    I will definitely try out the new dialog for both Find and Replace. I hope I also find how to keep a total count of the replacements as I was able to do in WPT5 (not real important, but can useful to the user).

    Having trouble converting the Find and Replace dialogs.from WPT5 to WPT9 as they have changed. The only demo I found was the FindText demo, but it was not much help.

    • In WPT5, FindDialog had multiple parameters to be able to pass in the TFindOptions, now it doesn't. The ReplaceDialog had TReplaceOptions and TotalCount, now it doesn't, but I need a total count.
    • The old event OnTextNotFound is now OnSearchReplaceMessage.

    I need to be able to find and/or replace text within multiple WPRichTexts from a database that get loaded into the same WPRichText in sequence (and saved as needed when using replace), and keep a total count of how many words were replaced.

    Basically the same logic I used in WPT5 is not working in WPT9, The only changes were commenting out those parameters previously used in WPT5, and using that other event.

    What is happening is that it works up until it finds a match, i.e. loops loading each WPRichText out of the database just fine. Once it finds a WPRichText with a match, it highlights it, but clicking on find next just displays its own "text not found" msg even if there are more matches in the current WPRichText and does not invoke the OnSearchReplaceMessage event in order for me to move on to the next WPRichText.

    It is as if the find dialog is no longer hooked to the recently loaded WPRichText. If I then click in the currently loaded WPRichText, it then continues correctly until it loads a new RichText, where it then highlights the first match and gets "unhooked" again somehow. I'm thinking I'm missing something when reloading the WPRichText during a find that is currently in progress.

    Sequence:

    1. Loads first/next WPRichText
    2. highlights the match if found else repeats step 1 because it invokes OnSearchReplaceMessage event
    3. click next
    4. displays its own "text not found", does not invoke the OnSearchReplaceMessage event
    5. I click inside the WPRichText
    6. Click next
    7. Highlights the match
    8. click next
    9. Highlights the next match if there is one, else goes to step 1 because it invokes OnSearchReplaceMessage event

    Thoughts?

    b) Nice. That will most likely come in handy when our customers create what we call RapidRemarks (reusable comments). Single paragraphs with attributes could potentially be used.

    c) Ahh, much better I think! I use LoadFromString and LoadFromStream elsewhere, so this makes it consistent. But still OK for appending? (which is what I'm doing here, not replacing). I'll find out.

    I traced it down to the exact statement which is stripping off the attributes of the last paragraph.

    dest.SelectionAsString := src.AsString;

    If I change it to this, it works:

    dest.SelectionAsString := src.AsANSIString('WPTOOLS');

    However, it gives me the warning "Implicit string cast from 'AnsiString' to 'String'

    How to properly avoid that warning?

    Seems I had changed that line during the initial re-write in order to avoid the warning. My bad.

    Somehow there is more to it than that. Yes, the example I sent you falls into that category, and if I add things in front of that last paragraph in the example, it works OK. However, in my app itself, as long as the last paragraph has a border, it gets lost whether or not there is anything in front of it or not. I guess I need to track it down further and send you a new example once I figure out the process that is failing me. I thought I had it, but unfortunately for me I guess not. In my app it is all constructed during a complicated mailmerge, but my example does not do that, so maybe something there. I'll work on it some more, sigh.

    In trying to create a demo, it turns out it has nothing directly to do with deleting trailing blank lines. It is in how the Contents.options is being handled differently now than it did in WPT5 during a merge. Something about using mmUseFirstLoadedParProps and/or mmUseFirst_AlsoBorders options I suspect, maybe others because for some reason I use different options at different phases of a merge building my final report from a bunch of layouts and other things. So, by still having a blank line after a paragraph with borders doesn't try to wipe out that bordered paragraph's properties with what is being merged in is my guess.

    I seem to remember having a lot of issues with WPT5 in dealing with paragraphs taking on attributes of the merged paragraphs or vice-versa. So maybe something was fixed that I can now back out. I'll have to do some experimenting, not something I'm looking forward to due to the many hours I invested in the report generation over the years with so many different scenarios I had to troubleshoot. Basically the report generation of mine is a house of cards.

    Consider this thread closed.