Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glamour should support drag and drop #769

Closed
seandenigris opened this issue Aug 3, 2015 · 5 comments
Closed

Glamour should support drag and drop #769

seandenigris opened this issue Aug 3, 2015 · 5 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 769

Something like this:

a list 
    allowItemDrag: [:item :list | ... ];
    itemDrag: [:item :list | ... ] 

a list
    allowDropOnItem: [:draggedObject :targetItem :list | ... ];
    dropOnItem: [:draggedObject :targetItem :list | ... ]

Reported by tudor.girba on 2012-01-03 13:19:58

@seandenigris
Copy link
Contributor Author

A first version is implemented for listing presentations. However, there is basically
no test for this.

Here is an example:

GLMBasicExamples>>listDragAndDrop
    "self new listDragAndDrop openOn: (1 to: 5) asOrderedCollection"
    | browser |
    browser := GLMTabulator new.
    browser column: #source; column: #target.
    browser transmit to: #source; andShow: [:a | 
        a list 
            title: 'Source';
            display: (1 to: 10);
            allowItemDrag: [:item :list | true ];
            transformDraggedItem: [:item :list | item + 100 ]
            ].
    browser transmit to: #target; andShow: [:a |  
        a list
            title: 'Target'; 
            display: [:collection | collection ];
            allowDropOnItem: [:draggedObject :targetItem :list | draggedObject isNumber ];
            dropOnItem: [:draggedObject :targetItem :list | 
                list entity addLast: (targetItem + draggedObject).
                list update.
                true ]
            ].
    ^ browser

Reported by tudor.girba on 2012-01-03 16:25:28

  • Labels added: Type-Enhancement
  • Labels removed: Type-Defect

@seandenigris
Copy link
Contributor Author

NIce to see such quick action, Doru! 

The interface for dropping might become a bit more complex. Let's consider a tree view.
The drop can be either on an element of the tree (supported), or in the free area below
it. But it can also be between elements (to add at a specific position in the tree)
or even at a certain level of the tree (to add as a child)

Reported by stephan@stack.nl on 2012-01-03 22:10:19

@seandenigris
Copy link
Contributor Author

Indeed, these are all actions that should be supported. However, I am already happy
that I discovered how to do this with Morphic :)

We would need more help from the widgets to handle the in-between dropping. Right now,
there does not seem to be a way to do this in Morphic, probably because there is no
space in between the rows. Dropping below the list seems to be possible.

Reported by tudor.girba on 2012-01-04 07:14:18

@seandenigris
Copy link
Contributor Author

Reported by tudor.girba on 2012-02-11 09:47:58

  • Labels added: Milestone-4.7
  • Labels removed: Milestone-4.6

@seandenigris
Copy link
Contributor Author

Not for 4.7

Reported by tudor@tudorgirba.com on 2012-11-24 23:27:15

  • Labels removed: Milestone-4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants