Make a list view highlight truecolour (win32 or wxWidgets) [SOLVED]

Started by
12 comments, last by Andrew Russell 18 years, 9 months ago
OK, after going through it in the debugger, both calls to ImageList_Create are exactly the same - including what depth they are created at.

I also tried using the same images to create the icons - with the same result - the old one worked, the new one didn't.
Advertisement
I did the same thing for the creation of the list view itself. The values were the same here between the working and non-working version (except I didn't check "parent", "child id" or "app instance").

    m_hWnd = (WXHWND)::CreateWindowEx                       (                        exstyle,            // extended style                        classname,          // the kind of control to create                        label,              // the window name                        style,              // the window style                        x, y, w, h,         // the window position and size                        GetHwndOf(GetParent()),  // parent                        (HMENU)GetId(),     // child id                        wxGetInstance(),    // app instance                        NULL                // creation parameters                       );
One problem may be due to the ILC_COLORxx flags passed to the image list creation function. My Win32 API documentation has this to say:

Quote:HIMAGELIST ImageList_Create(int cx, int cy, UINT flags, int cInitial, int cGrow);

Parameters

cx : Specifies the width, in pixels, of each image.

cy : Specifies the height, in pixels, of each image.

flags : A set of bit flags that specify the type of image list to create. This
parameter can be a combination of the following values, but it can include
only one of the ILC_COLOR values.

Value Meaning
ILC_COLOR Use the default behavior if none of the other ILC_COLOR* flags
is specified. Typically, the default is ILC_COLOR4; but for
older display drivers, the default is ILC_COLORDDB.
ILC_COLOR4 Use a 4-bit (16 color) device-independent bitmap (DIB) section as the bitmap for the image list.
ILC_COLOR8 Use an 8-bit DIB section. The colors used for the color table are the same colors as the halftone palette.
ILC_COLOR16 Use a 16-bit (32/64k color) DIB section.
ILC_COLOR24 Use a 24-bit DIB section.
ILC_COLOR32 Use a 32-bit DIB section.
ILC_COLORDDB Use a device-dependent bitmap.
ILC_MASK Uses a mask. The image list contains two bitmaps, one of which
is a monochrome bitmap used as a mask. If this value is not
included, the image list contains only one bitmap.

cInitial : Number of images that the image list initially contains.

cGrow : Amount of images by which the image list can grow when the system needs
to resize the list to make room for new images. This parameter represents
the number of new images that the resized image list can contain.



So it seems you can and can't use the flags in combination? I've always assumed that they mean one ILC_COLORxx value and optionally the ILC_MASK value. I usually just stick with one flag (16bits or more), and get the effects you desire. I think that if you create a list with less than 15/16bit color, you won't get the nice blended effect you're after.

arm.

EDIT: Edited for clarity.
[SOLVED]

OK, I was just told the solution. Apparantly I needed an "XP styles manifest" in my resources. This quickly identified the difference between the two projects - the new, broken one didn't have any resource file at all.

The solution was to add one which contained the following include:
#include "wx/msw/wx.rc"
Talk about being obscure.

Thanks everyone for your help [smile]

This topic is closed to new replies.

Advertisement