Hi,

We're trying to implement drag&drop from/to a TListView.

There are several issues:

1. The selected listitem is not yet set when the drag is initialized.

This prevents knowing which item in the list is being dragged, and
this is the initial problem.

Trying to work around this, we hit 2 other problems:

2. When a drag is started (OnStartDrag event), the X,Y positions are
   unknown, so they cannot be initialized in a TDragObject object which
   we would create. 

We can work around this by saving the X,Y in the onmousedown object
and create a TDragObject in the OnStartDrag event where we store the
saved X,Y. Using GetItemAt should then enable us to determine which
item is being dragged.

But then we hit the third problem:

3. TListView.GetItemAt(X,Y) retuns the wrong item when ShowColumnHeaders=True.
   As far as we can see, it returns the next object in the list, and Nil on
   the last item.

In short, we're stuck...

This is tested both under GTK1 and GTK2.

Has someone succesfully used drag & drop using GTK (or windows, for that
matter) ?

Michael.
_______________________________________________
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to