How do I conditionally format a column of a virtual wxListCtrl? 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
katuday
Earned some good credits
Earned some good credits
Posts: 134
Joined: Fri Aug 17, 2012 2:22 am

How do I conditionally format a column of a virtual wxListCtrl?

Post by katuday »

My virtual wxListCtrl gets data from a backing store which a std::vector that I populate from a database.
I want to be able to conditionally format a column e.g. set the cell to green if the data value is 1 else set it to red.
How do I do this?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: How do I conditionally format a column of a virtual wxListCtrl?

Post by PB »

katuday
Earned some good credits
Earned some good credits
Posts: 134
Joined: Fri Aug 17, 2012 2:22 am

Re: How do I conditionally format a column of a virtual wxListCtrl?

Post by katuday »

PB wrote:Have you tried to override http://docs.wxwidgets.org/3.1.0/classwx ... 585d46a5e6?
I looked at it but couldn't figure out how to marshal the arguments to the function. For example I am not sure what the first argument ( long ) refers to.
The second argument makes sense but it is not sufficient to locate a specific cell.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How do I conditionally format a column of a virtual wxListCtrl?

Post by doublemax »

"item" = row number.

Beware that his works only under MSW like stated in the documentation.
Use the source, Luke!
Post Reply