drag

How to catch that map panning and zoom are really finished?

北战南征 提交于 2019-11-28 05:08:00
I am trying to write an application that will dynamically load data to map while user pans or zooms it. I need to track when the map is finished to change its view state (stops panning or zooming) and then load a new portion of data for creating markers. But in fact Google Maps API doesn't have any events to handle this. There are some methods like creating an empty overlay to control onTouch events and so on, but map panning could last long after user finished his touch because GMaps use some kind of inertia to make the pan smoother. I tried to subclass MapView but its draw() method is final

Click and drag selection box in WPF

妖精的绣舞 提交于 2019-11-28 03:36:14
Is it possible to implement mouse click and drag selection box in WPF. Should it be done through simply drawing a rectangle, calculating coordinates of its points and evaluating position of other objects inside this box? Or are there some other ways? Could you give a bit of sample code or a link? Here is sample code for a simple technique that I have used in the past to draw a drag selection box. XAML: <Window x:Class="DragSelectionBox.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300"

How can i check if 2 controls overlap eachother on a canvas in WPF?

ε祈祈猫儿з 提交于 2019-11-27 23:50:32
问题 I am writing a designer that enables the user to drag controls around the screen. What would be the best way of detecting if a control is overlapping another control while i am dragging the one control around? Should i just get the dimensions of the FrameworkElement and keep on checking the dimensions of the other elements? Thanks. Eli 回答1: The dimension (FrameworkElement.ActualWidth FrameworkElement.ActualHeight) and postion (Canvas.Top, Canvas.Bottom,Canvas.Left, Canvas.Right) of your

How to set the Origin (drag.origin) for drag behavior in d3 JavaScript library

﹥>﹥吖頭↗ 提交于 2019-11-27 23:07:08
I am trying to implement drag behavior for group consisting from HTML-text and background-rectangle using the d3 framework. I was able to get it working, although when not setting the drag.origin I can see noticeable jump due to the mouse-position/element-coordinates offset. Exactly how described on the d3 wiki-page Although the page described how to set the Origin for dragging, I do not properly understand how ti implement it in my example. I tried two different approaches : using the element for grouping the elements together and defining new element holding tose. In the first case I have to

Drag and move a picture inside a JLabel with mouseclick

家住魔仙堡 提交于 2019-11-27 19:28:57
问题 I have an image inside a JLabel. JLabel label = new JLabel(new ImageIcon("C:\\image.jpg")); label.setSize(300,300); I want the following functionality. -I click on a location inside the JLabel (on the image). -With the mousebutton pressed, I can change the location of the image within the JLabel. (I drag the picture to different positions within the JLabel) Well, this means that in many instances the picture will be cropped and outside of view. Please tell me how to implement this

DragMove() and Maximize

…衆ロ難τιáo~ 提交于 2019-11-27 17:53:45
问题 I have a problem with my custom window (AllowTransparency, WindowStyle=None) in WPF. DragMove() method works good, but when I maximize window, or it maximizing automatically by Windows 7 Aero Snap, this method does not work at all. So I can't unsnap window with mouse drag and return it state to WindowState.Normal. Left and Right Aero Snap works good, I can snap and unsnap window without a problem. But when it maximized, nothing works except Win+Down combination. Maybe somebody knows how to

How to get notified of UITableViewCell move start and end?

孤人 提交于 2019-11-27 11:48:10
I have a UITableView in my iOS app that gets refreshed periodically. The user is also able to move the tableview rows at all times (the tableview is always in editing mode). I want to stop the refresh timer when the user starts dragging a row and start it again when the row is dropped. The last part should be easy with moveRowAtIndexPath , but how to get notified about drag start? Your UITableViewDelegate will receive the following notifications in response to reordering actions: - (void)tableView:(UITableView *)tableView willBeginReorderingRowAtIndexPath:(NSIndexPath *)indexPath; - (void

Drag objects in canvas

蓝咒 提交于 2019-11-27 10:57:47
问题 Im looking for an easy to use method of assigning drag behavior to multiple objects (images, shapes etc) in canvas. Does anyone have a good way or know of any libraries for dragging objects around? Thanks 回答1: Creating your own mouse events takes a little work - ideally you should either create or use some kind of mini-library. I'm thinking of creating something like this in the near future. Anyway, I created a drag and drop demo on jsFiddle showing how to drag images - you can view it here.

How to mimic two-finger scroll/drag gesture on ios simulator?

老子叫甜甜 提交于 2019-11-27 09:57:27
问题 I have a scroll page that I specified two fingers minimum. It works on my device, but don't know how to mimic this gesture on Simulator. I can mimic one-finger scroll without problem. I've tried option/ctrl/shift etc, but couldn't get it work. Maybe my combination is wrong. Anyone knows how? Thanks. 回答1: Holding the "Alt/Option" key and dragging simulates multi-touch pinch-to-zoom. Holding "Alt/Option + Shift" and dragging simulates multi-touch scrolling. 回答2: There is a nice table with all

Drag and Drop from JButton to JComponent in Java

送分小仙女□ 提交于 2019-11-27 09:08:47
I searched on the internet for examples how to Drag and Drop JButtons to an Object but I could not make it work. What my program does, is that when I click on a button, the object updated a field (with a selectedobject.setField()). I want to be able to do this not by clicking, but by dragging the JButton. How can I do this ? I found this, and I tried to put in my code: btn.setTransferHandler(new ImageHandler()); btn.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { JComponent c = (JComponent)e.getSource(); TransferHandler handler = c.getTransferHandler(); handler