Community
Participate
Working Groups
Having a Table with SWT.CHECK Style, the Checkbox becomes invisible, when the TableItem is selected. This is happening on WinXP w/o using Manifest. It is not happening using the Manifest. Ben
Can you post a screen shot?
I am seeing this too, but i am running with the manifest. If i use the standard WinXP theme the problem goes away.
Created attachment 19574 [details] Table with check style
Apparently, the disappearing check box is related to the use of the ILC_COLOR32 flag for ImageList_Create (in Table.setCheckboxImageList) which does not seem to work as expected when visual styles are disabled. Before v3119, ILC_COLOR was used and that's when it last worked.
Good catch Florian! FH and SN to confirm that the style is causing the problem and fix the problem.
Ok, this WORKSFORME. Can you provide more information, specifically the version of XP, display resolution and graphics card? Thanks.
- Windows XP Professional, SP2 - COMCTL32.DLL product version=6.00.2900.2180 - ATI Radeon 8500 - Colour depth 32-bit - Windows Classic Theme - javaw.exe.manifest installed
(In reply to comment #4) > Apparently, the disappearing check box is related to the use of the > ILC_COLOR32 flag for ImageList_Create (in Table.setCheckboxImageList) > which does not seem to work as expected when visual styles are disabled. > Before v3119, ILC_COLOR was used and that's when it last worked. That wasn't all. We also removed the flag ILC_MASK from ImageList#COLOR_FLAGS (formely CREATE_FLAGS) and we replaced ImageList_AddMasked by ImageList_Add in Table.setCheckboxImageList. This changes were necessary to draw a xp themed checkbox correctly in Table and Tree (Does Tree work for you). You can try this patch: -------------cut here--------------don't include this line------------- Index: ImageList.java =================================================================== RCS file: /home/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ImageList.java,v retrieving revision 1.22 diff -u -r1.22 ImageList.java --- ImageList.java 30 Mar 2005 19:27:28 -0000 1.22 +++ ImageList.java 6 Apr 2005 16:41:48 -0000 @@ -24,7 +24,7 @@ COLOR_FLAGS = OS.ILC_COLOR; } else { int flags = 0; - if (OS.COMCTL32_MAJOR >= 6) { + if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed()) { flags |= OS.ILC_COLOR32; } else { int hDC = OS.GetDC (0); -------------cut here--------------don't include this line------------- Or this other one: -------------cut here--------------don't include this line------------- Index: Table.java =================================================================== RCS file: /home/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java,v retrieving revision 1.199 diff -u -r1.199 Table.java --- Table.java 28 Mar 2005 20:29:44 -0000 1.199 +++ Table.java 6 Apr 2005 16:45:13 -0000 @@ -2203,7 +2203,7 @@ void setCheckboxImageList (int width, int height) { if ((style & SWT.CHECK) == 0) return; int count = 4; - int flags = ImageList.COLOR_FLAGS; + int flags = ImageList.COLOR_FLAGS | OS.ILC_MASK; if ((style & SWT.RIGHT_TO_LEFT) != 0) flags |= OS.ILC_MIRROR; int hImageList = OS.ImageList_Create (width, height, flags, count, count); int hDC = OS.GetDC (handle); @@ -2245,7 +2245,7 @@ OS.SelectObject (memDC, hOldBitmap); OS.DeleteDC (memDC); OS.ReleaseDC (handle, hDC); - OS.ImageList_Add (hImageList, hBitmap, 0); + OS.ImageList_AddMasked (hImageList, hBitmap, 0); OS.DeleteObject (hBitmap); int hOldStateList = OS.SendMessage (handle, OS.LVM_GETIMAGELIST, OS.LVSIL_STATE, 0); OS.SendMessage (handle, OS.LVM_SETIMAGELIST, OS.LVSIL_STATE, hImageList); -------------cut here--------------don't include this line-------------
(In reply to comment #8) > (In reply to comment #4) > > Apparently, the disappearing check box is related to the use of the > > ILC_COLOR32 flag for ImageList_Create (in Table.setCheckboxImageList) > > which does not seem to work as expected when visual styles are disabled. > > Before v3119, ILC_COLOR was used and that's when it last worked. > > That wasn't all. We also removed the flag ILC_MASK from ImageList#COLOR_FLAGS > (formely CREATE_FLAGS) and we replaced ImageList_AddMasked by ImageList_Add in > Table.setCheckboxImageList. Yes, I noticed that there had been several changes but I tried to narrow it down to the one that made the difference between a visible check box and an invisible one. On my system, that was ILC_COLOR (Table v1.168) vs. ILC_COLOR32 (later versions). Or rather, ILC_COLOR vs. ImageList.COLOR_FLAGS which for me evaluated to ILC_COLOR32. > You can try this patch: > Index: ImageList.java > + if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed()) { Actually, that is something I had already tried before posting comment #4. However, it does not fix the problem. The reason for that is that using OS.GetDeviceCaps (in the 'else' branch) results in the exact same value (ILC_COLOR32). > Or this other one: > Index: Table.java > + int flags = ImageList.COLOR_FLAGS | OS.ILC_MASK; That's better. With that line, the check box is visible again... > + OS.ImageList_AddMasked (hImageList, hBitmap, 0); ...until this line is added. Now *all* check boxes have disappeared.
(In reply to comment #8) > (Does Tree work for you) Judging from a quick test with Eclipse 3.1M6: Yes.
Created attachment 19673 [details] Workaround How about applying this patch until/unless a better solution is found?
Pinging this bug report since it's still a regression and M7 is getting nearer. I believe that the patch provided in comment #11 will be enough to fix the problem. It restores the use of ILC_COLOR for unthemed clients while keeping ImageList.COLOR_FLAGS for all others. I have verified this to work on my machine for all four combinations of (Classic Theme|XP Theme) and (with manifest|without manifest). If you can think of a better approach then that's great but either way, please bring the check boxes back.
Right, FH and SN to get to the bottom of this. FH, were you ever able to recreate this?
Ok, I can make it happen.
FYI: Doesn't happen for Tree.
Ok, I have a fix. FH to check the code.
Fixed > 20050503 Thanks for pinging me on this very important bug. Thanks also Florian for your good work and interest in this area.