trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[Demo] Chat codes
Goto page 1, 2  Next
 
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos
View previous topic :: View next topic  
Author Message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Tue Sep 06, 2005 5:40 pm    Post subject: [Demo] Chat codes Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Sep 07, 2005 3:46 am    Post subject: Reply with quote

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: 6599

PostPosted: Wed Sep 07, 2005 9:40 am    Post subject: Reply with quote

This demo already has a button (Button1) allowing choosing color from dialog
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Sep 07, 2005 3:59 pm    Post subject: Reply with quote

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: 6599

PostPosted: Fri Sep 09, 2005 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Guest






PostPosted: Sat Sep 10, 2005 5:56 pm    Post subject: Reply with quote

Ho i can do that. ?

add

\f"Times New Roman".
Back to top
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Sun Sep 11, 2005 7:00 pm    Post subject: Reply with quote

The new version with new \f"FONTNAME" command:
http://www.trichview.com/support/files/chatcodes2.zip
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Sep 13, 2005 7:46 pm    Post subject: Reply with quote

checking, the new demo.

Thanks.
Back to top
carpii



Joined: 24 Apr 2006
Posts: 2

PostPosted: Mon Apr 24, 2006 5:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Zepoux



Joined: 02 Jun 2006
Posts: 1

PostPosted: Fri Jun 02, 2006 4:27 pm    Post subject: Reply with quote

Hello all,

the same with IRC colors

Enjoy

http://f1lzr.free.fr/zip/ircColors.rar
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Thu Mar 13, 2008 11:55 am    Post subject: Reply with quote

http://www.trichview.com/support/files/chatcodes2.zip is updated, see the first post in this topic.
Back to top
View user's profile Send private message Visit poster's website
aussie



Joined: 08 May 2008
Posts: 5

PostPosted: Thu May 08, 2008 7:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Fri May 09, 2008 9:19 am    Post subject: Reply with quote

Sorry, I never worked with youtube video.
If you know a control that can play youtube video, you can insert it in TRichView.

I believe you can use Flash ActiveX, loading Chromeless Player in it. (apiplayer.SWF): http://code.google.com/apis/youtube/chromeless_player_reference.html#Overview
Back to top
View user's profile Send private message Visit poster's website
adrennan



Joined: 06 Jan 2006
Posts: 2

PostPosted: Wed Jun 03, 2009 5:23 pm    Post subject: This demo breaks with D2009 Reply with quote

This demo breaks with Delphi 2009. Specifically it looks like the AddStringWithURLs is doing math as 1 byte characters.
Back to top
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Tue Sep 15, 2009 7:27 pm    Post subject: Reply with quote

Sorry for late answer, but I cannot reproduce problems with Delphi 2009.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Examples, Demos All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group