Syntax highlight emulation.

General TRichView support forum. Please post your questions here
Post Reply
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Syntax highlight emulation.

Post by Denoson »

Is there any way for Syntax highlight emulation?
Scan RvData and change styles...
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you need a realtime syntax highlight?
See TSyntaxRichViewEdit on http://www.trichview.com/resources/ . It is quite a basic and slow component, so it can be used for very simple highligting in relatively small documents.

Or do you want to display a preformatted highlighting?
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

syntax highlight

Post by Denoson »

I know TSyntaxRichViewEdit but I don't need realtime syntax highlighting.
I want to create special button "Pascal highlight" or "HTML highlight" and reformat existing text (or selection).
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think the simplest way is to read the selected text, then to add it to a hidden RichView (using normal AddNL methods) using proper styles for keywords. Then save data to stream (SaveRVFToStream) and insert it back (InsertRVFFromStreamEd)
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Post by Denoson »

Thanks, I try to use this method.
Post Reply