[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Trouble getting TableItem events

Not quite sure what you are asking here.  SWT.BUTTON1 and SWT.BUTTON3 are 
not event types.  You should register for MouseDown and in the MouseEvent 
look at the MouseEvent.button field to see if it was SWT.BUTTON1 or 
SWT.BUTTON3.

Note, if you are trying to detect when to show a menu, rather than use 
MouseDown with SWT.BUTTON3, you should use the MenuDetect event.  This 
will also get activated when the user selects Shift+F10 and will do the 
right thing for the platform (i.e. mouse up on Windows, mouse down on 
Motif etc).





"Asif Muhammad" <Asif.Muhammad@xxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
08/27/2003 12:34 PM
Please respond to platform-swt-dev
 
        To:     <platform-swt-dev@xxxxxxxxxxx>
        cc: 
        Subject:        RE: [platform-swt-dev] Trouble getting TableItem 
events


Hi
SWT.MouseDoubleClick or SWT.MouseDown work with handling table events 

But I when U try to register event type as BUTTON1 , or BUTTON3 (for
mouse right clicks) 
It does not work

Thanks

-----Original Message-----
From: platform-swt-dev-admin@xxxxxxxxxxx
[mailto:platform-swt-dev-admin@xxxxxxxxxxx] On Behalf Of Veronika Irvine
Sent: Tuesday, August 26, 2003 7:09 PM
To: platform-swt-dev@xxxxxxxxxxx
Subject: Re: [platform-swt-dev] Trouble getting TableItem events


Try :

table.addListener(SWT.MouseDoubleClick, list);

To determine what item received the SWT.MouseDoubleClick see:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-hom
e/snippits/snippet110.html

You might also consider using SWT.DefaultSelection instead (a higher
level 
event that includes double click but also hitting enter from the
keyboard 
when the table has focus - this improves accessibility of your 
application):

        table.addListener(SWT.DefaultSelection, new Listener() {
                public void handleEvent (Event e) {
                        System.out.println("default "+e.item);
                }
        });





"Asif Muhammad" <Asif.Muhammad@xxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
08/26/2003 11:46 AM
Please respond to platform-swt-dev
 
        To:     <platform-swt-dev@xxxxxxxxxxx>
        cc: 
        Subject:        [platform-swt-dev] Trouble getting TableItem 
events


Hi I want to pickup double click mouse events on TableItem

I do following

item.addListener(SWT.SWT.MouseDoubleClick, list);


And have a listener class

Class MyListener implements Listener{
                 public void handleEvent(Event e){
                                 System.out.println(" Event occurred");
                 }
}


But this does not seem to work 

Any help will be greatly appreciated.

Thanks
Asif
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev