Touch Support for THTMLViewer
Touch Support for THTMLViewer
We are working on making our applications (developed in Delphi XE5) more touch friendly. There is only one component left that still doesn't support touch: THtmlViewer.
Did anybody already manage to make THTMLViewer touch friendly? We only need to have the scrolling feature (zoom would be nice but is not necessary). Replacing THTMLViewer with other components like TWebBrowser is not an option for us.
Is there any tutorial or guideline for implementing gestures into existing components?
Thanks, Fred
We are working on making our applications (developed in Delphi XE5) more touch friendly. There is only one component left that still doesn't support touch: THtmlViewer.
Did anybody already manage to make THTMLViewer touch friendly? We only need to have the scrolling feature (zoom would be nice but is not necessary). Replacing THTMLViewer with other components like TWebBrowser is not an option for us.
Is there any tutorial or guideline for implementing gestures into existing components?
Thanks, Fred
I might be wrong, but I thought that the touch events would be exposed in Delphi XE5.
ReplyDeleteIn general yes, but not for THTMLViewer.
ReplyDeleteI don't know this component but maybe you can make your own scrollbar and hide theirs?
ReplyDeleteWarren Postma , The scrollbar(s) are working with touch without problem. If the content area of the HTMLViewer had an OnGesture event I could update the existing scrollbars accordingly. But this component doesn't support any gesture or touch events.
ReplyDeleteSo add one? Open up the source and add a recognizer object. Hook up mouse up, down, and move events.
ReplyDeleteI thought I have to reimplement OnGesture. But reacting on mouse events could be another approach ... that's closer to my skill level :)
ReplyDeleteThank you Warren Postma ! Using the normal mouse events solved the problem. Unfortunately this doesn't show the "window shake effect" when the beginning or end of the content has been reached (like the normal VCL controls do while using touch). But I can live without this ... for a while. :)
ReplyDeleteThere are additional window messages for multi-touch gestures, you can look at the VCL gesture handling to get inspiration.
ReplyDelete