wxListCtrl images

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
icStatic
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Sep 08, 2005 6:41 pm
Location: Coventry, UK
Contact:

wxListCtrl images

Post by icStatic » Sun Dec 11, 2005 5:36 pm

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

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Mon Dec 12, 2005 12:44 am

does setcolumnwidth help?

icStatic
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Sep 08, 2005 6:41 pm
Location: Coventry, UK
Contact:

Post by icStatic » Mon Dec 12, 2005 1:03 am

No, it didnt help :(

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Mon Dec 12, 2005 1:07 pm

Does calling Arrange works?

icStatic
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Sep 08, 2005 6:41 pm
Location: Coventry, UK
Contact:

Post by icStatic » Mon Dec 12, 2005 5:15 pm

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!

priyank_bolia
wxWorld Domination!
wxWorld Domination!
Posts: 1339
Joined: Wed Aug 03, 2005 8:10 am
Location: BANGALORE, INDIA
Contact:

Post by priyank_bolia » Tue Dec 13, 2005 6:37 am

Checked this: wxListCtrl::GetItemSpacing? May help!

icStatic
Earned a small fee
Earned a small fee
Posts: 12
Joined: Thu Sep 08, 2005 6:41 pm
Location: Coventry, UK
Contact:

Post by icStatic » Tue Dec 13, 2005 4:45 pm

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!

Post Reply