Multiple-selection drag-and-drop
Hi, I'm looking for a "kind-of-list" spec model (or morph) in Pharo 3 that supports multiple-selection drag-and-drop. I tried with TreeModel, NewListModel and ListModel... they don't support. Note: NewListModel even doesn't support single-selection drag-and-drop... is this a known issue or should I report it? Thanks, MartÃn
This works: m := TreeModel new. m roots: #(1 2 3 4 5). m dragEnabled: true. m dropEnabled: true. m transferBlock: [ :p :s | TransferMorph withPassenger: s model selectedItems from: s ]. m multiSelection: true. m openWithSpec. I guess the same applies for the other model, aka, redefining the TransferMorph. I am currently working on a TransferModel to hide the morphic part of it, but it will not be in Pharo 3.0. Ben On 21 Feb 2014, at 12:28, Martin Dias <tinchodias@gmail.com> wrote:
Hi,
I'm looking for a "kind-of-list" spec model (or morph) in Pharo 3 that supports multiple-selection drag-and-drop. I tried with TreeModel, NewListModel and ListModel... they don't support.
Note: NewListModel even doesn't support single-selection drag-and-drop... is this a known issue or should I report it?
Thanks, MartÃn
On Fri, Feb 21, 2014 at 2:14 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
This works:
m := TreeModel new. m roots: #(1 2 3 4 5). m dragEnabled: true. m dropEnabled: true.
m transferBlock: [ :p :s | TransferMorph withPassenger: s model selectedItems from: s ].
m multiSelection: true.
m openWithSpec.
I guess the same applies for the other model, aka, redefining the TransferMorph. I am currently working on a TransferModel to hide the morphic part of it, but it will not be in Pharo 3.0.
Great, it worked. Thanks
On Fri, Feb 21, 2014 at 6:26 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Fri, Feb 21, 2014 at 2:14 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
This works:
m := TreeModel new. m roots: #(1 2 3 4 5). m dragEnabled: true. m dropEnabled: true.
m transferBlock: [ :p :s | TransferMorph withPassenger: s model selectedItems from: s ].
m multiSelection: true.
m openWithSpec.
I guess the same applies for the other model, aka, redefining the TransferMorph. I am currently working on a TransferModel to hide the morphic part of it, but it will not be in Pharo 3.0.
Great, it worked. Thanks
Mmmmmmm, now that I test it with a mouse instead of a trackpad, I see it's almost impossible to do not loose the multiple selection before starting the drag in a TreeModel. As I remembered that in another thread I somebody told that NewLists work better with drag-and-drop of multiple selection, I tried with NewListModel, but I discovered that here drag-and-drop is not working even with single selection. I just reported it in: https://pharo.fogbugz.com/f/cases/12969/Drag-and-drop-never-starts-in-a-NewL... Thanks for all your support. MartÃn
On 22 Feb 2014, at 16:40, Martin Dias <tinchodias@gmail.com> wrote:
Mmmmmmm, now that I test it with a mouse instead of a trackpad, I see it's almost impossible to do not loose the multiple selection before starting the drag in a TreeModel.
Why? Here it works fine (at least as expected) I -click on the first element, -shift click on the last one, -click and drag and it works
As I remembered that in another thread I somebody told that NewLists work better with drag-and-drop of multiple selection, I tried with NewListModel, but I discovered that here drag-and-drop is not working even with single selection. I just reported it in:
https://pharo.fogbugz.com/f/cases/12969/Drag-and-drop-never-starts-in-a-NewL...
Fixed already :P Ben
On Sat, Feb 22, 2014 at 4:53 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
On 22 Feb 2014, at 16:40, Martin Dias <tinchodias@gmail.com> wrote:
Mmmmmmm, now that I test it with a mouse instead of a trackpad, I see it's almost impossible to do not loose the multiple selection before starting the drag in a TreeModel.
Why? Here it works fine (at least as expected) I -click on the first element, -shift click on the last one, -click and drag
and it works
Ohhh! I found how to reproduce it: if you start to drag in the bottom item, then it works; but if you start in another one, then multi-selection is lost.
On Sat, Feb 22, 2014 at 5:04 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Sat, Feb 22, 2014 at 4:53 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
On 22 Feb 2014, at 16:40, Martin Dias <tinchodias@gmail.com> wrote:
Mmmmmmm, now that I test it with a mouse instead of a trackpad, I see it's almost impossible to do not loose the multiple selection before starting the drag in a TreeModel.
Why? Here it works fine (at least as expected) I -click on the first element, -shift click on the last one, -click and drag
and it works
Ohhh! I found how to reproduce it: if you start to drag in the bottom item, then it works; but if you start in another one, then multi-selection is lost.
Another find: When multi-selecting using control key (I'm on mac), then drag has to start in the last selected item, otherwise it's list.
I found a possible fix that needs review: https://pharo.fogbugz.com/f/cases/12985/Sometimes-multi-selection-is-lost-on... cheers, MartÃn On Sat, Feb 22, 2014 at 5:20 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Sat, Feb 22, 2014 at 5:04 PM, Martin Dias <tinchodias@gmail.com> wrote:
On Sat, Feb 22, 2014 at 4:53 PM, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
On 22 Feb 2014, at 16:40, Martin Dias <tinchodias@gmail.com> wrote:
Mmmmmmm, now that I test it with a mouse instead of a trackpad, I see it's almost impossible to do not loose the multiple selection before starting the drag in a TreeModel.
Why? Here it works fine (at least as expected) I -click on the first element, -shift click on the last one, -click and drag
and it works
Ohhh! I found how to reproduce it: if you start to drag in the bottom item, then it works; but if you start in another one, then multi-selection is lost.
Another find: When multi-selecting using control key (I'm on mac), then drag has to start in the last selected item, otherwise it's list.
participants (2)
-
Benjamin -
Martin Dias