drag

What's preserving local offset in this d3.drag example?

ⅰ亾dé卋堺 提交于 2019-11-29 15:01:00
When dragging any circle in this d3 example , what prevents the circle's center from snapping to the mouse? In other words: when you initiate a circle drag by clicking somewhere near the outer edges of the circle , what in the code preserves the offset (relative to the circle's center) that's implied at drag start? I see these .attr() calls: .attr("cx", d.x = d3.event.x) .attr("cy", d.y = d3.event.y) But I expect d3.event.x (and .y ) to be the coordinates of the mouse — without accounting for the offset — and therefore I would think that the circle's center would (incorrectly, from a UX point

Dragging UIView under finger [duplicate]

放肆的年华 提交于 2019-11-29 14:19:49
问题 This question already has an answer here: How do you make an image follow your finger in objective-c? [closed] 3 answers I want to tap on a UIView and drag and have that view follow my finger, simple enough. But the easiest way of doing this is by setting the objects center to where the tap happened (Which is not what I want), I want it to move as if you grabbed the object wherever you tapped it. There was a very useful way of doing this and it was reference in one of the iTunes U videos. The

Android monkey runner: Touch with MOVE

自闭症网瘾萝莉.ら 提交于 2019-11-29 12:27:31
I am trying to use monkeyrunner to simulate complex touch events. A swipe from a to b with... device.drag((300,500),(300,650),0.5,50) works great but a complex movement from a to b to c doesn't work trying with that device.touch(100,500, 'DOWN') device.touch(300,500, 'MOVE') device.touch(300,400, 'MOVE') device.touch(300,400, 'UP') Was seaching for a solution and found this.. https://android-review.googlesource.com/#/c/50991/ Is this already implemenet in the offical android sdk? or did i have to compile it or something else and how it works? I dont really know but i think this side is the

Android : Get view only on which touch was released

浪尽此生 提交于 2019-11-29 12:17:57
I am in a tricky situation, hope you can help me with it. I have few views (TextViews), horizontally placed one after another in a linear layout. When I press on textview1, drag my finger to any other textview and release touch, I want to be able to get the view(textview) on which the finger was lifted. I went over the TouchListener api, it says that every event starts with a ACTION_DOWN event action. Since other textviews won't fire that event, how can I get the reference to the textViews on which I lifted my finger? I tried it even, and the action_up would fire only on the textView that

(iPhone) how to implement draggable pins using OS 4.0 MapKit?

北战南征 提交于 2019-11-29 08:21:35
问题 Can anyone provide any sample code/instructions for implementing draggable pins in OS 4.0 using the MapKit framework? 回答1: Sure thing buddy (yes I'm talking to myself), In your custom annotation add: @property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate; This satisfies the requirement of implementing setCoordinate, as mentioned inhttp://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html#//apple_ref/occ/instp

How to select multiple controls by mouse-dragging over them

試著忘記壹切 提交于 2019-11-29 07:51:07
I want to be able to drag over a bunch of controls and select those of a certain type (TextBoxes). Once the dragging action has been completed, I want to display an inputbox (yes, I'll have to reference/use the VB .dll) prompting the user for the value that will be entered in each selected TextBox. Can this be done? (of course, but how?) Or is there another way to accomplish the same thing (allow the user to quickly select multiple controls and then perform an action on all of them at once)? Updated: I've got this sort of working - the "caveat" or "gotcha" being that I have to pop up a

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

最后都变了- 提交于 2019-11-29 06:15:59
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 bitbonk The dimension (FrameworkElement.ActualWidth FrameworkElement.ActualHeight) and postion (Canvas.Top, Canvas.Bottom,Canvas.Left, Canvas.Right) of your elements would suffice if they are always rectangular. In that case you can easily calculate if two

Android Google Maps: disable dragging in MapFragment

♀尐吖头ヾ 提交于 2019-11-29 04:24:16
问题 Can I disable drag functionality when the user tries to drag the map with his fingers without disturbing the Zoom in and Zoom out? Any one please suggest an idea of doing this! Thanks for your Precious help!! 回答1: I think here's what you're looking for: Inside Google Maps Android v2 Scroll (pan) gestures A user can scroll (pan) around the map by dragging the map with their finger. You can disable scrolling by calling UiSettings.setScrollGesturesEnabled(boolean). 回答2: You can disable dragging

DragMove() and Maximize

核能气质少年 提交于 2019-11-29 03:53:18
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 solve this problem or where can I find other ways to do proper DragMove of custom window with working

Resize elements by dragging divider handler

允我心安 提交于 2019-11-29 02:45:31
I want to be able to drag a divider up and down to resize the divs above and below the divider on a fixed page height. These divs could be in a table, although they need not be. In short, I would like to be able to emulate what happens on the jsFiddle site, although I only need the vertical resize. jsFiddle have used mooTools, but I want to do it with jQuery. One important complication: I won't know the size of the div above the divider until it is actually built dynamically, so I can't just start with a set absolute positioning. What is the best way forward? I have a feeling I'll just be