Click/drag panning with TDBChart/ TChart - delphi

is there any way to implement a draggable TChart which pans/ moves on click and drag? At the moment it is zooming to the area selected; can this be changed to work like you'd expect on a touch screen? Thanks, Toby

By default, zooming is active and set to be used drawing a zooming rectangle with the left mouse button. And the scroll is set to be used dragging the chart with the right mouse button.
To change this behaviour, you can disable the zooming and change the scroll button:
Chart1.Zoom.Allow:=false;
Chart1.ScrollMouseButton:=mbLeft;

Related

How to identify on iOS if user enabled zoom accessibility feature?

Is there a way to identify programmatically if the user has the "zoom" accessibility feature toggled on?
I'm referring to the feature where you can:
Double-tap three fingers to toggle zoom on off
Drag with three finger to change scroll area of the screen.
Use two fingers to scroll on current area of the screen.
When zoom is toggle on and screen is zoomed there is no change in UIScreen.main.scale
Something similar to UAZoomEnabled from the MacOs UniversalAccess.

Fro the map view zoom out in UI testing not working

For the UI Test case I need to "zoom out" in the map view. When using pinch zoom out code it only moves map to the left.
let app = XCUIApplication()
app.maps.element.pinch(withScale: 0.9, velocity: -0.5)
Dose someone knows how to achieve "zoom out" functionality in the UI Testing?
I want to notice that "zoom in" works fine.
The problem is that one finger of the simulated pinch gesture is falling on the status bar, so only the other finger is registered.
You can solve the problem in your example project by adding the following to ViewController.swift:
override var prefersStatusBarHidden: Bool {
return true
}
When zooming out, the UI test system seems to simulate a pinch from the very top left and bottom right of the view, constrained to the edges of the screen. This doesn't seem to take the status bar into account, and so the top-left touch falls on the status bar and is ignored, and only the bottom-right touch is registered by the view, causing the pinch to become instead a drag up and left. This isn't just with maps, it seems to be an issue with all scroll views.
If you do want to display the status bar on top of the view, you may need to figure out another way to constrain your pinch to not fall on the status bar. In my case, I was fine simply removing the status bar.

How do I make my UITextView autoscroll when dragging caret to the edge of view?

In the iOS's Notes app, I wrote very long text on the TextView,
then I long press on the view, bring up the magnifier loupe, drag it to the bottom of screen (or top of the keyboard, if it is activated), the TextView will automatically scroll up.
How can I implement this with UITextView?
I tried
Add a UILongPressGestureRecognizer to my UITextView subclass, but its action never get called.
Override touchesMoved:withEvent: method in my UITextView subclass, but this method will not be called after the magnifier loupe appears.
You don't implement it; that's standard behaviour.
The magnifier scrolling occurs when you drag the magnifier off the bottom or off the top of the UITextView, or when you're close on the edge, about 10 pixels? (best to test this in the simulator where to have exact-control over the touch-position). If your text view is full-screen you may not be able to drag to a position outside the view, and the touch-region for scrolling may just be too small.
Notice in the Notes app that to scroll down you can drag the magnifier onto the tabs at the bottom. To go up you can drag it into the title. So long as you hold the touch outside the view it'll scroll.
All this also means your view can't go behind the keyboard when it's present. You need to resize the UITextView when the keyboard appears to get the scrolling to work.

How to pinch out in iOS simulator when map view is only a portion of the screen?

I have a view on the iPad that I'm adding an MKMapView to that is say half the height of the full screen. However, when I try to pinch out on the iOS Simulator it doesn't work since the to nubs fill the entire iPad view on the simulator.
And so, with the map view half the screen and I press the Option key on the keyboard I cannot grab the map to pinch out.
Anyone know how to handle this?
You can move the two gray circles that represent your fingers around the screen by holding Option and Shift and moving the mouse.
Try double tapping with the option key pressed. On the iPhone this causes the MKMapView to zoom out.
Only pressing the alt key made the two gray dots representing your fingers appear for me...
2022 UPDATE
To zoom in
alt/option + pinch in using mouse
Alternate option: control + click (This will place a gray circle on the map, now you can click and drag your mouse to zoom in and out.
If you want to disable it, just click on the circle again)
To zoom out
alt/option + pinch out using mouse
To get flat view of the map
Zoom to an area in map then Shift + alt/option + click and drag mouse
Updated Solution:
Holding Option and Command gives you 2 finger vectors that spread out and in. Holding the mouse button down on the way in will pinch in and visa versa for spreading out.
Double click, hold, drag finger.
You can use Option (Alt) button or combination of Option button and command button along with mouse movement to zoom in and zoom out a map or an image.
There is another way to do this:
1- While holding the control key click with the mouse on where you would like to center the pinch gesture. This will cause one gray dot to remain on the screen. (Once its there, you can let go of the control key)
2- Now you can use the mouse to click and drag around the gray dot you specified in step 1
Once you are done you can remove the gray dot by tapping on it
For Zooming in double tap using mouse.
For Zooming out press and hold on option/alt key this will give you 2 grey circles which represents your 2 fingers and drag your mouse up.
To Zoom in drag your mouse down with option key pressed(or double tap on mouse)

Best method to scroll a ScrollPane by mouse hover location in actionscript?

When mouse nears top edge of scrollpane, it scrolls up until it reaches the top only interrupted if the mouse leaves the top edge area.
Same for bottom edge.
You need to make a symbol that you can write AS code on that is invisible (set alpha to 0) and lies in the area you want to have the desired behavior to occur.
make sure its a button symbol
on the mouseover for your hidden symbol you tell your pane to scroll.
on the mouseout for your hidden symbol you tell your pane to stop scrolling.
Keep your hidden symbols on a higher layer than your scroll pane.

Resources