On Tue, 21 Sep 2021 15:35:42 +0200 Andreas Falkenhahn wrote:
AF> I have a wxListView with 7 columns. The second column contains text,
AF> all the other columns contain a 24x24 icon. Sometimes, however, I don't
AF> want the icon to be shown. Instead, the column should be empty. I'm
AF> having some difficulties getting this to work correctly because it
AF> looks like empty columns are automatically hidden.
I don't think this is correct, perhaps they're just auto-sized to 0?
If they really are hidden, I'd like to know how can this be reproduced
in the listctrl sample.
AF> I've tried the following to solve this issue:
AF>
AF> 1) Create a dummy 24x24 icon which is completely transparent. This
AF> doesn't work. For some reason, completely transparent icons are drawn
AF> as a 24x24 black rectangle. See shot1.png. I don't actually understand
AF> why this happens and this looks like a bug to me.
wxMSW doesn't support transparency except in a few well-defined places, so
I wouldn't be very surprised by this...
AF> 2) As a test to see why 1) doesn't work, I've made a single pixel
AF> visible in the 24x24 icon. Now it suddenly works correctly but of
AF> course it looks ugly because there's a random pixel now in the top-left
AF> corner of the column. See shot2.png.
... if this didn't happen. I admit I have no explanation about why does
transparency work with one not fully transparent pixel but not with all of
them being transparent, sorry.
AF> 3) Make the whole 24x24 icon opaque and white. This solves the problem
AF> but of course this won't look correctly if the listview's background
AF> colour isn't white.
Yes, this is what I would have done, except I'd use the current background
colour to create this icon dynamically.
AF> Still, it's hackish so I'm wondering if there's a nicer solution. Any
AF> ideas?
I don't think the empty column should be hidden at all. If it is,
hopefully this can be fixed, but first this would need to be reproduced.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/