dnd

SWT DropTargetListener has empty event data under Mac OS X

I'm currently experiencing a weird platform inconsistency between Mac OS X and Windows/Linux. I've implemented an SWT DropTargetListener and tried to analyze the data dropped in the dragEnter method. Unfortunately, the data attribute of the TransferData contained in the DropTargetEvent parameter is always null on OS X (but becomes valid...

SWT Drag and Drop support for Text widget

I've written an application recently using SWT. In one of its dialog box, I have a few widgets, one of which is Text, which is designed to support DND with other widgets. I've first added DND support for the 2 Tree widgets on the same dialog box (both drag source and drop target). Before I added DND support for that Text widget, I notice...

Law of Demeter doesn't make sense in my case

Looking on this answer I understand that you should not copy private pointers using friendship in C++ like I did in my program: class bar; class foo { private: some_smart_pointer<int> state; public: foo(int value) : state(new int(value)) {} friend class baz; }; class bar { private: some_weak_pointer<int> state; public: ...

Dojo Drag and drop: how to format a dropped item?

I'm using Dojo trying to build an application with dojo's dnd. I've looked around for an answer to this problem but I'm just not sure how to accomplish this. I have a Source object in which there are a bunch of products formatted with html/css in a certain way. When I drag these objects to my Target object, the dropped item still looks t...

dojo drag and drop: don't want to sort items

I have a dojo.dnd Source object that I just want to list out normally, without the user being able to sort the objects. Is this possible? ...

Dojo: Is there an event after drag & drop finished

I've got two dojo.dnd.Sources with items. Whenever an item is dropped I need to persist the new order of the items in the Sources using an xhr. Is there an dojo event or topic that is fired after an dnd operation has (successfully) finished? What would be the best way to use it? ...

Dragging dnd items generates "this.manager.nodes[i] is null"

I use Dojo 1.3.1, essentially under FF3.5 for now. I have a dnd source which is also a target. I programmatically add some nodes inside, by cloning template items. The aim for the user is then to use dnd to order the items. It is ok for one or two actions, then I got the "this.manager.nodes[i] is null" error in Firebug, then no more dnd...

Dojo dnd: Avatar positioning

Is it possible to change the positioning of the avatar with dojo toolkit's dnd api? At the moment, when dragging, the avatar of the dragged item appears to the right and below the mouse cursor. I want it to be in the same position as the mouse cursor. I ran some usability tests on my application, and most people seem to attempt to try an...

Detecting drops from the same process

Hi there, Is it possible for a class implementing DropTargetListener, to detect whether the stuff being dragged comes from the same process of from elsewere? ...

dojo - mouse(x, y) - drag and drop - frustration.

I'm attempting to drag an object using dojo.dnd but want the avatar to be in the same position as the object was (relative to the mouse) i.e. if a person clicks in the middle of the object then the mouse cursor will be in the middle of the avatar. I've had all sorts of strange results. if i connect a function to body.onmousemove the d...

GWT DnD: Keep draggable within an AbsolutePanel

I made a MultiSlider widget using the GWT and the gwt-dnd addon to rate texts. On the screenshot, you can see the slider button with value 50 dragged outside the slider bar. It can't be dropped outside the bar, but it can be dragged outside of it. Is there a way in GWT to always keep the slider buttons inside the slider bar? EDIT: T...

Make dijit.form.TextBox TARGET of dojo dnd action

Hi there, I am new to dojo so i’ll need help. I’ll be very thankful if u can halp me. I am experimenting with dojo dnd and i have a problem to solve. I cannot find a way to make dijit.form.TextBox to be the Target of a dnd action. Can u tell me a way how to autofill the textbox with the dragged item(text)? My goal is when I drop the tex...

how to find a dnd.source

Some design specs require for the avatar to be under the mouse cursor when the item is dropped. to get around this i can easily check the drop position to see if the item was dropped within a source andprogramatically insert the node(s). My problem is trying to get a reference of type dnd.Source for the source that was dropped into. H...

GWT DnD: Is it possible to drag disabled widgets?

I have a composite widget that contains a disabled TextArea on an AbsotutePanel. Now I want to be able to drag the composite widget, starting from anywhere on it, including the disabled text area. Is that possible? ...

dojo.dnd one item at a time only

Hi, Using dojo.dnd, I want to allow a user to drag only one item at a time, rather than any arbitrary number, as per the dojo's default behaviour. At the moment, a user can hold Ctrl and click multiple draggable items at a time, then drag them all as a group. I want to disable this so that the user can only drag one item at any given ...

Two DropTarget in the same class does not work (Java) ?

I have two Jlist in the same class each with DnD drop enable. The problem is whatever file I DnD from my desktop to the JLists either number of or number 2 will populate ( and appear ) in JList1. Jlist2 accepts the drag and drop but it is like the content is going to Jlist1 automatically. Any idea on how to solve that ? ...

Dojo DnD: how to access newly copied node on onDndDrop event?

Hi. I am working on code like the following. 01: var c1 = new dojo.dnd.Source('container1', {copyOnly:true}); // container1 is a div 02: var c2 = new dojo.dnd.Source('container2'); // container2 is a div 03: var list = []; 04: for (var i = 0; i < 3; i++) { list.push( dojo.create('div') ); } 05: c1.insertNodes(false, li...

dojo drag and drop and key handlers

Hi all, I have a dojo.dnd.Source container with multiple dnd items. I'd like to give the user the option to select one of the dnd items in the source and then use their backwards/forwards keys to navigate to other items in the source. I've tried setting onkeyup/onkeydown handlers on the dnd items, but they don't seem to fire. I've also ...

Different UI for Dojo DND than when item is displayed

I have a set of items that can be dragged / dropped using Dojo DND, that part has already been implemented and all is working well. The specific question I have is that I'd like to display very different data both in terms of content and visually while the item is being dragged than the initial view of the item, which is what is present...

Dojo DnD Move Node Programmatically

I would like to know if there is a way to move the node programmatically in dojo Dnd? The reason is I would like to revert the changes to the drag and drop when the web service call triggered a failed save on the database. Here is what I have so far. In my code, the node Id seems to be unrecognized by the dojo.dnd.Container.DelItem. I c...