Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » handling a right mouse click over a TreeTable
handling a right mouse click over a TreeTable [message #446406] Wed, 24 November 2004 16:47 Go to next message
Eclipse UserFriend
Originally posted by: yvon_thoraval.mac.com

Hy all,

i'd lihe to handle a right mouse click over a TreeTable (any place) to
set visible a secondary window as it is for a menu.

Best,

Yvon
Re: handling a right mouse click over a TreeTable [message #446409 is a reply to message #446406] Wed, 24 November 2004 17:38 Go to previous messageGo to next message
Paul Singleton is currently offline Paul SingletonFriend
Messages: 37
Registered: July 2009
Member
Yvon Thoraval wrote:

> i'd lihe to handle a right mouse click over a TreeTable (any place) to
> set visible a secondary window as it is for a menu.

I suggest that you handle the MenuDetect event, which is raised
when the user does whatever it takes to request a context menu
on her platform.

You can then do whatever you like in response to this event;
it isn't tied to a popup menu.

NB this applies to 3.0 or later

Paul Singleton
Re: handling a right mouse click over a TreeTable [message #446415 is a reply to message #446409] Wed, 24 November 2004 18:04 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Do:

tableTree.getTable().addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event e) {
// show menu
}
});

"Paul Singleton" <paul@jbgb.com> wrote in message
news:41A4C702.7040707@jbgb.com...
> Yvon Thoraval wrote:
>
>> i'd lihe to handle a right mouse click over a TreeTable (any place) to
>> set visible a secondary window as it is for a menu.
>
> I suggest that you handle the MenuDetect event, which is raised
> when the user does whatever it takes to request a context menu
> on her platform.
>
> You can then do whatever you like in response to this event;
> it isn't tied to a popup menu.
>
> NB this applies to 3.0 or later
>
> Paul Singleton
Re: handling a right mouse click over a TreeTable [message #446419 is a reply to message #446409] Wed, 24 November 2004 18:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yvon_thoraval.mac.com

Paul Singleton a écrit :
> I suggest that you handle the MenuDetect event, which is raised
> when the user does whatever it takes to request a context menu
> on her platform.
Thanks a lot, it works very well on Shell :

Display display = new Display();
Shell shell = new Shell(display);
shell.setText(mH);
shell.setSize(1024, 425);
shell.open();
final Shell dialog = new Shell(shell, SWT.POP_UP | SWT.BORDER |
SWT.TITLE);
shell.addListener (SWT.MenuDetect, new Listener () {
public void handleEvent (Event event) {
System.out.println("SWT.MenuDetect");
dialog.setVisible (true);
}
});
tableTree = new TableTree(shell, SWT.BORDER);
tableTree.setSize(1020, 400);
tableTree.setLocation(2, 2);
tableTree.addListener (SWT.MenuDetect, new Listener () {
public void handleEvent (Event event) {
dialog.setVisible (true);
}
});

BUT not at all on the TreeTable, may be this is OS dependant (i'm
working on MacOS X.3.6). The room left by TreeTable to the Shell is only
2 pixels wide... then, i can't use it ))

I should also mention that SelectionListener isn't working very well,
getSelection() and getText() only returns the correct values for the
first row (index 0) for the other getSelection() returns - 1 and
getText() null.

Do you think all the above could be an issue on MacOS X ???


Best,

Yvon
Re: handling a right mouse click over a TreeTable [message #446420 is a reply to message #446415] Wed, 24 November 2004 18:25 Go to previous message
Eclipse UserFriend
Originally posted by: yvon_thoraval.mac.com

Veronika Irvine a écrit :
> Do:
>
> tableTree.getTable().addListener(SWT.MenuDetect, new Listener() {
> public void handleEvent(Event e) {
> // show menu
> }
> });

OK, fine, thanks !

Best,

Yvon
Previous Topic:Widget central ?
Next Topic:[MacOS X.3.6] TableTree getting selected item
Goto Forum:
  


Current Time: Wed Oct 28 00:28:10 GMT 2020

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

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

Back to the top