| View previous topic :: View next topic |
| Author |
Message |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Tue Sep 06, 2005 5:40 pm Post subject: [Demo] Chat codes |
|
|
1. Simple demo
http://www.trichview.com/support/files/chatcodes.zip (for Delphi)
This demo shows how to add text with some codes:
\b - bold on/off
\i - italic on/off
\u - underline on/off
\cRRGGBB - text color
\kRRGGBB - text background color
2. Advanced demo with plain text input
http://www.trichview.com/support/files/chatcodes2.zip (for Delphi)
This demo has almost complete ready-to-use chat window functionality.
In addition to the demo above, it supports the commands:
\f"FONTNAME" - changes font name
\sNN - changes font size to NN points (it's also possible to use one digit \sN followed by non-digit character; if this character is a space, it is not displayed)
This demo supports:
- Emoticons. They can be easily customized, just modify CreateEmoticons procedure. In this demo, bitmaps are used, but you can easily change them to animated gifs.
- URL detection
- message preview as you type.
3. Advanced demo with rich text text input
http://www.trichview.com/support/files/chatcodeswysiwyg.zip (for Delphi)
This demo uses the same commands as the demo above, but the message is typed in TRichViewEdit instead of TEdit.
The demo converts the message to a string (using the codes described above), then this string is parsed and added to the chat window.
History
2008-Dec-11: correction for Delphi 2009
2009-Jun-8: correction for Delphi 2009
2010-Apr-15: the third demo
See also:
- Contact list demo http://www.trichview.com/forums/viewtopic.php?p=12608
Last edited by Sergey Tkachenko on Thu Apr 15, 2010 12:17 pm; edited 7 times in total |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Sep 07, 2005 3:46 am Post subject: |
|
|
so good example.
i can make work with the component TFont dialog
How i can make work like in the demo using the color dialog.?
Thanks |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Wed Sep 07, 2005 9:40 am Post subject: |
|
|
| This demo already has a button (Button1) allowing choosing color from dialog |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Sep 07, 2005 3:59 pm Post subject: |
|
|
yes i know.
but i want use the FontDialog. at the same way that in the
demo is using the color dialog
then a button to chose the font, the color., and size.
using the FontDialog.
thanks. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Fri Sep 09, 2005 6:18 pm Post subject: |
|
|
I do not think that using font dialog is a good idea.
Ok, it's possible to add a chat code like \f"Times New Roman".
But there are on/off switches like \b, so font depends on commands which were added in the string before this place. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Sep 10, 2005 5:56 pm Post subject: |
|
|
Ho i can do that. ?
add
\f"Times New Roman". |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
|
| Back to top |
|
 |
Guest
|
Posted: Tue Sep 13, 2005 7:46 pm Post subject: |
|
|
checking, the new demo.
Thanks. |
|
| Back to top |
|
 |
carpii
Joined: 24 Apr 2006 Posts: 2
|
Posted: Mon Apr 24, 2006 5:49 pm Post subject: |
|
|
Thanks Sergey, this is very useful and saved me a lot of time learning how the styles work. I will be purchasing soemtime soon, so thankyou again for this example.
Carpii |
|
| Back to top |
|
 |
Zepoux
Joined: 02 Jun 2006 Posts: 1
|
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
|
| Back to top |
|
 |
aussie
Joined: 08 May 2008 Posts: 5
|
Posted: Thu May 08, 2008 7:45 pm Post subject: |
|
|
| dear sergey is there any way to view youtube video in this chat windows when someone put the link ? if yes could you make a sample ? tx |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
|
| Back to top |
|
 |
adrennan
Joined: 06 Jan 2006 Posts: 2
|
Posted: Wed Jun 03, 2009 5:23 pm Post subject: This demo breaks with D2009 |
|
|
| This demo breaks with Delphi 2009. Specifically it looks like the AddStringWithURLs is doing math as 1 byte characters. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6576
|
Posted: Tue Sep 15, 2009 7:27 pm Post subject: |
|
|
| Sorry for late answer, but I cannot reproduce problems with Delphi 2009. |
|
| Back to top |
|
 |
|