drag-and-drop

How to move items smoothly in wxPython?

ε祈祈猫儿з 提交于 2019-12-20 03:51:32
问题 I am trying to drag and drop a button, with the following code in wxPython, however, the drag flickers, and feels jarring, and I'm not sure why -- or how to fix it. I've pored over the wxWidgets docs, but can't seem to find out what the problem is. Thanks in advance! import wx app = wx.App(False) d = {} def wMouseDown(e): print "!!!", e.GetEventObject() def MouseDown(e): o = e.GetEventObject() sx,sy = panel.ScreenToClient(o.GetPositionTuple()) dx,dy = panel.ScreenToClient(wx.GetMousePosition(

Drag and drop right click wpf

亡梦爱人 提交于 2019-12-20 03:49:15
问题 When I start a drag and drop using a right click in WPF it will fire the drop on any target with out waiting for the right mouse button to come up. 回答1: To drag, the mouse needs to be captured, which can only be achieved when the left mouse button is down. See http://msdn.microsoft.com/en-us/library/system.windows.uielement.capturemouse(VS.95).aspx (for Silverlight, but I think it's similar). 来源: https://stackoverflow.com/questions/1060856/drag-and-drop-right-click-wpf

Drag n Drop inside QgraphicsView doesn't work (PyQt)

谁说胖子不能爱 提交于 2019-12-20 03:21:46
问题 I created a custom class for some buttons. Those are a "draggable" buttons, which its name indicates, are buttons that you can drag and drop into each other (depending if is allowDrag property is set) and then make an action. The code of those dragbuttons is already posted here: Drag n Drop Button and Drop-down menu PyQt/Qt designer Apparently the buttons work well when they are in a QWidget, but when they are added into a scene of a QGraphicsView (I also made a custom class of it) the drop

Tree - drag&drop nodes - refresh?

六眼飞鱼酱① 提交于 2019-12-20 03:21:46
问题 I have a problem related to a smartgwt Tree structure. I'm creating a Tree (called nodesTree ) with values from a DB, and each node has a name set up. For ex I'm having 4 nodes (the numbers are the names of the nodes): 1 2 3 4 for (TreeNode node : nodesTree.getAllNodes()) System.out.print(node.getName()); Output: 1 2 3 4 If I drag node 4 under node 1(at the same level as 2) 1 2 4 3 I want to have the order of nodes: 1 2 4 3 but if I repeat the above "for" statement the output will be the same

Drag and drop a path in a wpf

懵懂的女人 提交于 2019-12-20 03:03:04
问题 Is it possible to drag and drop a path in a wpf using Mouse Eventhandlers? In partcular I want to drag a path with the left mouse button and to mouse it on the grid. How can this be done? 回答1: Try this: Given: TextBox name is "TextBox1" public MainWindow() { // Initialize UI InitializeComponent(); // Loaded event this.Loaded += delegate { TextBox1.AllowDrop = true; TextBox1.PreviewDragEnter += TextBox1PreviewDragEnter; TextBox1.PreviewDragOver += TextBox1PreviewDragOver; TextBox1.Drop +=

WPF Drag and Drop - Get original source info from DragEventArgs

扶醉桌前 提交于 2019-12-19 20:47:31
问题 I am trying write Drag and Drop functionality using MVVM which will allow me to drag PersonModel objects from one ListView to another. This is almost working but I need to be able to get the ItemsSource of the source ListView from the DragEventArgs which I cant figure out how to do. private void OnHandleDrop(DragEventArgs e) { if (e.Data != null && e.Data.GetDataPresent("myFormat")) { var person = e.Data.GetData("myFormat") as PersonModel; //Gets the ItemsSource of the source ListView .. /

Html5 Drag and Drop Mouse Position in Firefox

元气小坏坏 提交于 2019-12-19 18:15:32
问题 I have an HTML5 application which utilizes drag and drop. Essentially the user can drag an image from a "drawer" onto a canvas to create a larger image. I want the elements to drop in the place where they were release. I have this working in all browsers except Firefox. On the drop event, I am using the following to get the coordinates of the mouse, and calculate the position of the dropped image within the canvas. var top = evt.originalEvent.offsetX; var left = evt.originalEvent.offsetY; The

Html5 Drag and Drop Mouse Position in Firefox

限于喜欢 提交于 2019-12-19 18:12:40
问题 I have an HTML5 application which utilizes drag and drop. Essentially the user can drag an image from a "drawer" onto a canvas to create a larger image. I want the elements to drop in the place where they were release. I have this working in all browsers except Firefox. On the drop event, I am using the following to get the coordinates of the mouse, and calculate the position of the dropped image within the canvas. var top = evt.originalEvent.offsetX; var left = evt.originalEvent.offsetY; The

Html5 Drag and Drop Mouse Position in Firefox

*爱你&永不变心* 提交于 2019-12-19 18:12:10
问题 I have an HTML5 application which utilizes drag and drop. Essentially the user can drag an image from a "drawer" onto a canvas to create a larger image. I want the elements to drop in the place where they were release. I have this working in all browsers except Firefox. On the drop event, I am using the following to get the coordinates of the mouse, and calculate the position of the dropped image within the canvas. var top = evt.originalEvent.offsetX; var left = evt.originalEvent.offsetY; The

JsTree v3.0 drag and drop plugin. Reference target node upon dropping

佐手、 提交于 2019-12-19 17:38:14
问题 I use drag and drop plugin of jsTree library (ver. 3.0) With the following code I can bind to the end of drag'n'drop action, but I can not see a way to get the reference to the target node (the node I'm dropping on). $(document).on('dnd_stop.vakata', function(e, data) { // how to get target_node here? }); 回答1: Another solution is to use the get_node() function on the jstree object. $(document).on('dnd_stop.vakata', function (e, data) { ref = $('#jstree').jstree(true); parents = ref.get_node