Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Focus in CCombo box
Focus in CCombo box [message #444126] Wed, 06 October 2004 21:43 Go to next message
Mike Tabb is currently offline Mike TabbFriend
Messages: 24
Registered: July 2009
Junior Member
When I tab through a composite and tab into a CCombo box , the cursor never
appears in the text , and therefore I can never leave. This poses an
accessibility issue for my application. To solve this I register a focus
listener on the box , and call setFocus() when the listener receives a focus
event , therefore forcing the text to get control. But this creates another
problem , because now it takes two clicks on the down arrow to show the
drop-down list. Has anyone seen this before?
Re: Focus in CCombo box [message #444133 is a reply to message #444126] Thu, 07 October 2004 12:47 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The following works for me. What platform are you running on and what style
do you use to create the CCombo?

public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
Button b = new Button(shell, SWT.PUSH);
b.setText("Button 1");
b = new Button(shell, SWT.PUSH);
b.setText("Button 2");
CCombo combo = new CCombo(shell, SWT.NONE);
for (int i = 0; i < 10; i++) {
combo.add("abc "+i);
}
b = new Button(shell, SWT.PUSH);
b.setText("Button 3");
shell.pack();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}


"Mike Tabb" <mtabb@us.ibm.com> wrote in message
news:ck1okg$pat$1@eclipse.org...
> When I tab through a composite and tab into a CCombo box , the cursor
> never
> appears in the text , and therefore I can never leave. This poses an
> accessibility issue for my application. To solve this I register a focus
> listener on the box , and call setFocus() when the listener receives a
> focus
> event , therefore forcing the text to get control. But this creates
> another
> problem , because now it takes two clicks on the down arrow to show the
> drop-down list. Has anyone seen this before?
>
>
Previous Topic:eclipse gui using swt/jface
Next Topic:cvs remove
Goto Forum:
  


Current Time: Fri Oct 30 05:40:25 GMT 2020

Powered by FUDForum. Page generated in 0.01480 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top