summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2006-09-19 20:01:16 +0000
committerSteve Northover <steve>2006-09-19 20:01:16 +0000
commit6afd0f7c847ebf7da61adbbd98eda015eb44fe3f (patch)
tree5b54eac7bb98bcb7f9caa461c48fe2a32984f353 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java
parent48cc0a268f324be7f04de1bf4769b6763dd5172e (diff)
downloadeclipse.platform.swt-6afd0f7c847ebf7da61adbbd98eda015eb44fe3f.tar.gz
eclipse.platform.swt-6afd0f7c847ebf7da61adbbd98eda015eb44fe3f.tar.xz
eclipse.platform.swt-6afd0f7c847ebf7da61adbbd98eda015eb44fe3f.zip
156675 - Repaint issue with radio buttons in preference page
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java50
1 files changed, 43 insertions, 7 deletions
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 fe7693bfcf..45c1ce73c6 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
@@ -372,13 +372,6 @@ LRESULT WM_PRINTCLIENT (int wParam, int lParam) {
return result;
}
-LRESULT WM_SIZE (int wParam, int lParam) {
- LRESULT result = super.WM_SIZE (wParam, lParam);
- if (OS.IsWinCE) return result;
- OS.InvalidateRect (handle, null, true);
- return result;
-}
-
LRESULT WM_UPDATEUISTATE (int wParam, int lParam) {
LRESULT result = super.WM_UPDATEUISTATE (wParam, lParam);
if (result != null) return result;
@@ -409,4 +402,47 @@ LRESULT WM_UPDATEUISTATE (int wParam, int lParam) {
}
return result;
}
+
+LRESULT WM_WINDOWPOSCHANGING (int wParam, int lParam) {
+ LRESULT result = super.WM_WINDOWPOSCHANGING (wParam, lParam);
+ if (result != null) return result;
+ /*
+ * Invalidate the portion of the group widget that needs to
+ * be redrawn. Note that for some reason, invalidating the
+ * group from inside WM_SIZE causes pixel corruption for
+ * radio button children.
+ */
+ if (OS.IsWinCE) return result;
+ if (!OS.IsWindowVisible (handle)) return result;
+ WINDOWPOS lpwp = new WINDOWPOS ();
+ OS.MoveMemory (lpwp, lParam, WINDOWPOS.sizeof);
+ if ((lpwp.flags & (OS.SWP_NOSIZE | OS.SWP_NOREDRAW)) != 0) {
+ return result;
+ }
+ RECT rect = new RECT ();
+ OS.SetRect (rect, 0, 0, lpwp.cx, lpwp.cy);
+ OS.SendMessage (handle, OS.WM_NCCALCSIZE, 0, rect);
+ int newWidth = rect.right - rect.left;
+ int newHeight = rect.bottom - rect.top;
+ OS.GetClientRect (handle, rect);
+ int oldWidth = rect.right - rect.left;
+ int oldHeight = rect.bottom - rect.top;
+ if (newWidth == oldWidth && newHeight == oldHeight) {
+ return result;
+ }
+ if (newWidth != oldWidth) {
+ int left = oldWidth;
+ if (newWidth < oldWidth) left = newWidth;
+ OS.SetRect (rect, left - CLIENT_INSET, 0, newWidth, newHeight);
+ OS.InvalidateRect (handle, rect, true);
+ }
+ if (newHeight != oldHeight) {
+ int bottom = oldHeight;
+ if (newHeight < oldHeight) bottom = newHeight;
+ if (newWidth < oldWidth) oldWidth -= CLIENT_INSET;
+ OS.SetRect (rect, 0, bottom - CLIENT_INSET, oldWidth, newHeight);
+ OS.InvalidateRect (handle, rect, true);
+ }
+ return result;
+}
}