Moving something into view

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
toolwiz
Posts: 150
Joined: Wed Nov 30, 2005 3:27 am

Moving something into view

Post by toolwiz »

There are several methods of selecting text and items, eg. SetSelectionBounds.

How do you get the selected text to display around the (vertical) center of the main window if it's not in view?

The Search functions do it, but I can't tell how.

(In my app, you can highlight a string and record it's location, like a bookmark, which is saved in a ListView. Later on, you can double-click a line in the Listview, and I want to display the corresponding highlighted string in the main window. It's selecting the item, but not scrolling the window so the selected string is visible. How do I get it into view?)

Thanks

-David
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

Use function ScrollToCaret or
ScrollToItem (RVData: TCustomRVFormattedData; ItemNo: Integer)
where RVData = SRV.RichViewEdit. TopLevelEditor. RVData
toolwiz
Posts: 150
Joined: Wed Nov 30, 2005 3:27 am

Post by toolwiz »

excellent. Thanks!

-David
Post Reply