SearchTextW that returns bounds or itemindex instead of selecting

General TRichView support forum. Please post your questions here
Post Reply
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

SearchTextW that returns bounds or itemindex instead of selecting

Post by jgkoehn »

Greetings Sergey,
Is there a SearchTextW or something similar that returns bounds instead of selecting. I am working on a search dialog that deals with formatting and other things. What I need to do basically is get the item in search bounds or its index and test it against various font styles etc.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by Sergey Tkachenko »

Is the text formatted? Selection requires formatted document.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by jgkoehn »

It is formatted
SearchTextW is working well the only thing is I would like to not have to do RichViewEdit.Deselect is all instead I would rather know the bounds
StartItem, StartOffs, EndItem, EndOffs. If I do some more research I may be able to build this.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by Sergey Tkachenko »

Sorry, I misread the question.

Currently, SearchText can only select text. But I think it makes sense to add OnTextFound event, where you can do custom processing instead of selecting.
I'll include it in the next update (not in the today's update). Let me know if you need it urgently.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by jgkoehn »

Not urgent but it will help with a Search and Replace like MS Word has that is also format based. Thanks!
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by jgkoehn »

Further info here?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by Sergey Tkachenko »

I implemented OnTextFound event. If you want, I can send changed files to you by email.
A release will be later.
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: SearchTextW that returns bounds or itemindex instead of selecting

Post by jgkoehn »

That would be great thank you if you send it by email
Post Reply