Questions tagged [drag]

In computer graphical user interfaces, drag is the first phase of a drag-and-drop operation. This involves selecting a virtual object by "grabbing" it and dragging it with the mouse down to a different location or onto another virtual object. An instance of some object relating to what was grabbed is usually brought with the drag operation.

In computer graphical user interfaces, drag is the first phase of a drag-and-drop operation. This involves selecting a virtual object by "grabbing" it and dragging it with the mouse down to a different location or onto another virtual object. An instance of some object relating to what was grabbed is usually brought with the drag operation.

2133 questions
15
votes
8 answers

How to drag a UserControl inside a Canvas

I have a Canvas in which user can add UserControl subclasses containing a form. User should be able to drag these UserControl around the Canvas. What's the best practice to do this with WPF?
loris
  • 203
  • 1
  • 2
  • 6
14
votes
1 answer

drag and resize a shape in react-native

im new to react-native and overhelmed with all the options in the www. thats why i'm a bit confused how to complete this task in the best possible way. i want to make something similar to this, but in react-native. A square-shape, which i can drag…
ptrus
  • 141
  • 1
  • 5
14
votes
6 answers

DragMove() and Maximize

I have a problem with my custom window (AllowTransparency, WindowStyle=None) in WPF. DragMove() method works good, but when I maximize window, or it maximizing automatically by Windows 7 Aero Snap, this method does not work at all. So I can't unsnap…
Igor Ostancov
  • 143
  • 1
  • 1
  • 4
13
votes
2 answers

javascript + html5 canvas: drawing instead of dragging/scrolling on mobile devices?

I'm using a html5 canvas + some javascript (onmousedown/move/up) to create simple draw pad on a webpage. Works OK in Opera, Firefox, Chrome, etc (tried on desktop PCs). But if I visit this page with an iPhone, when trying to draw on the canvas,…
Sheldon Pinkman
  • 1,086
  • 4
  • 15
  • 21
13
votes
2 answers

Dragging the view

I have an NSView which I am adding as a sub-view of another NSView. I want to be able to drag the first NSView around the parent view. I have some code that is partially working but there's an issue with the NSView moving in the opposite direction…
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137
13
votes
3 answers

JavaScript how to check drag direction

I am trying to monitor dragStart and dragEvent javascript, in order to conclude its direction, UP or DOWN. However i could not get any detail in arguments passed by the event -- that help to conclude. Is there any better way to check drag direction…
iwan
  • 7,269
  • 18
  • 48
  • 66
13
votes
2 answers

how to disable dragend animation in html5

I created a draggable element by setting its draggable attribute. When I drop the element, there is an animation of the element snapping back to its origin position: How can the snap-back animation be disabled? I tried calling preventDefault() on…
user1861806
  • 131
  • 1
  • 5
13
votes
3 answers

D3.js: Remove force.drag from a selection

I have a (rather simple) question: How to "un-call" force.drag on a selection made by D3.js? Let's say I created a set of elements and called "call" on it, giving it the drag-callback of a force-directed layout. That looked like this: …
user654123
  • 465
  • 6
  • 19
12
votes
4 answers

Jquery ui, call start drag manually

In Jquery UI I can configure an element as draggable by invoking $("#drag").draggable(); But is there a way to start and stop the drag functions manually from another function? Ie someOtherFunction = function() { …
Jan
  • 5,688
  • 3
  • 27
  • 44
12
votes
2 answers

SwiftUI onDrag. How to provide multiple NSItemProviders?

In SwiftUI on MacOs, when implementing onDrop(of supportedTypes: [String], isTargeted: Binding?, perform action: @escaping ([NSItemProvider]) -> Bool) -> some View we receive an array of NSItemProvider and this makes it possible to drop…
Shoni Fari
  • 197
  • 8
12
votes
2 answers

How can i check if 2 controls overlap eachother on a canvas in WPF?

I am writing a designer that enables the user to drag controls around the screen. What would be the best way of detecting if a control is overlapping another control while i am dragging the one control around? Should i just get the dimensions of the…
Eli Perpinyal
  • 1,706
  • 3
  • 19
  • 35
11
votes
3 answers

Handle click and drag movement to scroll horizontally with mootools or jquery

Is there an easy way to handle the movement event composed of click and drag to the left or to the right on a div, in order to do a classic slider. The idea is to do something similar to the scrolling of iphone apps but with left mouse click.
Agorilla
  • 323
  • 1
  • 2
  • 9
11
votes
2 answers

Resizing Handles on a Rotated Element

I'm trying to put resizing handles on the four corners of a rectangle, which can be dragged to resize the rectangle. What I'm having trouble with is calculating the new width, new height, and new points of the rectangle after I've dragged one of the…
Nick Budden
  • 621
  • 9
  • 20
11
votes
5 answers

Simple drag and drop code

Im struggling with seemingly a simple javascript exercise, writing a vanilla drag and drop. I think Im making a mistake with my 'addeventlisteners', here is the code: var ele = document.getElementsByClassName ("target")[0]; var stateMouseDown =…
Kayote
  • 14,579
  • 25
  • 85
  • 144
10
votes
2 answers

How to detect that a control is being moved?

Suppose I have a window with a custom UserControl, and the UserControl has a textbox inside. When I drag the window around, how can the TextBox detect that it is being moved ? I tried to search around its RenderTransform property, there is that…
Mohamed
  • 121
  • 1
  • 7