Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] CCombo - DefaultSelection


Combo and CCombo should behave the same in this respect.  I tried a test snippet (pasted below), and was able to activate the default button by pressing Enter in either of the controls.  Can you run the snippet and see what happens for you?

public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setLayout (new RowLayout ());
    Combo combo = new Combo (shell, SWT.NONE);
    combo.setText ("combo");
    CCombo ccombo = new CCombo (shell, SWT.BORDER);
    ccombo.setText("ccombo");
    Button button = new Button (shell, SWT.PUSH);
    button.setText ("Button");
    button.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            System.out.println("button selected");
        }
    });
    shell.setDefaultButton (button);
    shell.pack ();
    shell.open ();
    while (!shell.isDisposed ()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
}

Grant




Dante Brogno2000 <brogno2000@xxxxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

03/12/09 11:27 AM

Please respond to
"Eclipse Platform SWT component developers list."        <platform-swt-dev@xxxxxxxxxxx>

To
<platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] CCombo - DefaultSelection






Hi SWT masters,

I'm developing a RCP client.
In a wizard page, I use CCombo composite instead of Combo widget. Fine.
However, I get a minor problem with the DefaultSelection event (ENTER -SWT.CR- key down).

With the basic Combo widget, the SWT.CR key down event causes the Next Page "action".
With the Custom Combo, the SWT.CR does ... nothing :(

How can I get the same behavior ? Thanks in advance,

Brogno



check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top