Hi,
working towards my app I encountered another problem. It's about drag and drop support for lists in Spec and underlying Morphs. While multiple selection is well supported in PluggableListMorph, reading #startDrag: and #startDragExtended: led me to believe that there is no support for dragging a bunch of list elements at once. It looks like drag is always initialized for the element that was clicked (dragIndex := self rowAtLocation: evt position.) and I see no easy extension point for changing this to support dragging all selected items instead. Am I missing some methods or classes that would let me do this, or is this indeed not possible right now? How would I go about implementing it? Best regards, Piotr Klibert |
Le 24/1/15 18:27, Piotr Klibert a écrit : > Hi, > > working towards my app I encountered another problem. It's about drag > and drop support for lists in Spec and underlying Morphs. > > While multiple selection is well supported in PluggableListMorph, > reading #startDrag: and #startDragExtended: led me to believe that > there is no support for dragging a bunch of list elements at once. The drag and drop support sucks. I'm sorry about it. But this is a reality. > It > looks like drag is always initialized for the element that was clicked > (dragIndex := self rowAtLocation: evt position.) and I see no easy > extension point for changing this to support dragging all selected > items instead. > > Am I missing some methods or classes that would let me do this, or is > this indeed not possible right now? How would I go about implementing > it? > > > Best regards, > Piotr Klibert > > > |
Haha, ok, that's not exactly the answer I was hoping for, but well, I
can't say it was a complete surprise ;-) I'll try grokking drag&drop implementation in Pharo next week and doing something with it. In my app I'm going to have one very long list as a source and a few other lists as destinations. To make it worthwhile I need to have support for dragging all items a current selection and additionally a way to make selection non-continuous, essentially what most list widgets do with Ctrl+click. Any help appreciated! Best regards, Piotr Klibert 2015-01-24 19:52 GMT+01:00 stepharo <[hidden email]>: > > Le 24/1/15 18:27, Piotr Klibert a écrit : >> >> Hi, >> >> working towards my app I encountered another problem. It's about drag >> and drop support for lists in Spec and underlying Morphs. >> >> While multiple selection is well supported in PluggableListMorph, >> reading #startDrag: and #startDragExtended: led me to believe that >> there is no support for dragging a bunch of list elements at once. > > > The drag and drop support sucks. I'm sorry about it. But this is a reality. > >> It >> looks like drag is always initialized for the element that was clicked >> (dragIndex := self rowAtLocation: evt position.) and I see no easy >> extension point for changing this to support dragging all selected >> items instead. >> >> Am I missing some methods or classes that would let me do this, or is >> this indeed not possible right now? How would I go about implementing >> it? >> >> >> Best regards, >> Piotr Klibert >> >> >> > > |
Hi Piotr
2015-01-24 20:24 GMT+01:00 Piotr Klibert <[hidden email]>: Haha, ok, that's not exactly the answer I was hoping for, but well, I The problem is, dragging stars after the mouse click on the list items changes the selection. That means, selecting all items and after that click on one item to start dragging, this item will be unselected. You can select all but one item and then click AND drag the last item. selection and additionally a way to make selection non-continuous, This should work (justed test this with a ListModel with multiselection enabled)
|
In reply to this post by Piotr Klibert
Nicolai wrote:
>The problem is, dragging stars after the mouse click on the list items >changes the selection. That means, selecting all items and after >that click on one item to start dragging, this item will be unselected. Yes, that is a well-known long time open bug 12534. It changes the selection on mouse-down instead of on mouse-up. Stephan |
Administrator
|
In reply to this post by Nicolai Hess
I think the problem (which is a bug) is that the selection is changed on mouseDown instead of mouseUp. It's very annoying.
Cheers,
Sean |
In reply to this post by Nicolai Hess
>>
>> selection and additionally a way to make selection non-continuous, >> essentially what most list widgets do with Ctrl+click. > > > This should work (justed test this with a ListModel with multiselection > enabled) > Turns out it works, indeed, but - at least on Linux - with Ctrl + Right click, which is very surprising. Ctrl + Left click, which does this for most other multi-select lists in existence, doesn't do anything at all. Is this expected? I have no other system to check this right now. Best regards, Piotr Klibert |
Free forum by Nabble | Edit this page |