drag-and-drop

Using drag and drop with ListView to create an inventory UI

人走茶凉 提交于 2021-02-06 13:48:44
问题 I'd like to create an inventory UI for my game using ListView, where the items can be removed from the inventory by dragging and dropping them in the level. If an item was not dropped properly (still inside the inventory), it should be placed back where it was before the drag. I've got the following code, but I don't know how to achieve what I'm after, even after looking at the Drag and Drop example. import QtQuick 2.3 Rectangle { id: root width: 400 height: 400 ListView { id: listView width:

Drag and drop custom behavior

爷,独闯天下 提交于 2021-02-05 12:19:55
问题 I try to implement this behavior http://jsfiddle.net/Aneeshmohan/qbxfbmtt/ in angular 8. I use angular cdk drag-drop module https://stackblitz.com/edit/angular-4ppaey?file=src%2Fapp%2Fapp.module.ts but I have some problems: $('.dragger').draggable({ revert: "invalid", helper: function () { //Code here return $("<div class='dragger'></div>").append("Hi"); } }); $(".dropper").droppable({ drop: function (event, ui) { $(this) .addClass("ui-state-highlight") .find("p") .html("Dropped!"); var

NSTableView in NSScrollView doesn't autoscroll when dragging

半世苍凉 提交于 2021-02-04 19:46:25
问题 I'm currently implementing drag and drop rearranging in a table view in my OS X app. While normal scrolling works fine, autoscroll while dragging it totally broken. If I grab a cell and start dragging, autoscroll just tells the table to scroll to the top. If I manually scroll using the trackpad during dragging the table continually pops to the top. If I drag one of the top cells, the table will not autoscroll down when dragging near the bottom. I subclassed NSScrollView and overrode the

WPF/C#: Disable Drag & Drop for TextBoxes?

廉价感情. 提交于 2021-02-04 18:11:17
问题 Does anyone have an idea how I can disable Drag & Drop for all my TextBox Elements? I found something here, but that would need me to run a loop for all Elements. 回答1: You can easily wrap what this article describes into a attached property/behaviours... ie. TextBoxManager.AllowDrag="False" (For more information check out these 2 CodeProject articles - Drag and Drop Sample and Glass Effect Samplelink text) Or try out the new Blend SDK's Behaviors UPDATE Also read this article by Bill Kempf

WPF/C#: Disable Drag & Drop for TextBoxes?

依然范特西╮ 提交于 2021-02-04 18:10:05
问题 Does anyone have an idea how I can disable Drag & Drop for all my TextBox Elements? I found something here, but that would need me to run a loop for all Elements. 回答1: You can easily wrap what this article describes into a attached property/behaviours... ie. TextBoxManager.AllowDrag="False" (For more information check out these 2 CodeProject articles - Drag and Drop Sample and Glass Effect Samplelink text) Or try out the new Blend SDK's Behaviors UPDATE Also read this article by Bill Kempf

usage of DragBehavior in Kivy

社会主义新天地 提交于 2021-01-29 11:04:10
问题 I'm new for python and kivy, and struggling with them. I wanted to implement drag and drop function (a function that when a image is dragged to another image and dropped on it, do something.) with kivy. What I want to do are the following three things; know the id of the element that the user has been holding now. know the id of the element that the user is on hover. know the id of the element which was under the pointer when the user has dropped what he had. I thought this would be useful to

Cypress Drag and drop test

落爺英雄遲暮 提交于 2021-01-29 07:09:05
问题 I would like to test the sortable table with Cypress.io I follow their page instruction: https://docs.cypress.io/api/commands/trigger.html#Mouse-Events and it doesn't work... First: it doesn't move the element Second: when I see the step by step test on the left side, mouse down and mouse move are located in the same position... my test cy.get('.resource-filter-table') .trigger('mousedown', {witch:1, pageX:188, pageY:196}) .trigger('mousemove', {witch:1, pageX:188, pageY:261}) .trigger(

Why is the drag animation being repeated in RecyclerView?

可紊 提交于 2021-01-29 05:16:03
问题 The bounty expires in 6 days . Answers to this question are eligible for a +50 reputation bounty. gig6 wants to draw more attention to this question. I am using the ItemTouchHelper class to support drag and drop in my RecyclerView. While I am dragging an item around it visually updates (swaps rows) as expected. Once I drop the item, another **visual** drag occurs. For example (see diagram below) if I drag item "a" from index 0 to index 3, the correct list shows that item "b" is now at index 0

ondragstart not triggering in firefox

↘锁芯ラ 提交于 2021-01-29 03:09:58
问题 Hello I'm trying to use the html drag and drop feature with jquery. I generate my draggable (a button) like this $("#tb > tbody > tr").append(($("<td>")).append($("<input/>", {type:"button", id:"bt", draggable:"true", value:"test", class:"bt-test"}))).append($("</td>")); So far, and after reading a bit on the subject, I'm trying to deal with the different events like this : $(document).on("dragstart", ".bt-test", function(evt) { evt.originalEvent.dataTransfer.setData("text", $(this).val());

Drag Drop Swing to JavaFX not working without debug mode

柔情痞子 提交于 2021-01-28 14:10:23
问题 I have a code that gets a Drag event coming from a Swing application. The code then drop the elements into a JavaFX TableView. This code works perfectly if I run in Debug mode. But it does not work if I run out of Debug. private static final DataFormat customFormat = new DataFormat("application/x-java-serialized-object"); this.setOnDragOver(new EventHandler<DragEvent>() { public void handle(DragEvent event) { event.acceptTransferModes(TransferMode.ANY); event.consume(); } }); this