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:
- Loads first/next WPRichText
- highlights the match if found else repeats step 1 because it invokes OnSearchReplaceMessage event
- click next
- displays its own "text not found", does not invoke the OnSearchReplaceMessage event
- I click inside the WPRichText
- Click next
- Highlights the match
- click next
- Highlights the next match if there is one, else goes to step 1 because it invokes OnSearchReplaceMessage event
Thoughts?