| DnD Drag behavour on Table control [message #460836] |
Thu, 08 September 2005 09:25  |
Eclipse User |
|
|
|
I have a table based application with spreadsheet like behaviour which
allows the user to select arbitrary blocks of cells (possibly not including
the entire row). The selection behaviour of the table control does not
support this, so I have an invisible column zero to hide the control's
native selection and am painting my own outline around the selected cell(s)
a la Excel.
I want to allow the user to drag the selected cells from my application into
Excel (copy and paste works fine).
The behavior of drag support on the table control seems to require the mouse
cursor to be over the highlight of the selection in order to work. Since no
native selection is visible in my app DnD does not work at all from the
table.
Can anyone suggest any way to get around this?
As an aside, if SWT.FULL_SELECTION is not used then drag does not work if
you click on part of the cell zero containing the selected row which is
after the last character displayed (and not highlighted), or on any other
cell in the row. This seems like a defect to me, but I accept that others
may not agree.
Bruce.
|
|
|
| Re: DnD Drag behavour on Table control [message #460869 is a reply to message #460836] |
Fri, 09 September 2005 06:10  |
Eclipse User |
|
|
|
The drag-and-drop doesn't work because some cells appear highlighted; it works because the mouse is over the *selection* so this currently isn't going to happen.
You might want to raise a feature request, because being able to select a selection of cells that doesn't include entire rows/columns sounds like a nice feature to have in an SWT table.
In the meantime, you could register mouse listeners yourself to detect a potential drag situation, then take the selected cells and put them into the drag-and-drop clipboard, but it would be hard work and prone to breakages.
|
|
|
Powered by
FUDForum. Page generated in 0.29731 seconds