Spec, Morphic, lists, multiple selection and drag&drop

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec, Morphic, lists, multiple selection and drag&drop

Piotr Klibert
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

Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

stepharo

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
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

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
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

Nicolai Hess
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
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

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,
essentially what most list widgets do with Ctrl+click.

This should work (justed test this with  a ListModel with multiselection enabled)

 

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
>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

Stephan Eggermont-3
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
Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

Sean P. DeNigris
Administrator
In reply to this post by Nicolai Hess
Nicolai Hess wrote
The problem is, dragging stars after the mouse click on the list items
changes the selection.
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
Reply | Threaded
Open this post in threaded view
|

Re: Spec, Morphic, lists, multiple selection and drag&drop

Piotr Klibert
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