wxListCtrl and Vista Styles

BlitzMax Forums/Brucey's Modules/wxListCtrl and Vista Styles

Pete Rigz(Posted 2009) [#1]
Hello, I published my application using the Blide publisher which has the option to enable visual styles so that the app fits either winxp or vista gui styles. If I do this though large icons in list controls don't appear for some reason, the list box is just blank.

I have a feeling that this is just a wxWidgets problem but thought I'd post just in case.


ziggy(Posted 2009) [#2]
Enablig styles on the Publisher, you tell windows to use the latest windows forms controls version, instead of the 98-compatbiel default API versions. This is the only diference, so it seems that somehow the wxListCtrl does not handle well images depending on the underlying windows controls. Ayway, Brucey may have more infor on this?


Brucey(Posted 2009) [#3]
I don't know if it makes any difference if the wx.rc file is included?, and I don't know how you might include this as part of a build?

include/wx/msw/wx.rc

I'm certainly not an expert when it comes to Win32 things...


ziggy(Posted 2009) [#4]
wx.rc is not a pre-copiled resource file? Creating the corresponding .o file and including it should work but, if I'm not wrong, what it'll do is to add the maniffest file to the EXE, the same BLIde Plublisher does, so I'm 90% sure the issue is not related to this, unless the rc file really adds anything else apart from the maniffest and maybe an icon.
Maybe if you provide a bit of source code, we can give it a try? Maybe a small app replicating the issue?


Pete Rigz(Posted 2009) [#5]
Just tried publishing the sample listctrl that comes with wxwidgets and it seems ok, although the sample does have other issues - but its always been like that for me.

I'll have a play around and see if I can replicate the problem with a small smaple.


Brucey(Posted 2009) [#6]
although the sample does have other issues

What are those? (apart from perhaps being an incomplete implementation of the original C++ - which I put down to the tedium of porting C++ to BlitzMax :-p )


Pete Rigz(Posted 2009) [#7]
If you select icon view then the list view is still there, and you can't actually click on the large icons. Easier to show with a pic:




Brucey(Posted 2009) [#8]
That looks *really* ill...

This is an exe built on Vista, or does it happen to the exe if it is built on XP first?


Brucey(Posted 2009) [#9]
Can you try this listctrl_cpp_290.rar?

It's the C++ listctrl sample built from my latest static libraries on XP.

If anything is going to work properly, it should be this one.

Thanks.



Also.. maybe ziggy knows what this is doing (which it adds to the final exe :
windres --use-temp-file -ilisttest.rc -ogcc_mswu\listctrl_listtest_rc.o    --define __WXMSW__      --define _UNICODE  
--define wxUSE_GRAPHICS_CONTEXT=1 --include-dir .\..\..\lib\gcc_lib\mswu --include-dir ./../../include --include-dir .  
--include-dir ./../../samples --define NOPCH

...creating the resource stuff, I expect..

and the contents of that temp-file :
aaaa     ICON "mondrian.ico"
mondrian ICON "mondrian.ico"
#include "wx/msw/wx.rc"

icon1       ICON    "bitmaps/toolbrai.ico"
icon2       ICON    "bitmaps/toolchar.ico"
icon3       ICON    "bitmaps/toolchec.ico"
icon4       ICON    "bitmaps/tooldata.ico"
icon5       ICON    "bitmaps/toolgame.ico"
icon6       ICON    "bitmaps/toolnote.ico"
icon7       ICON    "bitmaps/tooltime.ico"
icon8       ICON    "bitmaps/tooltodo.ico"
icon9       ICON    "bitmaps/toolword.ico"

iconsmall   ICON    "bitmaps/small1.ico"

nothing very exciting there...

But I wonder if all this shouldn't be part of a wxMax build for Windows... or does it not really matter?


Pete Rigz(Posted 2009) [#10]
cool, I'll give it a go tomorrow and let you know.


ziggy(Posted 2009) [#11]
@Brucey: It is embeding the icons as EXE resources AFAIK, mondrian.ico is defined as the executable icon, while the others are just stored one after the other (for runtime referencing). I supose it is getting them at runtime to display them. It's strange it seems not to be adding also a manigest file. Do you have any xml file with the extension maniffest in the source code of the sample? If you do, can you add it to the wx.rc file and see if that changes anything? I can't remember wich has to be the index of the resource for embeded xml maniffest files, but I can take a look to it tomorrow at my house (I'm out for some days). It would be easier to track the issue if you import maxGUI also in a sample and see if it interfere, as maxGUI integrates its own .o resource file, so it may be 'hiding' the pre-built one in the sample. I would recommend to either include the propper manifest file in the sample, in the same resource compiled file, to avoid this problem, or to make the sample use incbined resources instead of embeded .o resources. Just my 2 cent... :)


Pete Rigz(Posted 2009) [#12]
Tried that cpp one and it worked fine. I use Vista btw.


Brucey(Posted 2009) [#13]
Tried that cpp one and it worked fine

Well... either that's unfortunate (because there's something else going on), or 2.9.0 has some fixes.

I assume all your tests until now have been with wxMax 2.8.x ?

Righty... here's the same sample but compiled with 2.8.9 : listctrl_cpp_289.rar.

See how you get on with that? :-)


Pete Rigz(Posted 2009) [#14]
that one works fine too.

My wx is 2.8.9 aswell I think, how can I double check? Pretty sure I SVN'd it when you upgraded it to that.


ziggy(Posted 2009) [#15]
@Brucey: I think I know what's happening here. The icon.o resource is replacing the listctrl_listtest_rc.o at link time, as EXEs on windows only support ONE accesible resource file embeded (remember the discussion on the dev team forum about embeding the manifest files in iverse order becouse of maxgui breaking some third party tools with Mark, Sebhol and I becouse of this exact problem some months ago, and how this was fixed)

This sample is not compatible with the BLIde Publisher, or any other publisher or module that integrates a resource file with icons and a manifest file.
I'm very sure you'll be able to replicate the issue by importing the XPmainfest.o file of the MaxGUI module (under maxgui.mod/win32maxguiexe.mod) in the sample. Doing this simple import will replicate the issue, if it is a problem with resource embeding (wich I'm 90% sure). If it does not replicate it, then it's time to look somewhere else! (you should import the XPmanifest file AFTER the module import!)