How to use the Finder in WpTools?

  • Hello All,

    I have tried to make a search form i Delphi XE8 with TWpRichText.Finder - but I cant get it to work. It seems that it jumps over some instances of found text in the TWPRicText document! I have tried several times to get it to work - but I can't figure it out :-( Can you help me?


    My aim is to make a searchform that can find and select every instances of the searchtext - one at a time. But how to do this?


    Thanks in advance.

    Michael




  • The finder works well, there is also an extensive find dialog which may be a good example on how to use it.


    However: My aim is to make a searchform that can find and select every instances of the searchtext - one at a time. But how to do this?


    This cannot really work since it is not possible to have a selection for several words on different paragraphs.


    You can check out the unit

    WPSyntaxHighlight

    It may be of use.


    This code is problematic:

    1. SelectText;
    2. FWp.ScrollToPosition(FWp.CPPosition, 0, 10);

    You should also set the CPPosition to Finder.FoundPostion.

  • Hello,


    I have now set the CPPosition to Finder.FoundPosition - but it seems that the Finder only is able to find the first and last occurence of the searchstring. So how can I get to work so I can jump through all occurances of the searchstring?


    Thanks in advance for any kind of help.

    Michael Eriksen