How to select text inview

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

How to select text inview

Post by jgkoehn »

Greetings,
Is there a way to select the text that is in view to work through?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to select text inview

Post by Sergey Tkachenko »

Do you want to select all text?
Or do you want to select visible text? If yes, do you want to select lines that are visible only partially?
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: How to select text inview

Post by jgkoehn »

Greetings Sergey,
Only visible (I select all from time to time but would like to work with visible) partially visible not as important.

Basically would like the user to be able to scroll and certain text would be marked and as it scrolls off screen it is unmarked unlesss they have changed it.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: How to select text inview

Post by Sergey Tkachenko »

Code: Select all

var
  ItemNo1, ItemNo2: Integer;

ItemNo1 := rve.GetFirstItemVisible;
ItemNo2 := rve.GetLastItemVisible;
if ItemNo1 >= 0 then
  rve.SetSelectionBounds(ItemNo1, rve.GetOffsBeforeItem(ItemNo1),
   ItemNo2, rve.GetOffsAfterItem(ItemNo2));
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: How to select text inview

Post by jgkoehn »

Thanks Sergey, Perfect, I knew it must be simple.

A small addition I think

Code: Select all

rve.GetFirstItemVisible
does it require RVDATA?

Code: Select all

rve.RVDATA.GetFirstItemVisible
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: How to select text inview

Post by jgkoehn »

If I wanted to make it more precise to just the item content in view? Would it be much more?
Post Reply