TRichview and auto set focus

General TRichView support forum. Please post your questions here
Post Reply
Fishous
Posts: 7
Joined: Mon Mar 19, 2007 1:27 pm

TRichview and auto set focus

Post by Fishous »

I'm using a TRichViewEdit as a chat text control. The problem I am having is that certain operations, such as scanning for URLs makes the control set focus to itself, which is really annoying when you're trying to type in another control.

I'm using HTML and the HTML Importer, as well as a scan url procedure.

Is there any way to prevent SetSelectionBounds from setting the focus to the control? It makes programatic adding of text impossible to work with.
Sergey Tkachenko
Site Admin
Posts: 17357
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, some editing operations and operations with selection can move focus to the editor.

But HTML importer and url scanning must not do it. I'll check tomorrow.
Fishous
Posts: 7
Joined: Mon Mar 19, 2007 1:27 pm

Post by Fishous »

Well, while you're at it, check and see if it makes it automatically scroll to the end. I removed rvoScrollToEnd from the RichEdit Options, and when I import the table, it still scrolls to the end.

I'm "basically" doing this:

FRichView.ReadOnly := false;
FRVHtmlImporter.LoadHtml(Content.BodyExtended);
FFirstAdd := false;
FRichView.FormatTail;
ScanForURLS;
FRichView.FormatTail;
FRichView.ReadOnly := true;

I did modify the scanForUrls to work on just the recently added HTML, since scanning from the beginning of the document caused issues.
Post Reply