Hi Thomas,

there are two parts to your question: First, as you found out, there's 
the actual drag and drop mouse cursor, defined in the Appearance theme. 
You can change this by creating your own custom Appearance with an entry 
called e.g. "dragdrop-cursor-mod" that looks like "dragdrop-cursor" in 
qx.theme.modern.Appearance but references your own images. In your 
application code, you can then call 
qx.ui.core.DragDropCursor.getInstance().setAppearance("dragdrop-cursor-mod") 
to apply it.

The other aspect is the drag feedback image, i.e. the "copy" of the list 
item being dragged in the showcase demo. You can take a look at 
showcase/source/class/showcase/page/dragdrop/Content.js to see how it's 
done, but the gist of it is that a single feedback widget 
(this.__dragFeedback) is used for all drag operations on the list:

       this.__dragFeedback = dragFeedback;
       dragFeedback.setOpacity(0.5);
       dragFeedback.setZIndex(500);
       dragFeedback.addState("selected");
       dragFeedback.setLayoutProperties({left: -1000, top: -1000});
       qx.core.Init.getApplication().getRoot().add(dragFeedback);

Note how it's hidden outside of the visible area. Next, listeners are 
added to the various drag and drop-related events fired by the drag 
target (the list on the left):
When the "dragStart" event is fired, the values of the dragged list 
item's icon, label and width properties are read and copied to the 
dragFeedback item.
The "drag" event listener sets the the dragFeedback widget's position to 
the current position of the mouse pointer (read from the mouse event data).
Finally, the "dragEnd" event listener moves the feedback widget out of 
the viewport again.


Regards,
Daniel

t_s schrieb:
> Ok, maybe it's a stupid question, but I've tried several ways to change the
> image-source-file of the dragdrop-cursor and did not succeed.
> It is easily possible to change the image-source of the cursor in
> Appearance.js under "dragdrop-cursor".
> 
> But: How can I change the image-source of the "dragdrop-cursor" during
> runtime in my application?
> 
> All I want to do is something like in the demo:
> http://demo.qooxdoo.org/current/showcase
> under "Drag & Drop" where the cursor transforms into the image that is being
> dragged.
> 
> Maybe somebody has a code snippet?
> 
> Help will be appreciated...
> 
> Greetings, thomas


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to