drag-and-drop

Why DragHandler exportAsDrag disables my MouseMotionListener?

痞子三分冷 提交于 2019-12-22 03:19:09
问题 I want to realize a simple JComponent-Drag-and-Drop with a preview from O.Reilly-Swing.Hacks Hack 69. Translucent Drag-and-Drop. My Problem is if the TransferHandler start the Drag the MouseMotionListener stop performing mouseDragged(). Here is a little Sample code: A small Window with a green and a red Side. The green Side do not start a Drag, always mouseDragged() is performed but the exportDone() will never reached. The red Side starts a Drag via exportAsDrag(), but after that the

getting the X and Y coordinates for a div element

霸气de小男生 提交于 2019-12-22 03:16:58
问题 I've been trying to make a javascript to get a X and Y coordinates of a div element. After some trying around I have come up with some numbers but I'm not sure how to validate the exact location of them(the script returns the X as 168 and Y as 258) I'm running the script with a screen resolution of 1280 x 800. This is the script I use to get this result: function get_x(div) { var getY; var element = document.getElementById("" + div).offsetHeight; var get_center_screen = screen.width / 2;

Android 3.0 drag-n-drop IllegalArgumentException after 30 actions

女生的网名这么多〃 提交于 2019-12-22 00:35:54
问题 I'm working with android 3.0 drag-n-drop framework. All works fine. But after 30 actions application causes IllegalArgumentException. 09-12 11:17:32.282: WARN/Surface(31132): Not initializing the shared buffer client because token = -12 09-12 11:17:32.282: ERROR/View(31132): Unable to initiate drag 09-12 11:17:32.282: ERROR/View(31132): java.lang.IllegalArgumentException 09-12 11:17:32.282: ERROR/View(31132): at android.view.Surface.lockCanvasNative(Native Method) 09-12 11:17:32.282: ERROR

Dragging and Dropping a button from one Linear Layout to another Linear Layout

懵懂的女人 提交于 2019-12-22 00:22:51
问题 I have a linear linear layout with 10 buttons in it. I need to drag these buttons and add it into another linear layout(Horizontal) in the order they are dropped. Please help me in doing this? 回答1: I have some suggestions on how to do drag-drop in apps running on API level 8 up and beyond. I studied the source code for the Android Launcher module and learned about the drag-drop framework they put in place for that. I have found that is a good foundation on which to build. I have written up

How to set multiple items into a GtkSelection for Treeview drag and drop

淺唱寂寞╮ 提交于 2019-12-21 23:57:14
问题 My current project uses a Gtk.TreeView to display the contents of a ListView with four fields per row, two strings, an int and a boolean . I'm trying to implement drag and drop rearrangement of rows in the TreeView. I don't want simply to use TreeView.set_reorderable(True) for the built-in drag and drop because I want to have some control over the insertion and deletion of data from the model as well as to be able to implement undo/redo of drag and drop operations. I'm using Python 3.2 and

DragEventListener not working on Samsung S7 (6.0)

丶灬走出姿态 提交于 2019-12-21 23:44:26
问题 I'm looking for a direction to go with this one. I have a card melding game (Five Kings) which has been up for about 6 months; my latest version 0.9.22 has been stable since March. However, recently I have been getting reports of users unable to drag discards to the discard pile, and the common thread seems to be Samsung S7 with Android 6.0 . When you drag a card from your hand, the places you can drag turn transparent and when you drag over them they go back to normal (alpha=1). Other places

Qt Drag and Drop to windows explorer: How do I know the dropped destination path

你离开我真会死。 提交于 2019-12-21 23:43:38
问题 What I'm trying to do is to display a listview of online files, just like an FTP client lists all the files on the FTP server, and one can drag any row or rows to any local folder to save the dragged files right there. I'm planning to implement this through the follwing steps: init the drag event, and save the selected files' path on the server [done] subclass QMimeData class, and overwrite retrieveData function just as this thread suggests here [done] Just finish the drag and drop process,

How to create a drag and drop similar to safari toolbar customisation for iPad

好久不见. 提交于 2019-12-21 21:27:11
问题 I have a UIViewController that has both a UITable and a UIView on it. I want to be able to pick up items that are displayed in the UIView and drop them on to a cell in the UITableView.I have had to revert to using touch events as opposed to the new UIGestureRecognisers to take a snap shot of the UIView tapped so that this snap shot is dragged over to the UITableView as opposed to the UIView touched. This works great using the following, -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent

Can't add any items to activity_main.xml in Android Studio

微笑、不失礼 提交于 2019-12-21 21:27:07
问题 In Android Studio, I can't add any items from Palette to activity_main.xml in Design view. It just won't let me drag and drop them. Any idea why this happens? Here is the PrintScreen: 回答1: According to new design method followed in android studio for android development you cannot add any elements to the activity_main.xml. Rather you should add them to content_main.xml. You can learn more about it from this answer. 回答2: You can stop it from happening. Answered by BNK: If you create a new

Drag and Drop view between two Fragments

主宰稳场 提交于 2019-12-21 21:09:28
问题 I'm currently trying to implement Drag and Drop between two Fragments. I already added them both to my Activity like this FragmentManager fm = getFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.add(R.id.leftContainer, new MainActivityFragment()); ft.add(R.id.rightContainer, new CartFragment()); ft.commit(); I have several CardViews in my MainActivityFragment. I'd like to drag them over to a ListView in my CartFragment. Then I'd add a new item to this ListView after the