Dragging and moving the source object

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Dragging and moving the source object

Anaël Ollier
Hi everyone,

I'm trying to use the drag&drop provided by Qooxdoo on an object. It works fine (of course) if I just want to indicate the dragged object with a special cursor.
But what I'd like to get is to be able to move the dragged widget so that it could be placed under the cursor while moving.

I can partially achieve that by using the "drag" event and move the widget accordingly. But in this case, and as the widget under the cursor is _always_ the dragged widget, I cannot use the dragover/dragleave events, and therefore I cannot know above which droppable component my widget/cursor is. In my case, I have several droppable containers that must react when dragging a widget over them, and here they can't.

I tried to find a workaround for that issue but I always end up with a huge coupling between the different components, which is precisely one of the good things the architecture of the D&D prevents.

Is there anybody who had the same kind of problem with this operation? If yes, is there a good solution available to keep a good looking code?

Thanks in advance
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Alexander Steitz
Hi Anaël,



On Wednesday February 17 2010 11:16:02 Anaël Ollier wrote:

> I'm trying to use the drag&drop provided by Qooxdoo on an object. It works
> fine (of course) if I just want to indicate the dragged object with a
> special cursor.
> But what I'd like to get is to be able to move the dragged widget so that
>  it could be placed under the cursor while moving.
>
> I can partially achieve that by using the "drag" event and move the widget
> accordingly. But in this case, and as the widget under the cursor is
> _always_ the dragged widget, I cannot use the dragover/dragleave events,
>  and therefore I cannot know above which droppable component my
>  widget/cursor is. In my case, I have several droppable containers that
>  must react when dragging a widget over them, and here they can't.
The issue here is that the widget is placed directly under the cursor which is
causing the qx event system to dispatch all the events to this widget.

So the default drag and drop cursor of qooxdoo is using the
"qx.ui.core.MPlacement" mixin to position itself. Therefore the "placeToMouse"
method together with specified offsets is used. This way it is assured that the
widget gets never positioned directly under the mouse cursor.

> I tried to find a workaround for that issue but I always end up with a huge
> coupling between the different components, which is precisely one of the
> good things the architecture of the D&D prevents.
>
> Is there anybody who had the same kind of problem with this operation? If
> yes, is there a good solution available to keep a good looking code?
You can take a closer look at the "qx.ui.core.MPlacement" and at the
"qx.ui.core.DragDropCursor" widget. If you do not need to major modifications
it might also be an idea to just modify the existing appearance of the
Drag'n'Drop cursor.

Just ask if you need some further infos.

cheers,
  Alex

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Anaël Ollier
Thanks for your help Alexander!

But unfortunately I already tried this mixin after taking a look at how the DragDropCursor was implemented. In this situation, the problem is that if you move your mouse to the bottom right (where the widget is) while dragging, the dragover nor the dragleave events are fired (maybe because here again you enter the dragged widget and not the component under).

And anyway, I'd like to be able to drag the widget from any location within the widget, and not from the top-left, moreover when this location is _outside_ the widget (1 pixel above its top side, and one pixel to its left side, I guess).

Some other advice maybe? Thanks in advance!

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/17 Alexander Steitz <[hidden email]>
Hi Anaël,



On Wednesday February 17 2010 11:16:02 Anaël Ollier wrote:
> I'm trying to use the drag&drop provided by Qooxdoo on an object. It works
> fine (of course) if I just want to indicate the dragged object with a
> special cursor.
> But what I'd like to get is to be able to move the dragged widget so that
>  it could be placed under the cursor while moving.
>
> I can partially achieve that by using the "drag" event and move the widget
> accordingly. But in this case, and as the widget under the cursor is
> _always_ the dragged widget, I cannot use the dragover/dragleave events,
>  and therefore I cannot know above which droppable component my
>  widget/cursor is. In my case, I have several droppable containers that
>  must react when dragging a widget over them, and here they can't.
The issue here is that the widget is placed directly under the cursor which is
causing the qx event system to dispatch all the events to this widget.

So the default drag and drop cursor of qooxdoo is using the
"qx.ui.core.MPlacement" mixin to position itself. Therefore the "placeToMouse"
method together with specified offsets is used. This way it is assured that the
widget gets never positioned directly under the mouse cursor.

> I tried to find a workaround for that issue but I always end up with a huge
> coupling between the different components, which is precisely one of the
> good things the architecture of the D&D prevents.
>
> Is there anybody who had the same kind of problem with this operation? If
> yes, is there a good solution available to keep a good looking code?
You can take a closer look at the "qx.ui.core.MPlacement" and at the
"qx.ui.core.DragDropCursor" widget. If you do not need to major modifications
it might also be an idea to just modify the existing appearance of the
Drag'n'Drop cursor.

Just ask if you need some further infos.

cheers,
 Alex

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Alexander Steitz
Hi Anaël,

On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:

> But unfortunately I already tried this mixin after taking a look at how the
> DragDropCursor was implemented. In this situation, the problem is that if
> you move your mouse to the bottom right (where the widget is) while
> dragging, the dragover nor the dragleave events are fired (maybe because
> here again you enter the dragged widget and not the component under).
>
> And anyway, I'd like to be able to drag the widget from any location within
> the widget, and not from the top-left, moreover when this location is
> outside the widget (1 pixel above its top side, and one pixel to its left
> side, I guess).
>
> Some other advice maybe? Thanks in advance!
Do you need to actually drag widgets around? Or is it possible to just e.g.
show a ghost or something like that to show the user he's currently dragging
something around.

cheers,
  Alex

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Anaël Ollier
I would like to drag the real source widget.
Actually, a good example of what I would like to achieve is the gadgets system from iGoogle. If you try it, you'll see that you can start dragging the gadget from any point of its title bar, and then when you drag it, the whole component is moving in real-time.

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Alexander Steitz <[hidden email]>
Hi Anaël,

On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
> But unfortunately I already tried this mixin after taking a look at how the
> DragDropCursor was implemented. In this situation, the problem is that if
> you move your mouse to the bottom right (where the widget is) while
> dragging, the dragover nor the dragleave events are fired (maybe because
> here again you enter the dragged widget and not the component under).
>
> And anyway, I'd like to be able to drag the widget from any location within
> the widget, and not from the top-left, moreover when this location is
> outside the widget (1 pixel above its top side, and one pixel to its left
> side, I guess).
>
> Some other advice maybe? Thanks in advance!
Do you need to actually drag widgets around? Or is it possible to just e.g.
show a ghost or something like that to show the user he's currently dragging
something around.

cheers,
 Alex

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Tom Schindl
Hi,

Not sure how good you are at reading Java-Code but here is some code
from my current QxWT-Demo-Application.

-------8<-------
slideArea = new QxComposite();
slideArea.setDecorator("main");
slideArea.setLayout(new QxCanvasLayout());
-------8<-------

-------8<-------

> QxImage item = new QxImage(source);
> final DTOSlideObject obj = ....;
> item.setDraggable(true);
> item.addDragstartHandler(new QxDragstartHandler() {
>
> public void handleEvent(QxDragstartEvent event) {
> event.addAction(Action.MOVE);
> dragLeftStart = event.getDocumentLeft();
> dragTopStart = event.getDocumentTop();
> }
> });
> item.addDragHandler(new QxDragHandler() {
>
> public void handleEvent(QxDragEvent event) {
> int x = event.getDocumentLeft();
> int y = event.getDocumentTop();
>
> item.setLayoutProperties(
> QxOption.left(obj.getX() + x - dragLeftStart),
> QxOption.top(obj.getY() + y - dragTopStart)
> );
> }
> });
> item.addDragendHandler(new QxDragendHandler() {
>
> public void handleEvent(QxDragendEvent event) {
> QxOptionMap map = item.getLayoutProperties();
> obj.setX(map.getIntValue("left"));
> obj.setY(map.getIntValue("top"));
> }
> });
>
> item.setWidth(obj.getWidth());
> item.setHeight(obj.getHeight());
> slideArea.add(item, QxOption.leftTop(obj.getX(), obj.getY()));
> }
-------8<-------

I thign you get the point. I simply record the start position of the
drag and then adjust the layout-left and top corrordinates.

Tom

Am 19.02.10 11:23, schrieb Anaël Ollier:

> I would like to drag the real source widget.
> Actually, a good example of what I would like to achieve is the gadgets
> system from iGoogle. If you try it, you'll see that you can start
> dragging the gadget from any point of its title bar, and then when you
> drag it, the whole component is moving in real-time.
>
> Cheers
> --
> Anaël
> [hidden email] <mailto:[hidden email]>
> The eyeos Project | www.eyeos.org <http://www.eyeos.org> | Web Desktop &
> Cloud Computing Operating System
>
>
> 2010/2/19 Alexander Steitz <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Anaël,
>
>     On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
>     > But unfortunately I already tried this mixin after taking a look
>     at how the
>     > DragDropCursor was implemented. In this situation, the problem is
>     that if
>     > you move your mouse to the bottom right (where the widget is) while
>     > dragging, the dragover nor the dragleave events are fired (maybe
>     because
>     > here again you enter the dragged widget and not the component under).
>     >
>     > And anyway, I'd like to be able to drag the widget from any
>     location within
>     > the widget, and not from the top-left, moreover when this location is
>     > outside the widget (1 pixel above its top side, and one pixel to
>     its left
>     > side, I guess).
>     >
>     > Some other advice maybe? Thanks in advance!
>     Do you need to actually drag widgets around? Or is it possible to
>     just e.g.
>     show a ghost or something like that to show the user he's currently
>     dragging
>     something around.
>
>     cheers,
>      Alex
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     qooxdoo-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Anaël Ollier
Hi Tom, thanks for your help on that too,

But if I understand your code, it's the part to manage "I want to be able to start dragging my widget from any position within it", but it does not help me with triggering the dragover/dragleave events. Or does it?
Anyway, it's the solution I thought about but I don't like to create that kind of little workarounds when (I think) it's totally the kind of feature that could be directly integrated into Qooxdoo, to avoid copy-pasting this piece of code everytime you need a D&D.

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Tom Schindl <[hidden email]>
Hi,

Not sure how good you are at reading Java-Code but here is some code
from my current QxWT-Demo-Application.

-------8<-------
slideArea = new QxComposite();
slideArea.setDecorator("main");
slideArea.setLayout(new QxCanvasLayout());
-------8<-------

-------8<-------
> QxImage item = new QxImage(source);
> final DTOSlideObject obj = ....;
> item.setDraggable(true);
>                                       item.addDragstartHandler(new QxDragstartHandler() {
>
>                                               public void handleEvent(QxDragstartEvent event) {
>                                                       event.addAction(Action.MOVE);
>                                                       dragLeftStart = event.getDocumentLeft();
>                                                       dragTopStart = event.getDocumentTop();
>                                               }
>                                       });
>                                       item.addDragHandler(new QxDragHandler() {
>
>                                               public void handleEvent(QxDragEvent event) {
>                                                       int x = event.getDocumentLeft();
>                                                       int y = event.getDocumentTop();
>
>                                                       item.setLayoutProperties(
>                                                                       QxOption.left(obj.getX() + x - dragLeftStart),
>                                                                       QxOption.top(obj.getY() + y - dragTopStart)
>                                                       );
>                                               }
>                                       });
>                                       item.addDragendHandler(new QxDragendHandler() {
>
>                                               public void handleEvent(QxDragendEvent event) {
>                                                       QxOptionMap map = item.getLayoutProperties();
>                                                       obj.setX(map.getIntValue("left"));
>                                                       obj.setY(map.getIntValue("top"));
>                                               }
>                                       });
>
>                                       item.setWidth(obj.getWidth());
>                                       item.setHeight(obj.getHeight());
>                                       slideArea.add(item, QxOption.leftTop(obj.getX(), obj.getY()));
>                               }
-------8<-------

I thign you get the point. I simply record the start position of the
drag and then adjust the layout-left and top corrordinates.

Tom

Am 19.02.10 11:23, schrieb Anaël Ollier:
> I would like to drag the real source widget.
> Actually, a good example of what I would like to achieve is the gadgets
> system from iGoogle. If you try it, you'll see that you can start
> dragging the gadget from any point of its title bar, and then when you
> drag it, the whole component is moving in real-time.
>
> Cheers
> --
> Anaël
> [hidden email] <mailto:[hidden email]>
> The eyeos Project | www.eyeos.org <http://www.eyeos.org> | Web Desktop &
> Cloud Computing Operating System
>
>
> 2010/2/19 Alexander Steitz <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Anaël,
>
>     On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
>     > But unfortunately I already tried this mixin after taking a look
>     at how the
>     > DragDropCursor was implemented. In this situation, the problem is
>     that if
>     > you move your mouse to the bottom right (where the widget is) while
>     > dragging, the dragover nor the dragleave events are fired (maybe
>     because
>     > here again you enter the dragged widget and not the component under).
>     >
>     > And anyway, I'd like to be able to drag the widget from any
>     location within
>     > the widget, and not from the top-left, moreover when this location is
>     > outside the widget (1 pixel above its top side, and one pixel to
>     its left
>     > side, I guess).
>     >
>     > Some other advice maybe? Thanks in advance!
>     Do you need to actually drag widgets around? Or is it possible to
>     just e.g.
>     show a ghost or something like that to show the user he's currently
>     dragging
>     something around.
>
>     cheers,
>      Alex
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     qooxdoo-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Anaël Ollier
*Bump*

Sorry but I'm still stuck on my "no dragover/dragleave" issue. I cannot find a good way to implement this without creating a hack or ugly workaround. If someone has another idea, please let me know!

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Anaël Ollier <[hidden email]>
Hi Tom, thanks for your help on that too,

But if I understand your code, it's the part to manage "I want to be able to start dragging my widget from any position within it", but it does not help me with triggering the dragover/dragleave events. Or does it?
Anyway, it's the solution I thought about but I don't like to create that kind of little workarounds when (I think) it's totally the kind of feature that could be directly integrated into Qooxdoo, to avoid copy-pasting this piece of code everytime you need a D&D.

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Tom Schindl <[hidden email]>

Hi,

Not sure how good you are at reading Java-Code but here is some code
from my current QxWT-Demo-Application.

-------8<-------
slideArea = new QxComposite();
slideArea.setDecorator("main");
slideArea.setLayout(new QxCanvasLayout());
-------8<-------

-------8<-------
> QxImage item = new QxImage(source);
> final DTOSlideObject obj = ....;
> item.setDraggable(true);
>                                       item.addDragstartHandler(new QxDragstartHandler() {
>
>                                               public void handleEvent(QxDragstartEvent event) {
>                                                       event.addAction(Action.MOVE);
>                                                       dragLeftStart = event.getDocumentLeft();
>                                                       dragTopStart = event.getDocumentTop();
>                                               }
>                                       });
>                                       item.addDragHandler(new QxDragHandler() {
>
>                                               public void handleEvent(QxDragEvent event) {
>                                                       int x = event.getDocumentLeft();
>                                                       int y = event.getDocumentTop();
>
>                                                       item.setLayoutProperties(
>                                                                       QxOption.left(obj.getX() + x - dragLeftStart),
>                                                                       QxOption.top(obj.getY() + y - dragTopStart)
>                                                       );
>                                               }
>                                       });
>                                       item.addDragendHandler(new QxDragendHandler() {
>
>                                               public void handleEvent(QxDragendEvent event) {
>                                                       QxOptionMap map = item.getLayoutProperties();
>                                                       obj.setX(map.getIntValue("left"));
>                                                       obj.setY(map.getIntValue("top"));
>                                               }
>                                       });
>
>                                       item.setWidth(obj.getWidth());
>                                       item.setHeight(obj.getHeight());
>                                       slideArea.add(item, QxOption.leftTop(obj.getX(), obj.getY()));
>                               }
-------8<-------

I thign you get the point. I simply record the start position of the
drag and then adjust the layout-left and top corrordinates.

Tom

Am 19.02.10 11:23, schrieb Anaël Ollier:
> I would like to drag the real source widget.
> Actually, a good example of what I would like to achieve is the gadgets
> system from iGoogle. If you try it, you'll see that you can start
> dragging the gadget from any point of its title bar, and then when you
> drag it, the whole component is moving in real-time.
>
> Cheers
> --
> Anaël
> [hidden email] <mailto:[hidden email]>
> The eyeos Project | www.eyeos.org <http://www.eyeos.org> | Web Desktop &
> Cloud Computing Operating System
>
>
> 2010/2/19 Alexander Steitz <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Anaël,
>
>     On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
>     > But unfortunately I already tried this mixin after taking a look
>     at how the
>     > DragDropCursor was implemented. In this situation, the problem is
>     that if
>     > you move your mouse to the bottom right (where the widget is) while
>     > dragging, the dragover nor the dragleave events are fired (maybe
>     because
>     > here again you enter the dragged widget and not the component under).
>     >
>     > And anyway, I'd like to be able to drag the widget from any
>     location within
>     > the widget, and not from the top-left, moreover when this location is
>     > outside the widget (1 pixel above its top side, and one pixel to
>     its left
>     > side, I guess).
>     >
>     > Some other advice maybe? Thanks in advance!
>     Do you need to actually drag widgets around? Or is it possible to
>     just e.g.
>     show a ghost or something like that to show the user he's currently
>     dragging
>     something around.
>
>     cheers,
>      Alex
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     qooxdoo-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Siarhei Barysiuk
Hi Anaël,

Just found your post in archive and would like to ask if you did come up with a solutions for the problem. 

Thanks,
Siarhei

On Feb 24, 2010, at 5:04 PM, Anaël Ollier wrote:

*Bump*

Sorry but I'm still stuck on my "no dragover/dragleave" issue. I cannot find a good way to implement this without creating a hack or ugly workaround. If someone has another idea, please let me know!

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Anaël Ollier <[hidden email]>
Hi Tom, thanks for your help on that too,

But if I understand your code, it's the part to manage "I want to be able to start dragging my widget from any position within it", but it does not help me with triggering the dragover/dragleave events. Or does it?
Anyway, it's the solution I thought about but I don't like to create that kind of little workarounds when (I think) it's totally the kind of feature that could be directly integrated into Qooxdoo, to avoid copy-pasting this piece of code everytime you need a D&D.

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Tom Schindl <[hidden email]>

Hi,

Not sure how good you are at reading Java-Code but here is some code
from my current QxWT-Demo-Application.

-------8<-------
slideArea = new QxComposite();
slideArea.setDecorator("main");
slideArea.setLayout(new QxCanvasLayout());
-------8<-------

-------8<-------
> QxImage item = new QxImage(source);
> final DTOSlideObject obj = ....;
> item.setDraggable(true);
>                                       item.addDragstartHandler(new QxDragstartHandler() {
>
>                                               public void handleEvent(QxDragstartEvent event) {
>                                                       event.addAction(Action.MOVE);
>                                                       dragLeftStart = event.getDocumentLeft();
>                                                       dragTopStart = event.getDocumentTop();
>                                               }
>                                       });
>                                       item.addDragHandler(new QxDragHandler() {
>
>                                               public void handleEvent(QxDragEvent event) {
>                                                       int x = event.getDocumentLeft();
>                                                       int y = event.getDocumentTop();
>
>                                                       item.setLayoutProperties(
>                                                                       QxOption.left(obj.getX() + x - dragLeftStart),
>                                                                       QxOption.top(obj.getY() + y - dragTopStart)
>                                                       );
>                                               }
>                                       });
>                                       item.addDragendHandler(new QxDragendHandler() {
>
>                                               public void handleEvent(QxDragendEvent event) {
>                                                       QxOptionMap map = item.getLayoutProperties();
>                                                       obj.setX(map.getIntValue("left"));
>                                                       obj.setY(map.getIntValue("top"));
>                                               }
>                                       });
>
>                                       item.setWidth(obj.getWidth());
>                                       item.setHeight(obj.getHeight());
>                                       slideArea.add(item, QxOption.leftTop(obj.getX(), obj.getY()));
>                               }
-------8<-------

I thign you get the point. I simply record the start position of the
drag and then adjust the layout-left and top corrordinates.

Tom

Am 19.02.10 11:23, schrieb Anaël Ollier:
> I would like to drag the real source widget.
> Actually, a good example of what I would like to achieve is the gadgets
> system from iGoogle. If you try it, you'll see that you can start
> dragging the gadget from any point of its title bar, and then when you
> drag it, the whole component is moving in real-time.
>
> Cheers
> --
> Anaël
> [hidden email] <mailto:[hidden email]>
> The eyeos Project | www.eyeos.org <http://www.eyeos.org> | Web Desktop &
> Cloud Computing Operating System
>
>
> 2010/2/19 Alexander Steitz <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Anaël,
>
>     On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
>     > But unfortunately I already tried this mixin after taking a look
>     at how the
>     > DragDropCursor was implemented. In this situation, the problem is
>     that if
>     > you move your mouse to the bottom right (where the widget is) while
>     > dragging, the dragover nor the dragleave events are fired (maybe
>     because
>     > here again you enter the dragged widget and not the component under).
>     >
>     > And anyway, I'd like to be able to drag the widget from any
>     location within
>     > the widget, and not from the top-left, moreover when this location is
>     > outside the widget (1 pixel above its top side, and one pixel to
>     its left
>     > side, I guess).
>     >
>     > Some other advice maybe? Thanks in advance!
>     Do you need to actually drag widgets around? Or is it possible to
>     just e.g.
>     show a ghost or something like that to show the user he's currently
>     dragging
>     something around.
>
>     cheers,
>      Alex
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     qooxdoo-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Dragging and moving the source object

Anaël Ollier-3
Hi Siarhei,

I didn't unfortunately. And as I'm not working anymore on the related project I'm not searching anymore for a solution. Sorry for that.

Regards
--
Anaël
[hidden email]


2010/6/8 Siarhei Barysiuk <[hidden email]>
Hi Anaël,

Just found your post in archive and would like to ask if you did come up with a solutions for the problem. 

Thanks,
Siarhei

On Feb 24, 2010, at 5:04 PM, Anaël Ollier wrote:

*Bump*

Sorry but I'm still stuck on my "no dragover/dragleave" issue. I cannot find a good way to implement this without creating a hack or ugly workaround. If someone has another idea, please let me know!

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Anaël Ollier <[hidden email]>
Hi Tom, thanks for your help on that too,

But if I understand your code, it's the part to manage "I want to be able to start dragging my widget from any position within it", but it does not help me with triggering the dragover/dragleave events. Or does it?
Anyway, it's the solution I thought about but I don't like to create that kind of little workarounds when (I think) it's totally the kind of feature that could be directly integrated into Qooxdoo, to avoid copy-pasting this piece of code everytime you need a D&D.

Cheers
--
Anaël
[hidden email]
The eyeos Project | www.eyeos.org | Web Desktop & Cloud Computing Operating System


2010/2/19 Tom Schindl <[hidden email]>

Hi,

Not sure how good you are at reading Java-Code but here is some code
from my current QxWT-Demo-Application.

-------8<-------
slideArea = new QxComposite();
slideArea.setDecorator("main");
slideArea.setLayout(new QxCanvasLayout());
-------8<-------

-------8<-------
> QxImage item = new QxImage(source);
> final DTOSlideObject obj = ....;
> item.setDraggable(true);
>                                       item.addDragstartHandler(new QxDragstartHandler() {
>
>                                               public void handleEvent(QxDragstartEvent event) {
>                                                       event.addAction(Action.MOVE);
>                                                       dragLeftStart = event.getDocumentLeft();
>                                                       dragTopStart = event.getDocumentTop();
>                                               }
>                                       });
>                                       item.addDragHandler(new QxDragHandler() {
>
>                                               public void handleEvent(QxDragEvent event) {
>                                                       int x = event.getDocumentLeft();
>                                                       int y = event.getDocumentTop();
>
>                                                       item.setLayoutProperties(
>                                                                       QxOption.left(obj.getX() + x - dragLeftStart),
>                                                                       QxOption.top(obj.getY() + y - dragTopStart)
>                                                       );
>                                               }
>                                       });
>                                       item.addDragendHandler(new QxDragendHandler() {
>
>                                               public void handleEvent(QxDragendEvent event) {
>                                                       QxOptionMap map = item.getLayoutProperties();
>                                                       obj.setX(map.getIntValue("left"));
>                                                       obj.setY(map.getIntValue("top"));
>                                               }
>                                       });
>
>                                       item.setWidth(obj.getWidth());
>                                       item.setHeight(obj.getHeight());
>                                       slideArea.add(item, QxOption.leftTop(obj.getX(), obj.getY()));
>                               }
-------8<-------

I thign you get the point. I simply record the start position of the
drag and then adjust the layout-left and top corrordinates.

Tom

Am 19.02.10 11:23, schrieb Anaël Ollier:
> I would like to drag the real source widget.
> Actually, a good example of what I would like to achieve is the gadgets
> system from iGoogle. If you try it, you'll see that you can start
> dragging the gadget from any point of its title bar, and then when you
> drag it, the whole component is moving in real-time.
>
> Cheers
> --
> Anaël
> [hidden email] <mailto:[hidden email]>
> The eyeos Project | www.eyeos.org <http://www.eyeos.org> | Web Desktop &
> Cloud Computing Operating System
>
>
> 2010/2/19 Alexander Steitz <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Anaël,
>
>     On Wednesday February 17 2010 16:38:59 Anaël Ollier wrote:
>     > But unfortunately I already tried this mixin after taking a look
>     at how the
>     > DragDropCursor was implemented. In this situation, the problem is
>     that if
>     > you move your mouse to the bottom right (where the widget is) while
>     > dragging, the dragover nor the dragleave events are fired (maybe
>     because
>     > here again you enter the dragged widget and not the component under).
>     >
>     > And anyway, I'd like to be able to drag the widget from any
>     location within
>     > the widget, and not from the top-left, moreover when this location is
>     > outside the widget (1 pixel above its top side, and one pixel to
>     its left
>     > side, I guess).
>     >
>     > Some other advice maybe? Thanks in advance!
>     Do you need to actually drag widgets around? Or is it possible to
>     just e.g.
>     show a ghost or something like that to show the user he's currently
>     dragging
>     something around.
>
>     cheers,
>      Alex
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     qooxdoo-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                                        geschaeftsfuehrer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel