Richview autocorrect text smiley

General TRichView support forum. Please post your questions here
Post Reply
Timoncheg
Posts: 1
Joined: Sun Jul 27, 2014 4:58 am

Richview autocorrect text smiley

Post by Timoncheg »

Good day, dear. I wrote a chat. To display the new rows using Richview.

How to display this whole thing alone I understood, but I struggle with the problem AutoCorrect (in the help did not find anything worthwhile, in Google too). The task at first glance simple:

RichView1.AddNL (incoming messages, 0,0);
/ / Find a substring in this message '! Smile02' and replace the pattern of ImageBox.
RichView1.Format;

I ask your help, who can already faced.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Look at the demo: Demos\DelphiUnicode\Assorted\Graphics\Emoticons.
It shows 3 ways to replace strings with graphics:
- SearchText + InsertBullet. This method is not too useful for chats
- Parsing text string before adding to TRichView
- Detection on typing
The demo above can give an idea, but they are not universal (they can work only with codes :) :( :| )

The more advanced example is here: http://www.trichview.com/forums/viewtopic.php?t=63
It contains almost ready-to use code for adding chat text with URLs and smileys, a set of smiley codes and images is customizable.
The demo uses bitmaps, but it's simple to change them to animates gifs, for example.
Post Reply