Issue 769 in moose-technology: Glamour should support drag and drop

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

Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology
Status: New
Owner: [hidden email]
Labels: Type-Defect Priority-Medium Milestone-4.6 Component-Glamour

New issue 769 by [hidden email]: Glamour should support drag and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

Something like this:

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

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

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

abergel
We recently discussed about Glamour. The example below illustrates well the "magic" effect that some of us (including my students) do not really adhere with DSL:

> Something like this:
>
> a list
> allowItemDrag: [:item :list | ... ];
> itemDrag: [:item :list | ... ]
>
> a list
> allowDropOnItem: [:draggedObject :targetItem :list | ... ];
> dropOnItem: [:draggedObject :targetItem :list | ... ]

It is often not clear what the object referenced by "a" is. Even for me.

When I write scripts in Mondrian, I usually avoid having "each".

        view nodes: Collection withAllSubclasses forEach: [ :aClass | ... ].

Instead of

        view nodes: Collection withAllSubclasses forEach: [ :each | ... ].

Cheers,
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

Tudor Girba-2
Hi,

On 3 Jan 2012, at 14:32, Alexandre Bergel wrote:

> We recently discussed about Glamour.

Who is we?

> The example below illustrates well the "magic" effect that some of us (including my students) do not really adhere with DSL:
>
>> Something like this:
>>
>> a list
>> allowItemDrag: [:item :list | ... ];
>> itemDrag: [:item :list | ... ]
>>
>> a list
>> allowDropOnItem: [:draggedObject :targetItem :list | ... ];
>> dropOnItem: [:draggedObject :targetItem :list | ... ]
>
> It is often not clear what the object referenced by "a" is. Even for me.

Why do you say often? You seem to imply that it can take many forms :). But, "a" is always used in examples to denote an instance of GLMCompositePresentation. Always.

This convention is used to work in:

browser transmit from: ... ; to: ... ; andShow: [:a |
        a ... ]

Another name used is "composer" or "presenter".

> When I write scripts in Mondrian, I usually avoid having "each".
>
> view nodes: Collection withAllSubclasses forEach: [ :aClass | ... ].
>
> Instead of
>
> view nodes: Collection withAllSubclasses forEach: [ :each | ... ].

The two things are not the same. "a" is the correspondent of "view", which is as obscure if you do not know that it is the holder of the api.

Anyway, what is your point? :)

Cheers,
Doru


--
www.tudorgirba.com

"It's not how it is, it is how we see it."


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

abergel
>> We recently discussed about Glamour.
>
> Who is we?

The Pharo mailing list. But this is not important.

>>> Something like this:
>>>
>>> a list
>>> allowItemDrag: [:item :list | ... ];
>>> itemDrag: [:item :list | ... ]
>>>
>>> a list
>>> allowDropOnItem: [:draggedObject :targetItem :list | ... ];
>>> dropOnItem: [:draggedObject :targetItem :list | ... ]
>>
>> It is often not clear what the object referenced by "a" is. Even for me.
>
> Why do you say often?

Because I often experience this :-)

> You seem to imply that it can take many forms :). But, "a" is always used in examples to denote an instance of GLMCompositePresentation. Always.

Ah okays. But this is not easy to infer this from browsing the code of andShow:.
Maybe just saying that the block expect an instance of GLMCompositePresentation as argument will help.

> Anyway, what is your point? :)


Simply trying to help to document Glamour better. My students bumped into those problem (they are very beginners however).

Whatever the discussion on the pharo mailing list, whether Glamour should be part of Pharo or not, whether Glamour compete against OB or not, Glamour make us really productive. Juan Pablo is designing a new version of Versionner based on Glamour. We are so fast in designing UI and we have so much freedom.
I did not measure it, but I think we are between 10 or 20 times faster with Glamour than directly with Morphic. Glamour simply cannot be ignored.

Happy new year, once more :-)
Alexandre

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

EstebanLM
Hi,

El 03/01/2012, a las 11:21a.m., Alexandre Bergel escribió:

>>> We recently discussed about Glamour.
>>
>> Who is we?
>
> The Pharo mailing list. But this is not important.
>
>>>> Something like this:
>>>>
>>>> a list
>>>> allowItemDrag: [:item :list | ... ];
>>>> itemDrag: [:item :list | ... ]
>>>>
>>>> a list
>>>> allowDropOnItem: [:draggedObject :targetItem :list | ... ];
>>>> dropOnItem: [:draggedObject :targetItem :list | ... ]
>>>
>>> It is often not clear what the object referenced by "a" is. Even for me.
>>
>> Why do you say often?
>
> Because I often experience this :-)
>
>> You seem to imply that it can take many forms :). But, "a" is always used in examples to denote an instance of GLMCompositePresentation. Always.
>
> Ah okays. But this is not easy to infer this from browsing the code of andShow:.
> Maybe just saying that the block expect an instance of GLMCompositePresentation as argument will help.
>
>> Anyway, what is your point? :)
>
>
> Simply trying to help to document Glamour better. My students bumped into those problem (they are very beginners however).

yep... "a" is an awful name... I always use "presenter"


>
> Whatever the discussion on the pharo mailing list, whether Glamour should be part of Pharo or not, whether Glamour compete against OB or not, Glamour make us really productive. Juan Pablo is designing a new version of Versionner based on Glamour. We are so fast in designing UI and we have so much freedom.
> I did not measure it, but I think we are between 10 or 20 times faster with Glamour than directly with Morphic. Glamour simply cannot be ignored.

+1
we should keep improving glamour (and glamoroust)... then we'll see if it becomes part of pharo or just a great tool you need to install :)

best,
Esteban

>
> Happy new year, once more :-)
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

Tudor Girba-2
In reply to this post by abergel
>
>> You seem to imply that it can take many forms :). But, "a" is always used in examples to denote an instance of GLMCompositePresentation. Always.
>
> Ah okays. But this is not easy to infer this from browsing the code of andShow:.
> Maybe just saying that the block expect an instance of GLMCompositePresentation as argument will help.
>
>> Anyway, what is your point? :)
>
>
> Simply trying to help to document Glamour better. My students bumped into those problem (they are very beginners however).

Duly noted. I added the following comments. Do they explain the point?

andShow: aBlock
        "This scripting method acceppts a block with one argument
        that will be populated with an instance of GLMCompositePresentation.
       
        The block should construct the presentations that go in the composite presentation.
        The composite presentation will be the one that will get installed in the target pane
        once the transmission triggers.
        "

andShowIfNone: aBlock
        "This scripting method acceppts a block with one argument
        that will be populated with an instance of GLMCompositePresentation.
       
        The block should construct the presentations that go in the composite presentation.
        The composite presentation will be the one that will get installed in the target pane
        once the transmission triggers.
       
        The particularity of this method is that the presentation will get installed in the target
        pane only if the target pane has no presentation already.
        "


> Whatever the discussion on the pharo mailing list, whether Glamour should be part of Pharo or not, whether Glamour compete against OB or not, Glamour make us really productive. Juan Pablo is designing a new version of Versionner based on Glamour. We are so fast in designing UI and we have so much freedom.
> I did not measure it, but I think we are between 10 or 20 times faster with Glamour than directly with Morphic. Glamour simply cannot be ignored.

I am happy you are happy.

But, just to make it clear: Glamour is an engine for browsers, while Morphic is for user interfaces in general. Glamour offers a subset of flexibility when compared with Morphic. However, the value comes from understanding that data browsing is a special domain that can be captured at a higher level.

I like to make this distinction because it is important to set the expectation before using Glamour :).


Cheers,
Doru


> Happy new year, once more :-)
> Alexandre
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

abergel
I tried to improve the comments:


andShow: aBlock
        "This method accepts a block with one argument.
        The block will be evaluated with an instance of GLMCompositePresentation.
       
        The block should construct the presentations that go in the composite presentation.
        The composite presentation will be the one that will get installed in the target pane
        once the transmission triggers.

        This method is typically used in a user-defined Glamour script.
        "

andShowIfNone: aBlock
        "This method accepts a block with one argument.
        The block will be evaluated with an instance of GLMCompositePresentation.
       
        The block should construct the presentations that go in the composite presentation.
        The composite presentation will be the one that will get installed in the target pane
        once the transmission triggers.
       
        The particularity of this method is that the presentation will get installed in the target
        pane only if the target pane has no presentation already.

        This method is typically used in a user-defined Glamour script.
        "

Cheers,
Alexandre


On 3 Jan 2012, at 11:36, Tudor Girba wrote:

>>
>>> You seem to imply that it can take many forms :). But, "a" is always used in examples to denote an instance of GLMCompositePresentation. Always.
>>
>> Ah okays. But this is not easy to infer this from browsing the code of andShow:.
>> Maybe just saying that the block expect an instance of GLMCompositePresentation as argument will help.
>>
>>> Anyway, what is your point? :)
>>
>>
>> Simply trying to help to document Glamour better. My students bumped into those problem (they are very beginners however).
>
> Duly noted. I added the following comments. Do they explain the point?
>
> andShow: aBlock
> "This scripting method acceppts a block with one argument
> that will be populated with an instance of GLMCompositePresentation.
>
> The block should construct the presentations that go in the composite presentation.
> The composite presentation will be the one that will get installed in the target pane
> once the transmission triggers.
> "
>
> andShowIfNone: aBlock
> "This scripting method acceppts a block with one argument
> that will be populated with an instance of GLMCompositePresentation.
>
> The block should construct the presentations that go in the composite presentation.
> The composite presentation will be the one that will get installed in the target pane
> once the transmission triggers.
>
> The particularity of this method is that the presentation will get installed in the target
> pane only if the target pane has no presentation already.
> "
>
>
>> Whatever the discussion on the pharo mailing list, whether Glamour should be part of Pharo or not, whether Glamour compete against OB or not, Glamour make us really productive. Juan Pablo is designing a new version of Versionner based on Glamour. We are so fast in designing UI and we have so much freedom.
>> I did not measure it, but I think we are between 10 or 20 times faster with Glamour than directly with Morphic. Glamour simply cannot be ignored.
>
> I am happy you are happy.
>
> But, just to make it clear: Glamour is an engine for browsers, while Morphic is for user interfaces in general. Glamour offers a subset of flexibility when compared with Morphic. However, the value comes from understanding that data browsing is a special domain that can be captured at a higher level.
>
> I like to make this distinction because it is important to set the expectation before using Glamour :).
>
>
> Cheers,
> Doru
>
>
>> Happy new year, once more :-)
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> www.tudorgirba.com
>
> "Reasonable is what we are accustomed with."
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology
In reply to this post by moose-technology
Updates:
        Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 769 by [hidden email]: Glamour should support  
drag and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

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

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

Stephan Eggermont-3
In reply to this post by abergel

On Jan 3, 2012, at 3:21 PM, Alexandre Bergel wrote:
> Simply trying to help to document Glamour better. My students bumped into those problem (they are very beginners however).

Experienced smalltalkers also tend to find that non-ideomatic smalltalk. Only they know to solve
that faster by putting a halt there and inspect the a :)
 
> Whatever the discussion on the pharo mailing list, whether Glamour should be part of Pharo or not, whether Glamour compete against OB or not, Glamour make us really productive. Juan Pablo is designing a new version of Versionner based on Glamour. We are so fast in designing UI and we have so much freedom.
> I did not measure it, but I think we are between 10 or 20 times faster with Glamour than directly with Morphic. Glamour simply cannot be ignored.

I fully agree. We can afford to build a new browser every day and use it show our increasing insight
and the missing pieces in our data conversion project. Visualizing progress directly to the customer
is extremely valuable.

Stephan
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology
In reply to this post by moose-technology

Comment #2 on issue 769 by [hidden email]: Glamour should support drag  
and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

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)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology

Comment #3 on issue 769 by [hidden email]: Glamour should support  
drag and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

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.

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology
Updates:
        Labels: -Milestone-4.6 Milestone-4.7

Comment #4 on issue 769 by [hidden email]: Glamour should support  
drag and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

(No comment was entered for this change.)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Issue 769 in moose-technology: Glamour should support drag and drop

moose-technology
Updates:
        Labels: -Milestone-4.7

Comment #5 on issue 769 by [hidden email]: Glamour should support  
drag and drop
http://code.google.com/p/moose-technology/issues/detail?id=769

Not for 4.7

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev