Community
Participate
Working Groups
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.
PRODUCT VERSION: 0.037
The original issue has been solved, this PR is still open just to capture some minor outstanding issues.
Issues have been resolved for a while now.