Bug 4621 - CCombo never fires keyboard events (1GB76BP)
Summary: CCombo never fires keyboard events (1GB76BP)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:20 EDT by Simon Arsenault CLA
Modified: 2005-04-12 16:12 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arsenault CLA 2001-10-11 14:20:05 EDT
I can register for keyboard events (CCombo::addKeyListener) but
	never get notified. I'm interested in getting the escape and enter
	key hits.

NOTES:
	CM (3/27/2001 4:39:13 PM)
		It is true that there are no keyboard events and no traversal events coming through at all.
		Here is some code that shows the problem:
[
import com.ibm.swt.*;
import com.ibm.swt.graphics.*;
import com.ibm.swt.widgets.*;
import com.ibm.swt.layout.*;
import com.ibm.swt.events.*;
import com.ibm.swt.custom.*;

public class CComboTest {
	static Shell shell;
	static CCombo combo;
	
	public static void main(String[] args) {
		Display display = new Display();
		shell = new Shell(display);
		shell.setLayout(new GridLayout());
		shell.setText("CCombo Selection Test");
		
		combo = new CCombo(shell, SWT.FLAT);
		combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		for (int i = 0; i < 5; i++) {
			combo.add("item" + i);
		}
		combo.setText("item0");

		combo.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				System.out.println(
					"Selected e.detail=" + e.detail +
					" e.doit=" + e.doit +
					" e.item=" + e.item);
			};
			public void widgetDefaultSelected(SelectionEvent e) {
				System.out.println(
					"DefaultSelected e.detail=" + e.detail +
					" e.doit=" + e.doit +
					" e.item=" + e.item);
			};
		});
		combo.addTraverseListener(new TraverseListener() {
			public void keyTraversed(TraverseEvent e) {
				System.out.println(
					"KeyTraversed e.detail=" + e.detail +
					" e.doit=" + e.doit +
					" e.keyCode=" + e.keyCode);
			}
		});

		shell.pack();
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) display.sleep();
		}
	}
}
]

	CM (3/27/2001 4:39:55 PM)
		I found a related bug in CCombo:
		- no selection event is generated when selection is made with arrow keys.

	McQ (26/06/2001 11:26:26 AM) -
		VI to retest.

VI (7/9/2001 11:56:20 AM)
	Outstanding differences between CCombo and Combo (R0.9):

	1) Arrow keys in list
			- on CCombo, you get the Selection event
			- on Combo you get a Traversal event and a Selection event (same as arrow keys in text field)
	2) Enter key in text field or list
			- on CCombo, you get no event
			- on Combo you get a DefaultSelection event
	3) PageUp and PageDown in text field or list
			- on CCombo, you get no event and nothing changes
			- on Combo you get a Selection event and the text field changes to the top/bottom list item
	
Aside, SWT.FLAT | SWT.BORDER should just draw a single line border around text field.
Comment 1 DJ Houghton CLA 2001-10-29 16:26:03 EST
PRODUCT VERSION:
	0.037

Comment 2 Veronika Irvine CLA 2002-05-15 15:08:09 EDT
The original issue has been solved, this PR is still open just to capture some 
minor outstanding issues.
Comment 3 Veronika Irvine CLA 2005-04-12 16:12:45 EDT
Issues have been resolved for a while now.