Page 1 of 1

wxListCtrl images

Posted: Sun Dec 11, 2005 5:36 pm
by icStatic
Hi,

I am developing an application using wxListCtrl with non default sized images. When switching minor versions of wxWidgets it stopped doing what I wanted it to do, which is display two columns of images, not just one.

Here is what i want it to look like (from an older version of the app):
http://icstatic.uwcs.co.uk/icLogic22.PNG
This is what it looks like now:
http://icstatic.uwcs.co.uk/wxListCtrl1.PNG

It also looks like this when using wxGTK (before and after version change):
http://icstatic.uwcs.co.uk/icLogicLinux.png

The bit you are looking at is the 'Component Palette' on the right hand side.

Any ideas how to get it working like in the first screenshot on both windows and on linux?

Thanks in advance,

Ian

Posted: Mon Dec 12, 2005 12:44 am
by lowjoel
does setcolumnwidth help?

Posted: Mon Dec 12, 2005 1:03 am
by icStatic
No, it didnt help :(

Posted: Mon Dec 12, 2005 1:07 pm
by priyank_bolia
Does calling Arrange works?

Posted: Mon Dec 12, 2005 5:15 pm
by icStatic
priyank_bolia, thanks, it helped. I say helped, because it now aligns correctly when i call Arrange with wxLIST_ALIGN_TOP, however to get it to work I had to double the amount of space it had, and it's now taking up too much space.

The minimum width I had to set the housing notebook to was 252. On 2.6.1, the width used to be 128. The images in the list are 69x38 so ideally the panel should be 69*2 + 3*10 padding + 20 scrollbar (random numbers off the top of my head) so at most the whole control should be about 200 pixels wide. I'm not entirely sure where 252 is coming from... Is there some kind of item padding that i've missed?

This is what the control looks like now:
http://icstatic.uwcs.co.uk/wxListCtrl2.PNG

Has anybody got any ideas how to get the control looking even remotely right under GTK?

I'm toying with the idea of making a custom control to draw the items but it seems like an awful lot of work when something which nearly works exists!

Posted: Tue Dec 13, 2005 6:37 am
by priyank_bolia
Checked this: wxListCtrl::GetItemSpacing? May help!

Posted: Tue Dec 13, 2005 4:45 pm
by icStatic
GetItemSpacing was deemed deprecated it seems! I ran it anyway but it gave me an integer value of 5898361. I'm assuming this means its no longer used and hence the value is not being set!