Spinner and Text have a focus problem [message #123873] |
Fri, 06 March 2009 09:44  |
Eclipse User |
|
|
|
Hi,
I have the following Code:
Text a = new Text(parent, SWT.NONE);
a.addFocusListener(new FocusAdapter() {
public void focusLost(final FocusEvent event) {
System.out.println("Text.focusLost");
}
public void focusGained(final FocusEvent event) {
System.out.println("Text.focusGained");
}
});
Spinner s = new Spinner(parent, SWT.NONE);
s.addFocusListener(new FocusAdapter() {
public void focusLost(final FocusEvent event) {
System.out.println("Spinner.focusLost");
}
public void focusGained(final FocusEvent event) {
System.out.println("Spinner.focusGained");
}
});
Now there are two problems (maybe the same cause):
1. When I click in the text field, the "Text.focusGained" is printed, and if
I then click i.e. on a view tab, then "Text.focusLost" is printed, so
everything is fine.
Now when I click in the text field, the "Text.focusGained" is printed, and
if I then click in the Spinner, the no "Text.focusLost" is printed, so
focusLost is not called. After that, if I click on i.e. on a view tab, then
"Text.focusLost" is printed. So it seems to have something to do with the
Spinner.
2. The focus events of the Spinner are not called as no message from the
listener is printed.
Regards,
Markus
|
|
|
Re: Spinner and Text have a focus problem [message #123953 is a reply to message #123873] |
Mon, 09 March 2009 05:09   |
Eclipse User |
|
|
|
Hi Markus,
this looks like a bug. Could you file it in bugzilla?
Thank you!
Ralf
Markus Krüger wrote:
> Hi,
>
> I have the following Code:
>
> Text a = new Text(parent, SWT.NONE);
> a.addFocusListener(new FocusAdapter() {
> public void focusLost(final FocusEvent event) {
> System.out.println("Text.focusLost");
> }
>
> public void focusGained(final FocusEvent event) {
> System.out.println("Text.focusGained");
> }
> });
> Spinner s = new Spinner(parent, SWT.NONE);
> s.addFocusListener(new FocusAdapter() {
> public void focusLost(final FocusEvent event) {
> System.out.println("Spinner.focusLost");
> }
>
> public void focusGained(final FocusEvent event) {
> System.out.println("Spinner.focusGained");
> }
> });
>
> Now there are two problems (maybe the same cause):
> 1. When I click in the text field, the "Text.focusGained" is printed, and if
> I then click i.e. on a view tab, then "Text.focusLost" is printed, so
> everything is fine.
> Now when I click in the text field, the "Text.focusGained" is printed, and
> if I then click in the Spinner, the no "Text.focusLost" is printed, so
> focusLost is not called. After that, if I click on i.e. on a view tab, then
> "Text.focusLost" is printed. So it seems to have something to do with the
> Spinner.
> 2. The focus events of the Spinner are not called as no message from the
> listener is printed.
>
> Regards,
> Markus
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04200 seconds