Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2013-10-08 18:19:32 +0000
committerBogdan Gheorghe2013-10-08 18:19:32 +0000
commit3d7660d12b57efbf49e0dce8bf932fcbbf327686 (patch)
treeba442312a0596deb19e43678c6e6deb1aa06d9e5 /bundles
parent15a325747f844bbf135d7779e1715b870fd51bba (diff)
downloadeclipse.platform.swt-3d7660d12b57efbf49e0dce8bf932fcbbf327686.tar.gz
eclipse.platform.swt-3d7660d12b57efbf49e0dce8bf932fcbbf327686.tar.xz
eclipse.platform.swt-3d7660d12b57efbf49e0dce8bf932fcbbf327686.zip
Bug 336054 - Combo eats text on Enter
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java11
1 files changed, 10 insertions, 1 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 47ab420ea7..702463e489 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
@@ -2460,7 +2460,16 @@ LRESULT wmChar (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lParam) {
case SWT.CR:
if (!ignoreDefaultSelection) sendSelectionEvent (SWT.DefaultSelection);
ignoreDefaultSelection = false;
- // FALL THROUGH
+ // when no value is selected in the dropdown
+ if (getSelectionIndex() == -1) {
+ if ((style & SWT.DROP_DOWN) != 0 && (style & SWT.READ_ONLY) == 0) {
+ // close the dropdown if open
+ if (OS.SendMessage(handle, OS.CB_GETDROPPEDSTATE, 0, 0) != 0) {
+ OS.SendMessage(handle, OS.CB_SHOWDROPDOWN, 0, 0);
+ }
+ return LRESULT.ZERO;
+ }
+ }
case SWT.ESC:
if ((style & SWT.DROP_DOWN) != 0) {
if (OS.SendMessage (handle, OS.CB_GETDROPPEDSTATE, 0, 0) == 0) {

Back to the top