Skip to main content



      Home
Home » Eclipse Projects » Nebula » Grid event keyboard state
Grid event keyboard state [message #647302] Wed, 05 January 2011 10:54 Go to next message
Eclipse UserFriend
Hi,

I need to get the keyboard state from a selection event (for example
from a column selection to allow multiple column sorting) however the
stateMask field is always 0.

With Eclipse 3.6x the table column event contains a valid stateMask, is
there a plan to add support for this in Grid ?

Regards,
Marco.
Re: Grid event keyboard state [message #647494 is a reply to message #647302] Thu, 06 January 2011 11:15 Go to previous messageGo to next message
Eclipse UserFriend
Marco,


> I need to get the keyboard state from a selection event (for example
> from a column selection to allow multiple column sorting) however the
> stateMask field is always 0.

I've also thought about enabling multi-column sorting by letting users
hold CTRL or something, but dismissed it also due to stateMask always
being 0.

The reason for this is that the fireListeners() method, that fires the
SelectionEvent you're seeing, does not get any information of the
original event that triggered the selection.

I think it would be possible to pass at least the statemask if not also
more information. Would you care to file a bug at eclipse and/or start a
discussion on the nebula-dev list? I could provide a patch if needed.


best regards,

-hannes
Re: Grid event keyboard state [message #647495 is a reply to message #647494] Thu, 06 January 2011 11:40 Go to previous messageGo to next message
Eclipse UserFriend
On 06/01/2011 17:15 Hannes Erven ha scritto:

> The reason for this is that the fireListeners() method, that fires the
> SelectionEvent you're seeing, does not get any information of the
> original event that triggered the selection.
>
> I think it would be possible to pass at least the statemask if not also
> more information. Would you care to file a bug at eclipse and/or start a
> discussion on the nebula-dev list? I could provide a patch if needed.

Yes I've debugged the code a bit and found it. I managed to pass the
original MouseEvent to fireListeners and yes, I was thinking about
filing a bug with the patch. My patch however adds that feature only for
column header selection events, I think it would be good to have it for
all kind of events but I haven't the time to find all places. Your patch
is covering other events too ?

Regards,
Marco.
Re: Grid event keyboard state [message #647500 is a reply to message #647495] Thu, 06 January 2011 12:08 Go to previous messageGo to next message
Eclipse UserFriend
Am 2011-01-06 17:40, schrieb Marco Maccaferri:

> Yes I've debugged the code a bit and found it. I managed to pass the
> original MouseEvent to fireListeners and yes, I was thinking about
> filing a bug with the patch. My patch however adds that feature only for
> column header selection events, I think it would be good to have it for
> all kind of events but I haven't the time to find all places. Your patch
> is covering other events too ?

Oh, that's great. I haven't yet modified anything but from a quick
glimpse at the code I guess one would "only" have to search for
references to Widget.notifyListeners(int,Event) and modify the passed
event -- there seem to be about 30 calls in Grid alone that need to be
checked...
I'm not an experienced SWT developer so I'd try to find out how other
SWT controls do this or ask on the nebula-dev list.


-hannes
Re: Grid event keyboard state [message #780848 is a reply to message #647302] Thu, 19 January 2012 10:53 Go to previous messageGo to next message
Eclipse UserFriend
I had the same problem and worked around by adding a KeyListener to the Grid and make it watch for the CTRL key. If the KeyListener and your code are in the same class, everything should work. Not a final solution, but it's working Smile

kRu
Re: Grid event keyboard state [message #787391 is a reply to message #780848] Tue, 31 January 2012 09:32 Go to previous message
Eclipse UserFriend
Hi guys,

Please file a bug with the patch and/or discuss this on nebula-dev

Best regards,

Wim Jongman
Previous Topic:Collapsible Buttons
Next Topic:Gantt chart / How to clear all events
Goto Forum:
  


Current Time: Wed Jul 02 23:42:19 EDT 2025

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

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

Back to the top