Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] find a table cell from mouse down


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



"Erik Poupaert" <erik.poupaert@xxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

02/14/2003 01:14 PM
Please respond to platform-swt-dev

       
        To:        <platform-swt-dev@xxxxxxxxxxx>
        cc:        
        Subject:        [platform-swt-dev] find a table cell from mouse down




"find a table cell from mouse down"

The algorithm in the snippets only works when you create the table with
SWT.FULL_SELECTION. That wouldn't be so much of a problem if you could
change the colour of the selection bar and give it the background colour.
But such method seems not to be available?

                                                                   Point pt = new Point (event.x, event.y);
                       TableItem item = table.getItem (pt);
                       if (item == null) return;
                       for (int i=0; i < columnCount; i++) {
                               Rectangle rect = item.getBounds (i);
                               if (rect.contains (pt)) return i;
                       }


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



Back to the top