Rich List Control? Topic is solved

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
miclus
Can't get richer than this
Can't get richer than this
Posts: 741
Joined: Tue Mar 31, 2009 2:11 am

Rich List Control?

Post by miclus » Fri Oct 02, 2009 5:45 am

Is there a way to put images or multiple colors in a wxListCtrl row? Or maybe there is some other type of list control that allows this. I've seen programs where they have what look like normal lists, but somehow different colors throughout a row, with icons also. I was wanting to do the same thing. Here is an example:

http://duke3d.org/example.png
Last edited by miclus on Fri Oct 02, 2009 5:57 am, edited 1 time in total.

van_user
Experienced Solver
Experienced Solver
Posts: 55
Joined: Wed Jun 11, 2008 9:28 pm
Location: UA

Post by van_user » Fri Oct 02, 2009 5:56 am

Take a look at wxDataViewCtrl and its simplified versions.
(Sorry for my English).

miclus
Can't get richer than this
Can't get richer than this
Posts: 741
Joined: Tue Mar 31, 2009 2:11 am

Post by miclus » Fri Oct 02, 2009 6:01 am

Hmmm. I talked to the author, and he said he draws them on there manually. For instance, the smiley face with shades is the code B}. He said the B} is actually in the list, but he makes it show a smiley face in its place. Anyone know how you can draw things like that on the screen? I mean, do I have to somehow get the coordinates of the text in the window and then put a smiley face on top of it? I don't get how that works.

miclus
Can't get richer than this
Can't get richer than this
Posts: 741
Joined: Tue Mar 31, 2009 2:11 am

Post by miclus » Fri Oct 02, 2009 6:08 am

Basically, my issue is that I can do these things with a chat box, using a wxRichTextCtrl. But, there doesn't seem to be an analogous wxRichListCtrl. So, it looks like this drawing manually is the only way. But, I don't know how it work, for instance, how to get the exact location to draw something, how it remains in place when the list changes size, screen is resized, etc.

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Fri Oct 02, 2009 6:36 am

I think the proper way to go is not looking for a rich list control, but for an owner drawn list control. It also means that you have to interpret the text yourself, and when it is a smiley figure, load it from a resource file/memory (look at portable pixmaps) and draw it on the canvas of the list control.

It is not so hard as it seems there are owner drawn examples in the wxWidgets library. It will also give you absolute freedom in what you can or cannot draw.

If you make it generic enough and use for example a semi-html syntax for your rich text listcrtrl, you could always contribute it back to wxWidgets I am sure a lot of people will appreciate that ..

With regards,
- jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

Post Reply