summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java10
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java28
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Label.java22
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java19
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java2
7 files changed, 47 insertions, 56 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
index 7c79d02540..426aebb481 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Button.java
@@ -880,6 +880,26 @@ LRESULT wmCommandChild (int wParam, int lParam) {
return super.wmCommandChild (wParam, lParam);
}
+LRESULT wmColorChild (int wParam, int lParam) {
+ LRESULT result = super.wmColorChild (wParam, lParam);
+ /*
+ * Feature in Windows. When WM_CTLCOLORBTN returns
+ * a NULL brush to indicate that the background should
+ * not be drawn, when the button has the BS_RADIOBUTTON
+ * style, it draws black. The fix is to draw the background
+ * in WM_CTLCOLORBTN.
+ */
+ if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
+ Control control = findThemeControl ();
+ if (control != null) {
+ RECT rect = new RECT ();
+ OS.GetClientRect (handle, rect);
+ control.drawThemeBackground (wParam, handle, rect);
+ }
+ }
+ return result;
+}
+
LRESULT wmDrawChild (int wParam, int lParam) {
if ((style & SWT.ARROW) == 0) return super.wmDrawChild (wParam, lParam);
DRAWITEMSTRUCT struct = new DRAWITEMSTRUCT ();
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 46e8c17ce5..fc011c9e81 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
@@ -3216,7 +3216,12 @@ LRESULT WM_ERASEBKGND (int wParam, int lParam) {
if ((state & TRANSPARENT) != 0) {
if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
Control control = findThemeControl ();
- if (control != null) return LRESULT.ONE;
+ if (control != null) {
+ RECT rect = new RECT ();
+ OS.GetClientRect (handle, rect);
+ control.drawThemeBackground (wParam, handle, rect);
+ return LRESULT.ONE;
+ }
}
}
return null;
@@ -3868,9 +3873,6 @@ LRESULT wmColorChild (int wParam, int lParam) {
OS.SetTextColor (wParam, forePixel);
OS.SetBkColor (wParam, backPixel);
if (control != null) {
- RECT rect = new RECT ();
- OS.GetClientRect (handle, rect);
- control.drawThemeBackground (wParam, handle, rect);
OS.SetBkMode (wParam, OS.TRANSPARENT);
return new LRESULT (OS.GetStockObject (OS.NULL_BRUSH));
}
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 1e9ac98058..4127a56f09 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
@@ -376,32 +376,4 @@ 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 3fb0eb85ae..01c3cb26b7 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,28 +429,6 @@ 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);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
index 498dbada6b..6ba233cccf 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scale.java
@@ -436,6 +436,25 @@ LRESULT WM_SIZE (int wParam, int lParam) {
return super.WM_SIZE (wParam, lParam);
}
+LRESULT wmColorChild (int wParam, int lParam) {
+ LRESULT result = super.wmColorChild (wParam, lParam);
+ /*
+ * Feature in Windows. When WM_CTLCOLORSTATIC returns
+ * a NULL brush to indicate that the background should
+ * not be drawn, the scale draws using a black background.
+ * The fix is to draw the background in WM_CTLCOLORSTATIC.
+ */
+ if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
+ Control control = findThemeControl ();
+ if (control != null) {
+ RECT rect = new RECT ();
+ OS.GetClientRect (handle, rect);
+ control.drawThemeBackground (wParam, handle, rect);
+ }
+ }
+ return result;
+}
+
LRESULT wmScrollChild (int wParam, int lParam) {
/* Do nothing when scrolling is ending */
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 a90eda404f..4e4b424538 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
@@ -551,7 +551,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
void createHandle () {
super.createHandle ();
- state &= ~CANVAS;
+ state &= ~(CANVAS | TRANSPARENT);
/*
* Feature in Windows. In version 5.8 of COMCTL32.DLL,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index a74b682617..fa178bf3ee 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -387,7 +387,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
void createHandle () {
super.createHandle ();
- state &= ~CANVAS;
+ state &= ~(CANVAS | TRANSPARENT);
/*
* Feature in Windows. In version 5.8 of COMCTL32.DLL,