Search code examples
delphiscrollfiremonkeydelphi-10.1-berlin

Disable the scroll temporarily ,of a TvertScrollBox component in Delphi?


I am making an application for IOS and Android devices in Delphi Rad Studio XE10.1 Berlin, and I have a problem.

In a form, I have a TvertScrollbox, and within it, there is many components to display, and one of them is a Tlistview.

The problem is, when I make a scroll in the Tlistview, because there is more data that shows, also makes a scroll in the TvertScrollbox, which in the end is impossible to visualize the data correctly.

Is there any way to disable the scroll of the TvertScrollbox temporarily, and then enable again?

I hope I have explained well. My English is very bad, Thank you.


Solution

  • Yes you can disable the TvertScrollbox by simply putting AniCalculations.TouchTracking := [] and then put it back to AniCalculations.TouchTracking := [ttVertical]

    I made a TvertscollBox that implement all of this kind of behavior (deactivate the scroll when child object are scrolling), and that also correct some other bug ... the source code is too big to copy past here, so you can see it directly here :

    (svn) https://svn.code.sf.net/p/alcinoe/code/

    look the unit ALFmxLayouts

    if you want to see a demo of the scroll deactivation look the project /demos/alfmxControls/ or load directly https://sourceforge.net/p/alcinoe/code/HEAD/tree/demos/ALFmxControls/Android/Release/ALFmxControls/bin/ALFmxControls.apk?format=raw or the shorten variant if you need to write it manually in android: http:// tinyurl .com/zsamrbn (url of the compiled apk to install on android) in the demo you can see a tabcontrol, when you scroll on it, the scroll of the vertscrollbox is deactivated