Closed GoogleCodeExporter closed 9 years ago
Look for "// changed here" in the attached for the code changes. I've left the
old lines commented out below for comparison. Perhaps the option for proxies to
follow the mouse directly could be built into the library?
Original comment by cknow...@gmail.com
on 28 Sep 2010 at 5:48
How about this hack?
protected Widget newDragProxy(DragContext context) {
AbsolutePanel container = new AbsolutePanel();
container.getElement().getStyle().setProperty("overflow", "visible");
container.setPixelSize(100, 100);
Label w = new Label(context.selectedWidgets.size() + " item(s)");
RootPanel.get().add(w, -200, -200); // add off screen to get dimensions
int x = context.mouseX - context.draggable.getAbsoluteLeft() - w.getOffsetWidth() / 2;
int y = context.mouseY - context.draggable.getAbsoluteTop() - w.getOffsetHeight() / 2;
container.add(w, x, y);
return container;
}
Original comment by fredsa@google.com
on 29 Sep 2010 at 8:46
Just changed this in the code and it doesn't work. I updated the setPixelSize
to be the size the drag proxy will be.
The draggable object is quite wide and if you start the drag in the middle of
the object and drag the proxy over to the left or the right, the proxy stops
before it's even close to the edge of the window showing that it's contained in
something much larger than itself.
I'm going back to my attached code for now since it works for the situations we
need just unfortunately a bit untidy having to put classes in the gwt-dnd
package.
Original comment by cknow...@gmail.com
on 30 Sep 2010 at 3:07
Feel free to run modified version of gwt-dnd to suit your needs.
Hopefully the recent migration to a git repository will make this easier, since
you can easily clone the responsitory and pull patches from it into your clone.
Original comment by fredsa
on 31 Jan 2012 at 6:22
Original issue reported on code.google.com by
cknow...@gmail.com
on 28 Sep 2010 at 5:46Attachments: