Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Event at org.eclipse.swt.widgets.Combo
Event at org.eclipse.swt.widgets.Combo [message #501914] Fri, 04 December 2009 08:07 Go to next message
Eclipse UserFriend
Hello,

which Listener and Event is suitable to catch

a) a direct left mouse click in the Combo box field (not a click to select
an entry somewhere in its dropdown list, when opened)
b) pressing [Enter]

to select the value, entered, in the "text field" area of the Combo box
(org.eclipse.swt.widgets.Combo)?

To explain:
The usual SelectionListener catches the event after selecting an entry in
the dropdown list of the combo. I'm searching for the listener to track the
events, mentioned above.

Thomas Wiedmann
Re: Event at org.eclipse.swt.widgets.Combo [message #501949 is a reply to message #501914] Fri, 04 December 2009 09:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Thomas,

You can detect Enter keypresses by listening for DefaultSelection.

The behaviour of listening for MouseDown seems to vary across the platforms.
On win32 you only receive this when clicking in the Combo's text field, but
on gtk you also get it when clicking in the drop-down list. What are you
trying to do by listening for this event? If it's to detect when focus goes
to the Combo, maybe listening for FocusIn would be better? Or is there
another reason?

Grant


"Thomas Wiedmann" <th.wm@gmx.de> wrote in message
news:hfb1i0$flq$1@build.eclipse.org...
> Hello,
>
> which Listener and Event is suitable to catch
>
> a) a direct left mouse click in the Combo box field (not a click to select
> an entry somewhere in its dropdown list, when opened)
> b) pressing [Enter]
>
> to select the value, entered, in the "text field" area of the Combo box
> (org.eclipse.swt.widgets.Combo)?
>
> To explain:
> The usual SelectionListener catches the event after selecting an entry in
> the dropdown list of the combo. I'm searching for the listener to track
the
> events, mentioned above.
>
> Thomas Wiedmann
>
Re: Event at org.eclipse.swt.widgets.Combo [message #502050 is a reply to message #501949] Fri, 04 December 2009 17:43 Go to previous messageGo to next message
Eclipse UserFriend
> What are you trying to do by listening for this event?
e. g. text is entered into the Combo box field or selected in the dropdown
list and confirmed afterwards by clicking or pressing [Enter].

> If it's to detect when focus goes to the Combo, maybe listening for
> FocusIn would be better?
No, because the event should be triggered only after confirming text entered
or selected.

Thomas Wiedmann
Re: Event at org.eclipse.swt.widgets.Combo [message #502432 is a reply to message #502050] Tue, 08 December 2009 03:20 Go to previous message
Eclipse UserFriend
> e. g. text is entered into the Combo box field or selected in the
> dropdown list and confirmed afterwards by clicking or pressing [Enter].

If you are looking to catch the selection of an item from dropdown list,
then you can go for 'Selection' event.
And for pressing Enter, as said by Grant, 'Default selection' event will
be helpful.
Previous Topic:Need some help in creating desktop application using SWT
Next Topic:SWT table filtering
Goto Forum:
  


Current Time: Fri Jul 25 10:09:23 EDT 2025

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

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

Back to the top