drag-and-drop

Make <div> resizeable

会有一股神秘感。 提交于 2019-12-17 07:25:29
问题 Is there a way to make a <div> container resizeable with drag'n'drop? So that the user can change the size of it using drag'n'drop? Any help would really be appreciated! 回答1: The best method would be to use CSS3. It supported by at least Webkit and Gecko. According to the w3c spec: div.my_class { resize:both; overflow:auto; /* something other than visible */ } Webkit and Firefox do not interpret the specs the same way. In Webkit the size is limited to the width and height set. There's another

Java: mouseDragged and moving around in a graphical interface

时光毁灭记忆、已成空白 提交于 2019-12-17 06:54:12
问题 newbie programmer here. I'm making a program that renders user-inputted equations in a Cartesian coordinate system. At the moment I'm having some issues with letting the user move the view around freely in the coordinate. Currently with mouseDragged the user can drag the view around a bit, but once the user releases the mouse and tries to move the view again the origin snaps back to the current position of the mouse cursor. What is the best way to let the user move around freely? Thanks in

WPF C#: Rearrange items in listbox via drag and drop

不打扰是莪最后的温柔 提交于 2019-12-17 05:40:51
问题 I am trying to figure out how to move the items in a pre-populated listbox up and down via mouse drags. I have looked at the Control.DoDragDrop method from microsoft's api, but I still can't get it to do anything. I would appreciate any help since I am new to the visual studios environment. 回答1: i've tried create one using observablecollection, have a look ObservableCollection<Emp> _empList = new ObservableCollection<Emp>(); public Window1() { InitializeComponent(); _empList .Add(new Emp("1",

WPF C#: Rearrange items in listbox via drag and drop

╄→гoц情女王★ 提交于 2019-12-17 05:40:16
问题 I am trying to figure out how to move the items in a pre-populated listbox up and down via mouse drags. I have looked at the Control.DoDragDrop method from microsoft's api, but I still can't get it to do anything. I would appreciate any help since I am new to the visual studios environment. 回答1: i've tried create one using observablecollection, have a look ObservableCollection<Emp> _empList = new ObservableCollection<Emp>(); public Window1() { InitializeComponent(); _empList .Add(new Emp("1",

java drag and drop

≯℡__Kan透↙ 提交于 2019-12-17 05:14:20
问题 I try to get familar with drag and drop in java but all the tutorials I found were... (getting me angry) All I want is to drag a "PublicUserLabel" from a JList (included in a selfmade JPanel called "UserPanel") and drop it in a selfmade class inerited from JTabbedPanel. It is very important to drag the object itself and not its stringrepresentation!!! That is what I have so far: PublicUserLabel public class PublicUserLabel extends JLabel implements DragSourceListener, DragGestureListener,

Drag and Drop custom object from JList into JLabel

人走茶凉 提交于 2019-12-17 04:35:25
问题 I have a JList containing an ArrayList of custom objects and I'm trying to create a drag and drop into fields. I'm having trouble understanding how to package and receive the object in Transferable. This is about as far as I've gotten: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; public class FlightProjectInterface extends JFrame{ //create GUI Objects private JFrame primaryFrame; private JPanel createFlightPanel; private

How to simulate HTML5 Drag and Drop in Selenium Webdriver?

为君一笑 提交于 2019-12-17 03:38:54
问题 I am using Python 2.7 and Selenium 2.44. I want to automate drag and drop action in Selenium WD but according to other related posts Actions in HTML5 are not supported by Selenium yet. Is there any way to simulate drag and drop in Python? Here is the code I tried: driver = webdriver.Firefox() driver.get("http://html5demos.com/drag") target = driver.find_element_by_id("one") source = driver.find_element_by_id("bin") actionChains = ActionChains(driver) actionChains.drag_and_drop(target, source)

C# Drag drop does not work on windows 7

佐手、 提交于 2019-12-17 03:35:30
问题 I have had a project for quite a while using C# winforms. I implemented a drag-drop function before windows 7 was released. Worked like a charm. However, when using windows 7 it does not work. The event doesn't even get triggered. AllowDrop is set to true. When subscribing to DragEnter it does not get called in windows 7 (not sure about vista). But on XP it works all the way. The program is run with administritave priviliges. Is there any difference in the drag drop in windows 7 vs xp? Don't

Does HTML5 allow drag-drop upload of folders or a folder tree?

橙三吉。 提交于 2019-12-17 02:26:49
问题 I haven't seen any examples that do this. Is this not allowed in the API spec? I am searching for an easy drag-drop solution for uploading an entire folder tree of photos. 回答1: It's now possible, thanks to Chrome >= 21. function traverseFileTree(item, path) { path = path || ""; if (item.isFile) { // Get file item.file(function(file) { console.log("File:", path + file.name); }); } else if (item.isDirectory) { // Get folder contents var dirReader = item.createReader(); dirReader.readEntries

Does anyone know of a low level (no frameworks) example of a drag & drop, re-order-able list?

人走茶凉 提交于 2019-12-17 02:00:16
问题 I am looking for code (any language) of a basic graphical list which can be reordered by drag and drop. So exactly this functionality http://jqueryui.com/sortable/ but written directly on the frame buffer/canvas without any frameworks (or low level 'put pixel' libraries at most) and probably not in HTML/JS (unless it's Canvas only without CSS). The simpler the better as I will be using it in assembler and I don't want to reinvent the wheel if not needed. 回答1: heh I hate frameworks so this is