drag-and-drop

What's the best way to structure this Linq-to-Events Drag & Drop code?

南笙酒味 提交于 2020-01-12 08:39:33
问题 I am trying to handle a drag & drop interaction, which involves mouse down, mouse move, and mouse up. Here is a simplified repro of my solution that: on mouse down, creates an ellipse and adds it to a canvas on mouse move, repositions the ellipse to follow the mouse on mouse up, changes the colour of the canvas so that it's obvious which one you're dragging. var mouseDown = Observable.FromEvent<MouseButtonEventArgs>(canvas, "MouseLeftButtonDown"); var mouseUp = Observable.FromEvent

On Drag Listener multiple IF statements

偶尔善良 提交于 2020-01-12 06:00:01
问题 I'm making a Letter Drag n Drop game (kinda like Guess the Brand) where you have an image and you have to drag the letters into layouts to form the correct answer. At the top, I have Four layouts (layoutAnsw A to D), and in the bottom I have Four buttons (btnTop A to D) I have the OnTouchListener and OnDragListener working fine, except one single thing. What happens when I have more than one similar character (letter)? For example in this image: As you can see, I have to "A" letters that need

drag and drop, prevent awkward highlighting?

亡梦爱人 提交于 2020-01-12 05:26:06
问题 I'm building a drag and drop method, using query -onmousedown leading to -onmousemove (drag) then -onmouseup (unbinds onmousemove) the problem is, browser defaults begin highlighting onmousemove, which flies all over the page and cancels the event, rendering it unusable. any idea how to prevent highlighting, for preventDefault seems not to be working. here is my code (yes its very sloppy, sorry!) $(".middleRow").mousedown(function(){ calculateSelection(); $('body').append('<div class=

Drag and drop UIViews with Box2d (iOS) [closed]

主宰稳场 提交于 2020-01-11 14:44:46
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I recently found a nice tutorial for enabling physics with Box2d for iOS. http://www.cocoanetics.com/2010/05/physics-101-uikit-app-with-box2d-for-gravity/ I'm just wondering how to implement drag and drop for a

Drag and drop UIViews with Box2d (iOS) [closed]

妖精的绣舞 提交于 2020-01-11 14:43:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I recently found a nice tutorial for enabling physics with Box2d for iOS. http://www.cocoanetics.com/2010/05/physics-101-uikit-app-with-box2d-for-gravity/ I'm just wondering how to implement drag and drop for a

c# Drag and Drop from my custom app to notepad

末鹿安然 提交于 2020-01-11 09:37:09
问题 I have a custom app which needs to support Drag and Drop. On Dragging the grid in my app, in its DoDragDrop method I have provided the object to be dropped in a serialized format. When the drop is to one of my apps, it is able to deserailize the string and create the object. What I want to do is allow the source app to be able to drop into NotePad/TextPad as well. I can see that I can drag and drop files from windows explorer to Notepad , but am not able to drag and drop plain text to NotePad

jQuery UI draggable to smaller droppable

无人久伴 提交于 2020-01-11 06:11:34
问题 I am using this http://jqueryui.com/demos/droppable/ But I have a problem dragging to a droppable that is smaller than the draggable. It will not drop on the droppable, but on the top left of the droppable. (source: yart.com.au) Is there any way around this? Here is the code, thanks. $('.draggable').draggable({ revert: 'invalid', revertDuration: 500, appendTo: 'body', helper: function(event, ui) { return $(this).clone().appendTo('body').css('zIndex', 5).show(); }, drag: function(event, ui) {

setDragImage on Safari Crashes Unexpectedly

拥有回忆 提交于 2020-01-11 03:59:26
问题 I am having difficulties determining why Safari 6.0+ crashes unexpectedly when trying to use the setDragImage() method. I have a dragstart event and I would like to attach a background image while this is occuring. The documented way to go about this is to utilize the setDragImage() method on the event wireup. This works perfectly fine in Firefox and Chrome. I know this is possible because when I run this website with the Safari browser the drag image works perfectly. However, in my simple

WPF: Drag and drop virtual files into Windows explorer

▼魔方 西西 提交于 2020-01-10 19:15:20
问题 I'm developing an application similar to dropbox and i show the remote files on a WPF listview. I want to drag those elements and drop it into windows explorer. I've seen code like this: var dataObject = new DataObject(DataFormats.FileDrop, files.ToArray()); dataObject.SetData(DataFormats.StringFormat, dataObject); DoDragDrop(dataObject, DragDropEffects.Copy); But as you may think, those file are not at the local system yet, before copiying them I need to connect to server, donwload and unzip

WPF: Drag and drop virtual files into Windows explorer

蓝咒 提交于 2020-01-10 19:15:18
问题 I'm developing an application similar to dropbox and i show the remote files on a WPF listview. I want to drag those elements and drop it into windows explorer. I've seen code like this: var dataObject = new DataObject(DataFormats.FileDrop, files.ToArray()); dataObject.SetData(DataFormats.StringFormat, dataObject); DoDragDrop(dataObject, DragDropEffects.Copy); But as you may think, those file are not at the local system yet, before copiying them I need to connect to server, donwload and unzip