diff options
author | Niraj Modi | 2021-09-09 09:42:16 +0000 |
---|---|---|
committer | Niraj Modi | 2021-09-09 10:10:17 +0000 |
commit | a6b4b96cf8a8212e3b03c03622540806e105581e (patch) | |
tree | 2cb37b17e1bfdfccd38f2061e4f987c5d366c00c | |
parent | 5a84b03474c8069ced9faed0be467aa755a88c2f (diff) | |
download | eclipse.platform.swt-a6b4b96cf8a8212e3b03c03622540806e105581e.tar.gz eclipse.platform.swt-a6b4b96cf8a8212e3b03c03622540806e105581e.tar.xz eclipse.platform.swt-a6b4b96cf8a8212e3b03c03622540806e105581e.zip |
Bug 575171 - [Win32][Combo] Cursor is not at the end of the path for
AUTO_TEXT_DIRECTION
Change-Id: If5aaf0c060752c9ebd0c9106ed618a44ba4165bb
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/185204
Tested-by: Platform Bot <platform-bot@eclipse.org>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java index a42e0dea8f..4d5cb5c78d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2019 IBM Corporation and others. + * Copyright (c) 2000, 2021 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -2699,6 +2699,13 @@ long windowProc (long hwnd, int msg, long wParam, long lParam) { if (redraw) { OS.DefWindowProc (hwndText, OS.WM_SETREDRAW, 1, 0); OS.InvalidateRect (hwndText, null, true); + /* + * When setting longer text on AUTO_TEXT_DIRECTION styled Combo orientation: + * Combo should automatically scrolls selection's end into view. We need to + * force it to do such scrolling, to make sure Caret no longer goes out of view. + * For more details refer bug 575171. + */ + forceScrollingToCaret(); } return code; } @@ -2962,6 +2969,12 @@ LRESULT WM_SIZE (long wParam, long lParam) { * This is just another form of problem 1. * 3) Caret no longer goes out of view when shrinking control. */ + forceScrollingToCaret(); + + return result; +} + +void forceScrollingToCaret() { if ((style & SWT.READ_ONLY) == 0) { Point oldSelection = this.getSelection(); Point tmpSelection = new Point(0, 0); @@ -2970,8 +2983,6 @@ LRESULT WM_SIZE (long wParam, long lParam) { this.setSelection(oldSelection); } } - - return result; } @Override |