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

Comments

  1. I might be wrong, but I thought that the touch events would be exposed in Delphi XE5.

    ReplyDelete
  2. In general yes, but not for THTMLViewer.

    ReplyDelete
  3. I don't know this component but maybe you can make your own scrollbar and hide theirs?

    ReplyDelete
  4. Warren 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.

    ReplyDelete
  5. So add one? Open up the source and add a recognizer object. Hook up mouse up, down, and move events.

    ReplyDelete
  6. I thought I have to reimplement OnGesture. But reacting on mouse events could be another approach ... that's closer to my skill level :)

    ReplyDelete
  7. Thank 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. :)

    ReplyDelete
  8. There are additional window messages for multi-touch gestures, you can look at the VCL gesture handling to get inspiration.

    ReplyDelete

Post a Comment