how would I diplay small emoticons in a wxTreeCtrl item???

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
zlly20
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Dec 22, 2005 6:25 am

how would I diplay small emoticons in a wxTreeCtrl item???

Post by zlly20 »

just like msn messenger contact list that, each item in the list is your contact whose personalized name may contains emoticons such as :lol:

how would I achieve this using wxTreeCtrl???
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Build an image list (wxTreeCtrl::AssignImageList), and call wxTreeCtrl::SetItemImage on the item with the index of the image to use.
zlly20
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Dec 22, 2005 6:25 am

Post by zlly20 »

I think you misunderstand what I meant and sorry for the ambiguity..

what I meant is that encode the emoticons or smiley in to the name of your contact.

how to upload an image in this forum, a screenshot could explain better...
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

are you saying something like:

contact :) name

???

so that the emoticon appears inside the name, and not as the tree image?
zlly20
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Dec 22, 2005 6:25 am

Post by zlly20 »

yes.... you got it now.... :D
Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor »

You cant do it directly, you calculate imoticon place in the wxTreeCtrl and manually place corresponding wxStaticImage (or other) on it.
What is little and green, witch go up and down ??
Yoda playing with the force.
zlly20
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Dec 22, 2005 6:25 am

Post by zlly20 »

"manually place corresponding wxStaticImage (or other) on it"

Could you explain how exactly would I do this??? and what do you mean by "manually place" ???

Thanks
Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor »

You can use wxStaticBitmap as treectrl child to show the imoticon, you just have to place it.

You can retrieve the text coordinates of an item with wxTreeCtrl::GetBoundingRect [1].
You can calculate position of you imoticon in your text with wxDC::GetTextExtent [2] (you can set the item font to the wxDC with wxTreeCtrl::GetItemFont [3]).


[1] : http://www.wxwidgets.org/manuals/2.6.3/ ... etitemrect
[2] : http://www.wxwidgets.org/manuals/2.6.3/ ... textextent
[3] : http://www.wxwidgets.org/manuals/2.6.3/ ... etitemfont
What is little and green, witch go up and down ??
Yoda playing with the force.
zlly20
Knows some wx things
Knows some wx things
Posts: 36
Joined: Thu Dec 22, 2005 6:25 am

Post by zlly20 »

thanks, I will try that....
Post Reply