Hi Alex

Thanks for your reply but in the showcase example, it is still the item
being dragged that gets to provide all feedback - in showcase, the caret
is positioned relative to the widget being dragged over and it's easy for
the source drag event to get the X & Y because it just checks the
originalTarget; but what if the feedback is based on something more
complex that only the target knows about?  In my case, the target area
represents a period of time (e.g. 8:30am to 18:30) and the precise time
being hovered over is calculated by mouse position; the height of the
target area is variable (EG there is no fixed number of pixels per minute)
and we want the drop to be rounded to the nearest 15 minutes.

In order the for the source item to give feedback on this, it has to know
a lot about the inner workings of the target calendar - and everything
that can be dragged onto the calendar must implement the same logic.

If the showcase had several controls (e.g. two lists and one tree) where
feedback is different depending on the target, all three controls would
have to test for the type of target and then inspect the target to fire
out how to provide feedback.

The Drag event's addAction and addType methods are there to allow the drag
source and drop target controls to be decoupled but AFAICT there is no
such decoupling for providing feedback.

John

On 05/10/2011 13:37, "Alexander Steitz" <[email protected]> wrote:

>On Wednesday 05 October 2011 10:27:21 John Spackman wrote:
>> I'm writing a custom widget to display a calendar (think Outlook or
>>Google
>> Calendar) and using drag & drop to rearrange the calendar entries; when
>> dragging the entry, I want to give feedback saying what time the entry
>> will be moved to.  I've created a widget to act as a "caret" to say what
>> time you're hovering over and I want to update that every time the mouse
>> moves during the drag.
>Did you already took a look at the DragDropCursor class? This widget can
>be 
>used for showing feedback during the drag session.
>
>Another example is at the showcase application. Within the class
>
>       "showcase.page.dragdrop.Content"
>
>a custom drag&drop cursor is implemented. Maybe this implementation can
>help 
>you further.
>
>> The problem is that the time of day that the event will be moved to
>>must be
>> calculated from the mouse offset but the "dragover" event is fired only
>> once as you enter a new target widget, not every time the mouse moves;
>>by
>> contrast, the "drag" event is fired on the source widget every mouse
>>move.
>This problem is solved in the "showcase" application with the help of the
>"drag" event. At every "drag" event the position of the feedback widget
>is 
>updated.
>
>> It's difficult (or very inelegant) to provide fine-grained feedback
>>based
>> on the drop location ­ my solution so far is to pass the calendar
>>entry's
>> "drag" event to the target, but this is a problem when dragging between
>> different targets so I'll also have to find the control currently under
>> the mouse and find the "real" target.
>> 
>> Is there a better way?
>Hope the example in the "showcase" application will help you.
>
>Regards,
>  Alex
>
>--------------------------------------------------------------------------
>----
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.
>http://p.sf.net/sfu/splunk-d2dcopy1
>_______________________________________________
>qooxdoo-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to