diff options
author | Steve Northover <steve> | 2006-02-13 17:33:14 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2006-02-13 17:33:14 +0000 |
commit | 6a8f64aba74c6fc7a655a14fc7ca54a1aef70af2 (patch) | |
tree | d0cf72861a799089c6aafe8f53ee4a3e7b2b380c /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java | |
parent | f5a0d3582f75308849543d0ff0517400d5971efe (diff) | |
download | eclipse.platform.swt-6a8f64aba74c6fc7a655a14fc7ca54a1aef70af2.tar.gz eclipse.platform.swt-6a8f64aba74c6fc7a655a14fc7ca54a1aef70af2.tar.xz eclipse.platform.swt-6a8f64aba74c6fc7a655a14fc7ca54a1aef70af2.zip |
clear full row selection when custom draw (temporary code to avoid cheese)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java index 5a56761aba..31a39853b1 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java @@ -2553,17 +2553,6 @@ LRESULT sendMouseDownEvent (int type, int button, int msg, int wParam, int lPara void setBackgroundImage (int hBitmap) { setBackgroundTransparent (hBitmap != 0); - if (hBitmap != 0) { - if ((style & SWT.FULL_SELECTION) != 0) { - int bits = OS.LVS_EX_FULLROWSELECT; - OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, 0); - } - } else { - if ((style & SWT.FULL_SELECTION) != 0) { - int bits = OS.LVS_EX_FULLROWSELECT; - OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, bits); - } - } } void setBackgroundPixel (int newPixel) { @@ -2584,17 +2573,30 @@ void setBackgroundPixel (int newPixel) { } void setBackgroundTransparent (boolean transparent) { + /* + * Bug in Windows. When the table has the extended style + * LVS_EX_FULLROWSELECT and LVM_SETBKCOLOR is used with + * CLR_NONE to make the table transparent, Windows draws + * a black rectangle around the first column. The fix is + * to set and clear LVS_EX_FULLROWSELECT. + */ int oldPixel = OS.SendMessage (handle, OS.LVM_GETBKCOLOR, 0, 0); if (transparent) { if (oldPixel != OS.CLR_NONE) { - OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE); - OS.SendMessage (handle, OS.LVM_SETTEXTBKCOLOR, 0, OS.CLR_NONE); /* * Feature in Windows. When the background color is changed, * the table does not redraw until the next WM_PAINT. The fix * is to force a redraw. */ + OS.SendMessage (handle, OS.LVM_SETBKCOLOR, 0, OS.CLR_NONE); + OS.SendMessage (handle, OS.LVM_SETTEXTBKCOLOR, 0, OS.CLR_NONE); OS.InvalidateRect (handle, null, true); + + /* Clear LVS_EX_FULLROWSELECT */ + if ((style & SWT.FULL_SELECTION) != 0) { + int bits = OS.LVS_EX_FULLROWSELECT; + OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, 0); + } } } else { if (oldPixel == OS.CLR_NONE) { @@ -2603,6 +2605,14 @@ void setBackgroundTransparent (boolean transparent) { if (control.backgroundImage == null) { setBackgroundPixel (control.getBackgroundPixel ()); } + + /* Set LVS_EX_FULLROWSELECT */ + if ((style & SWT.FULL_SELECTION) != 0) { + if (!hooks (SWT.EraseItem) && !hooks (SWT.PaintItem)) { + int bits = OS.LVS_EX_FULLROWSELECT; + OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits, bits); + } + } } } } |