Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » [grid] Menu popup in void
[grid] Menu popup in void [message #49185] Sat, 09 February 2008 02:11 Go to next message
Grant Slender is currently offline Grant Slender
Messages: 36
Registered: July 2009
Member
Hi,

I've got a context driven menu popup happening when a user right-clicks
a row in the grid. This is working fine.

Unfortunately, when the user right-clicks in a non-populated row (at the
bottom) I still get a menuDetected event when nothing is selected. As
such, the context code is wrong. I could detect this non-selection and
not display the menu, but in the case where a clicks a row first,
selecting it, and then right clicks into a void I'd prefer to still not
show a menu as it might be unclear that the menu selection relates to a
row selected much higher.

Does anyone know the correct way to determine a right-click in this void
area that would result in a menuDetected event - so that I can safely
ignore this event and not show a menu.
Re: [grid] Menu popup in void [message #49207 is a reply to message #49185] Mon, 11 February 2008 22:04 Go to previous messageGo to next message
Grant Slender is currently offline Grant Slender
Messages: 36
Registered: July 2009
Member
Is this question more suited to another newsgroup? platform.swt?

Grant Slender wrote:
> Hi,
>
> I've got a context driven menu popup happening when a user right-clicks
> a row in the grid. This is working fine.
>
> Unfortunately, when the user right-clicks in a non-populated row (at the
> bottom) I still get a menuDetected event when nothing is selected. As
> such, the context code is wrong. I could detect this non-selection and
> not display the menu, but in the case where a clicks a row first,
> selecting it, and then right clicks into a void I'd prefer to still not
> show a menu as it might be unclear that the menu selection relates to a
> row selected much higher.
>
> Does anyone know the correct way to determine a right-click in this void
> area that would result in a menuDetected event - so that I can safely
> ignore this event and not show a menu.
Re: [grid] Menu popup in void [message #49972 is a reply to message #49207] Wed, 27 February 2008 15:18 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 253
Registered: July 2009
Senior Member
Hi Grant,

You should be able to use the x,y coordinates of the menu detect event
and ask Grid.getItem(x,y). If it returns null then you can assume its
not over a row.

regards,
-Chris

Grant Slender wrote:
> Is this question more suited to another newsgroup? platform.swt?
>
> Grant Slender wrote:
>> Hi,
>>
>> I've got a context driven menu popup happening when a user
>> right-clicks a row in the grid. This is working fine.
>>
>> Unfortunately, when the user right-clicks in a non-populated row (at
>> the bottom) I still get a menuDetected event when nothing is selected.
>> As such, the context code is wrong. I could detect this non-selection
>> and not display the menu, but in the case where a clicks a row first,
>> selecting it, and then right clicks into a void I'd prefer to still
>> not show a menu as it might be unclear that the menu selection relates
>> to a row selected much higher.
>>
>> Does anyone know the correct way to determine a right-click in this
>> void area that would result in a menuDetected event - so that I can
>> safely ignore this event and not show a menu.
Re: [grid] Menu popup in void [message #588542 is a reply to message #49185] Mon, 11 February 2008 22:04 Go to previous message
Grant Slender is currently offline Grant Slender
Messages: 36
Registered: July 2009
Member
Is this question more suited to another newsgroup? platform.swt?

Grant Slender wrote:
> Hi,
>
> I've got a context driven menu popup happening when a user right-clicks
> a row in the grid. This is working fine.
>
> Unfortunately, when the user right-clicks in a non-populated row (at the
> bottom) I still get a menuDetected event when nothing is selected. As
> such, the context code is wrong. I could detect this non-selection and
> not display the menu, but in the case where a clicks a row first,
> selecting it, and then right clicks into a void I'd prefer to still not
> show a menu as it might be unclear that the menu selection relates to a
> row selected much higher.
>
> Does anyone know the correct way to determine a right-click in this void
> area that would result in a menuDetected event - so that I can safely
> ignore this event and not show a menu.
Re: [grid] Menu popup in void [message #588769 is a reply to message #49207] Wed, 27 February 2008 15:18 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 471
Registered: July 2009
Senior Member
Hi Grant,

You should be able to use the x,y coordinates of the menu detect event
and ask Grid.getItem(x,y). If it returns null then you can assume its
not over a row.

regards,
-Chris

Grant Slender wrote:
> Is this question more suited to another newsgroup? platform.swt?
>
> Grant Slender wrote:
>> Hi,
>>
>> I've got a context driven menu popup happening when a user
>> right-clicks a row in the grid. This is working fine.
>>
>> Unfortunately, when the user right-clicks in a non-populated row (at
>> the bottom) I still get a menuDetected event when nothing is selected.
>> As such, the context code is wrong. I could detect this non-selection
>> and not display the menu, but in the case where a clicks a row first,
>> selecting it, and then right clicks into a void I'd prefer to still
>> not show a menu as it might be unclear that the menu selection relates
>> to a row selected much higher.
>>
>> Does anyone know the correct way to determine a right-click in this
>> void area that would result in a menuDetected event - so that I can
>> safely ignore this event and not show a menu.
Previous Topic:ToolTip widget is not getting disposed properly on Grid Table
Next Topic:Auto-resize a column?
Goto Forum:
  


Current Time: Mon Sep 22 00:32:04 GMT 2014

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

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