Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » how can i show a popup menu on a table column
how can i show a popup menu on a table column [message #444707] Thu, 21 October 2004 08:58 Go to next message
Eclipse UserFriend
Originally posted by: dominikg.vr-web.de

hi,

i want to show a popup menu, if i click on the table column with the rig=
ht =

mouse.
is there a possibility to do so.

thx

-- =

Erstellt mit M2, Operas revolution=E4rem E-Mail-Modul: =

http://www.opera.com/m2/
Re: how can i show a popup menu on a table column [message #444857 is a reply to message #444707] Thu, 21 October 2004 13:43 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Not really supported. No MenuDetect or MouseDown event gets sent for a
TableColumn (either from the Table or from the TableColumn) when you click
the right mouse button in the header. I think the best you can do is
detect a selection of the column header (left mouse) and open the menu as a
result:

final Menu menu = new Menu(table);
MenuItem item2 = new MenuItem(menu, SWT.PUSH);
item2.setText("hello");
column.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
menu.setVisible(true);
}
});

"Dominik Glaser" <dominikg@vr-web.de> wrote in message
news:opsf7pu9qbl7b9sl@localhost...
hi,

i want to show a popup menu, if i click on the table column with the right
mouse.
is there a possibility to do so.

thx

--
Erstellt mit M2, Operas revolution
Re: how can i show a popup menu on a table column [message #444858 is a reply to message #444857] Thu, 21 October 2004 14:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dominikg.vr-web.de

thanks for your answer,
but i need this event for sorting the table by this column :(
have you another idea?

can i register a listener on the parent composite that gets also those =

events,
that are fired if i click on a child composite of that parent.

dominik


Am Thu, 21 Oct 2004 09:43:30 -0400 schrieb Veronika Irvine =

<veronika_irvine@oti.com>:

> Not really supported. No MenuDetect or MouseDown event gets sent for a=

> TableColumn (either from the Table or from the TableColumn) when you =

> click
> the right mouse button in the header. I think the best you can do is=

> detect a selection of the column header (left mouse) and open the menu=
=

> as a
> result:
>
> final Menu menu =3D new Menu(table);
> MenuItem item2 =3D new MenuItem(menu, SWT.PUSH);
> item2.setText("hello");
> column.addListener(SWT.Selection, new Listener() {
> public void handleEvent(Event e) {
> menu.setVisible(true);
> }
> });
>
> "Dominik Glaser" <dominikg@vr-web.de> wrote in message
> news:opsf7pu9qbl7b9sl@localhost...
> hi,
>
> i want to show a popup menu, if i click on the table column with the =

> right
> mouse.
> is there a possibility to do so.
>
> thx
>



-- =

Erstellt mit M2, Operas revolution=E4rem E-Mail-Modul: =

http://www.opera.com/m2/
Re: how can i show a popup menu on a table column [message #445110 is a reply to message #444858] Tue, 26 October 2004 13:11 Go to previous message
Lars is currently offline LarsFriend
Messages: 32
Registered: July 2009
Member
Why can't you use a selectionevent for this - even though its from left
mouse click ? We do that in our application ... We save the last used
sort order, and reverse it if clicked more than once!

*/ Lars

Dominik Glaser wrote:
> thanks for your answer,
> but i need this event for sorting the table by this column :(
> have you another idea?
>
> can i register a listener on the parent composite that gets also those
> events,
> that are fired if i click on a child composite of that parent.
>
> dominik
>
>
> Am Thu, 21 Oct 2004 09:43:30 -0400 schrieb Veronika Irvine
> <veronika_irvine@oti.com>:
>
>> Not really supported. No MenuDetect or MouseDown event gets sent for a
>> TableColumn (either from the Table or from the TableColumn) when you
>> click
>> the right mouse button in the header. I think the best you can do is
>> detect a selection of the column header (left mouse) and open the menu
>> as a
>> result:
>>
>> final Menu menu = new Menu(table);
>> MenuItem item2 = new MenuItem(menu, SWT.PUSH);
>> item2.setText("hello");
>> column.addListener(SWT.Selection, new Listener() {
>> public void handleEvent(Event e) {
>> menu.setVisible(true);
>> }
>> });
>>
>> "Dominik Glaser" <dominikg@vr-web.de> wrote in message
>> news:opsf7pu9qbl7b9sl@localhost...
>> hi,
>>
>> i want to show a popup menu, if i click on the table column with the
>> right
>> mouse.
>> is there a possibility to do so.
>>
>> thx
>>
>
>
>
Previous Topic:MultiPageEditor
Next Topic:TableViewer with Virtual style?
Goto Forum:
  


Current Time: Fri Apr 26 22:30:37 GMT 2024

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

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

Back to the top