summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-03-04 22:39:22 +0000
committerFelipe Heidrich <fheidric>2008-03-04 22:39:22 +0000
commitfdc9248d03d4b397469801ab1d72ab3da82e815a (patch)
treecf3cc10cda301fcefe8ebbfdaf6f66b2946a864f /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
parent111221191482e85565dbcf587e5be326f0d8ab8c (diff)
downloadeclipse.platform.swt-fdc9248d03d4b397469801ab1d72ab3da82e815a.tar.gz
eclipse.platform.swt-fdc9248d03d4b397469801ab1d72ab3da82e815a.tar.xz
eclipse.platform.swt-fdc9248d03d4b397469801ab1d72ab3da82e815a.zip
211885 - ScrolledComposite control's setOrigin method not the same as moving scroll bar on Windows
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
index b472a93e1f..ca30791845 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java
@@ -1214,6 +1214,43 @@ LRESULT WM_LBUTTONDOWN (int /*long*/ wParam, int /*long*/ lParam) {
return result;
}
+LRESULT WM_NCHITTEST (int /*long*/ wParam, int /*long*/ lParam) {
+ LRESULT result = super.WM_NCHITTEST (wParam, lParam);
+ if (result != null) return result;
+ /*
+ * Bug in Windows. For some reason, under circumstances
+ * that are not understood, when one scrolled window is
+ * embedded in another and the outer window scrolls the
+ * inner horizontally by moving the location of the inner
+ * one, the vertical scroll bars of the inner window no
+ * longer function. Specifically, WM_NCHITTEST returns
+ * HTCLIENT instead of HTVSCROLL. The fix is to detect
+ * the case where the result of WM_NCHITTEST is HTCLIENT
+ * and the point is not in the client area, and redraw
+ * the trim, which somehow fixes the next WM_NCHITTEST.
+ */
+ if (!OS.IsWinCE && OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
+ if ((state & CANVAS)!= 0) {
+ System.out.println("HI");
+ int /*long*/ code = callWindowProc (handle, OS.WM_NCHITTEST, wParam, lParam);
+ if (code == OS.HTCLIENT) {
+ RECT rect = new RECT ();
+ OS.GetClientRect (handle, rect);
+ POINT pt = new POINT ();
+ pt.x = OS.GET_X_LPARAM (lParam);
+ pt.y = OS.GET_Y_LPARAM (lParam);
+ OS.MapWindowPoints (0, handle, pt, 1);
+ if (!OS.PtInRect (rect, pt)) {
+ int flags = OS.RDW_FRAME | OS.RDW_INVALIDATE;
+ OS.RedrawWindow (handle, null, 0, flags);
+ }
+ }
+ return new LRESULT (code);
+ }
+ }
+ return result;
+}
+
LRESULT WM_PARENTNOTIFY (int /*long*/ wParam, int /*long*/ lParam) {
if ((state & CANVAS) != 0 && (style & SWT.EMBEDDED) != 0) {
if (OS.LOWORD (wParam) == OS.WM_CREATE) {