[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: TableItem.addListener() SOLUTION!

Note that there is also a DragDetect event - you can use this to detect the
start of a drag and it will give more platform consistency (e.g. how far you
need to move the mouse before a drag is started; on motif a drag begins with
the middle mouse button, ...).

"Moritz Angermann" <moritz.angermann@xxxxxxx> wrote in message
news:b7k9he$pb4$1@xxxxxxxxxxxxxxxx
> you have to use the table listener.
> say you use
> Table table = new Table(Composite, Style);
> table.addListener(SWT.MouseDown,
> new Listener(){
> public void handleEvent(Event e){
> TableItem item = table.getItem( new Point(e.x,e.y));
> }});
> and
> table.addListener(SWT.MouseUp,
> new Listener(){
> public void handleEvent(Event e){
> TableItem item = table.getItem( new Point(e.x,e.y));
> }});
>
> !! Be aware of item to be null !!
>
> reg.
>   moritz
>
> Moritz Angermann wrote:
> > is there a way to get a mouseDown and mouseUp on a TableItem?
> > i'd rather like to do my 'fake' DND on the table. so i can get
> > the 'down' and the 'up' row.
> > thus i'd need to be able to set
> > TableItem.addListener(SWT.MouseDown, new Listener(){...});
> > and
> > TableItem.addListener(SWT.MouseUp, new Listener(){...});
> >
> > can i get that done by any chance?
> >
> > reg.
> >  moritz
> >
>