Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:07 Go to next message
Thomas Wiedmann is currently offline Thomas WiedmannFriend
Messages: 69
Registered: July 2009
Member
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 14:54 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
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 22:43 Go to previous messageGo to next message
Thomas Wiedmann is currently offline Thomas WiedmannFriend
Messages: 69
Registered: July 2009
Member
> 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 08:20 Go to previous message
Praveen  is currently offline Praveen Friend
Messages: 86
Registered: July 2009
Member
> 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: Mon Nov 24 20:24:38 GMT 2014

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

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