drag-and-drop

SetCursor while dragging files into a window

时光毁灭记忆、已成空白 提交于 2021-02-19 08:01:28
问题 I'm using windows API to create an application with a window only, so everything inside this window is drawn using Direct2D. Now I want to drop some files in specific parts of my window's client area, and I'm handling the message WM_DROPFILES . No problem here, when the files are dropped in those specific areas, I can treat them correctly and everything is working properly. BTW, my window is DragAcceptFiles(hWnd, true) , it always accepts drag/drops. I want the mouse cursor to be different

adding ondragstart handler to dynamically created images

巧了我就是萌 提交于 2021-02-19 08:00:32
问题 I'm trying to add a ondragstart handler to my dynamically created image: var image = new Image(); image.src = "https://www.filepicker.io/api/file/JhJKMtnRDW9uLYcnkRKW"; image.onload = function(event){ this.ondragstart = drag(event); divImage.appendChild(this); }; function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); } However, I get the error: Uncaught TypeError: Cannot call method 'setData' of undefined I have tried this with a static image that I load via the dom and it works

How to change mouse cursor during drag and drop?

▼魔方 西西 提交于 2021-02-19 06:35:10
问题 Background: I have a C# winforms application. I am dragging information from one datagridview to another. For my drag over event on the destination grid, I have the following code: private void grid_DragOver(object sender, DragEventArgs e) { if(e.Data.GetDataPresent(typeof(SelectedRecordsCollection))) { e.Effect = DragDropEffects.Move; } } I want to limit the drop to only be allowed when the mouse is hovered over particular rows (say, rows with an odd index number). I currently limit what I

Handling drag and drop files in a running Windows console application

谁说我不能喝 提交于 2021-02-19 01:06:24
问题 First, to clarify, I am not asking how to drag-and-drop a file onto an exe's icon. I want to know how to handle drag and drop onto an already running win32 console application. I'm also not asking how to handle drag and drop inside of WinMain based applications through the Windows message pump. I want to do this inside of a program with the entry point int main() that doesn't have a WndProc (yet) or anything. That said, I'm wondering if my goal is achievable (and hoping that it is). I have a

Drag drop with handle

China☆狼群 提交于 2021-02-17 21:23:34
问题 I have a div which contains a span that is 16x16px. I want the drag event to start when user clicks and drags this icon but it should drag the whole div. I'm trying to follow this tutorial here: http://www.html5rocks.com/en/tutorials/dnd/basics/ I cant figureout how to do this with a handle. Please adivise. 回答1: I have slightly modified SaphuA's answer to allow highlighting text. The trick is not to add the draggable attribute until the drag handle gets the mousedown event. Here's a demo:

Drag and drop not working using Actions when draggable=true using Selenium and C#

拥有回忆 提交于 2021-02-13 17:37:38
问题 Elements are identified correctly and i can see mouse moving between this two elements but drag and drop not happening. Ui not displayed any highlights when click and hold. No errors also. I have tried different solutions suggested on different discussions none of them working for me My code _actions = new Actions(Driver.WebDriver); var dragAndDrop = _actions.ClickAndHold(parentRow) .MoveToElement(childRow ) .Release(target) .Build(); dragAndDrop.Perform(); Driver.Wait(); This is how i am

How to upload multiple files using dropzone.js?

杀马特。学长 韩版系。学妹 提交于 2021-02-11 13:35:19
问题 My problem is when i drag & drop multiple file that time each image called particulate ajax. I want to multiple file upload time only one ajax call. I want to choose single one file drag & drop it in dropzone after another file drag & drop it so not replace file to first one I need both of theme and click on button that time save in folder at one time ajax call. Here is my code HTML file <link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/min/dropzone.min.css" rel="stylesheet">

drag & drop current element JS

巧了我就是萌 提交于 2021-02-11 12:31:29
问题 I have 2 divs and 2 paragraphs. Could someone say how could I put paragraph in current div? Example: 1paragraph --> 1div, but 1paragraph can't go to 2div. 2paragraph --> 2div, but 2paragraph can't go to 1div. My Code: var dragClass, dropClass; function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text", ev.target.id); } function drop(ev) { var data = ev.dataTransfer.getData("Text"); ev.target.appendChild(document.getElementById(data)); ev.preventDefault(

How to draw control while is moved in a Drag-and-drop event

时间秒杀一切 提交于 2021-02-11 10:02:30
问题 In Vb.net, through Drag and Drop events, a control (button) is moved from a Panel to another Panel. Is there any way or option to draw the control (button) while is being moved by cursor? Now I have only reached to change cursor shape, and when the action of Drag and Drop is finished, the control is drawn in its new panel parent. Thanks in advance. Edit: Added code public Sub New() InitializeComponent() '…. Panel1.AllowDrop = True Panel2.AllowDrop = True AddHandler Panel1.DragEnter, AddressOf

ExtJS Drag and Drop in tree on modern toolkit

做~自己de王妃 提交于 2021-02-11 08:07:21
问题 Actually I'm going to implement a tree view, where the user should have the option to reorder the structure with drag and drop. Actually I can't figure out how to enable drag and drop. I found a lot of examples using the 'treeviewdragdrop' plugin, which is just working with the classic toolkit. The following Code made me move the first node but not more. this.toParentSource = new Ext.drag.Source({ element: this.getView().element.down('.x-gridcell'), constrain: { element: this.getView().body,