diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
3 files changed, 57 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java index cb2f5c093c..46e8c17ce5 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java @@ -3115,6 +3115,7 @@ int windowProc (int hwnd, int msg, int wParam, int lParam) { case OS.WM_SYSKEYUP: result = WM_SYSKEYUP (wParam, lParam); break; case OS.WM_TIMER: result = WM_TIMER (wParam, lParam); break; case OS.WM_UNDO: result = WM_UNDO (wParam, lParam); break; + case OS.WM_UPDATEUISTATE: result = WM_UPDATEUISTATE (wParam, lParam); break; case OS.WM_VSCROLL: result = WM_VSCROLL (wParam, lParam); break; case OS.WM_WINDOWPOSCHANGED: result = WM_WINDOWPOSCHANGED (wParam, lParam); break; case OS.WM_WINDOWPOSCHANGING: result = WM_WINDOWPOSCHANGING (wParam, lParam); break; @@ -3800,6 +3801,10 @@ LRESULT WM_UNDO (int wParam, int lParam) { return null; } +LRESULT WM_UPDATEUISTATE (int wParam, int lParam) { + return null; +} + LRESULT WM_VSCROLL (int wParam, int lParam) { if (lParam == 0) return null; Control control = display.getControl (lParam); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java index c53f54bbc5..1e9ac98058 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java @@ -47,8 +47,7 @@ public class Group extends Composite { * force a full redraw of the control and all children * when resized. This causes flashing. The fix is to * register a new window class without these bits and - * implement special code that damages only the exposed - * area. + * implement special code that damages only the control. * * Feature in WinCE. On certain devices, defining * a new window class which looks like BUTTON causes @@ -316,7 +315,7 @@ LRESULT WM_ERASEBKGND (int wParam, int lParam) { return result; } drawBackground (wParam); - return result; + return LRESULT.ONE; } LRESULT WM_NCHITTEST (int wParam, int lParam) { @@ -377,4 +376,32 @@ LRESULT WM_SIZE (int wParam, int lParam) { return result; } +LRESULT WM_UPDATEUISTATE (int wParam, int lParam) { + LRESULT result = super.WM_UPDATEUISTATE (wParam, lParam); + if (result != null) return result; + /* + * Feature in Windows. When WM_UPDATEUISTATE is sent to + * a group, it sends WM_CTLCOLORBTNto get the foreground + * and background. If drawing happens in WM_CTLCOLORBTN, + * it will overwrite the contents of the control. The + * fix is draw the group without drawing the background + * and avoid the group window proc. + * + * NOTE: The DefWindowProc() must be called in order to + * broadcast WM_UPDATEUISTATE message to the children. + * + */ + if ((state & TRANSPARENT) != 0) { + if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) { + Control control = findThemeControl (); + if (control != null) { + OS.InvalidateRect (handle, null, false); + int code = OS.DefWindowProc (handle, OS.WM_UPDATEUISTATE, wParam, lParam); + return new LRESULT (code); + } + } + } + return result; +} + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java index 01c3cb26b7..3fb0eb85ae 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java @@ -429,6 +429,28 @@ LRESULT WM_SIZE (int wParam, int lParam) { return result; } +LRESULT WM_UPDATEUISTATE (int wParam, int lParam) { + LRESULT result = super.WM_UPDATEUISTATE (wParam, lParam); + /* + * Feature in Windows. When WM_UPDATEUISTATE is sent to + * a static control, it sends WM_CTLCOLORSTATIC to get the + * foreground and background. If any drawing happens in + * WM_CTLCOLORBTN, it overwrites the contents of the control. + * The fix is draw the static without drawing the background + * and avoid the group window proc. + */ + if ((state & TRANSPARENT) != 0) { + if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) { + Control control = findThemeControl (); + if (control != null) { + OS.InvalidateRect (handle, null, false); + return LRESULT.ZERO; + } + } + } + return result; +} + LRESULT wmDrawChild (int wParam, int lParam) { DRAWITEMSTRUCT struct = new DRAWITEMSTRUCT (); OS.MoveMemory (struct, lParam, DRAWITEMSTRUCT.sizeof); |