VL Windows Signature Capture

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
AndrewLPV
Posts: 8
Joined: Fri Nov 02, 2018 1:44 pm

VL Windows Signature Capture

Post by AndrewLPV »

I am trying to capture a person's signature in a box in a VL form (rendered with DirectX). This will eventually be used in an application running on a Windows tablet with finger or capacitive touch stylus.

I thought of using an MS Paint ActiveX, but that doesn't exist. I have tried using VL touch events in a panel, and tracing it with iterations of the VL static control, but that doesn't work very well for this requirement. I have thought of researching and purchasing some sort of software for this, but that may cause an issue with my customer.

Does anyone have any solutions or suggestions for this?
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: VL Windows Signature Capture

Post by MarkDale »

One way to approach this might be to add an activeX web page into the application, and then use HTML and javascript to do the signature capture.

If you search for "signature capture html5" there are html examples that might be able to do what you want.

You might be able to control it using buttons within the html. Or, if needed, there is a way that VL-win programs can communicate with a web page in an activex.
AndrewLPV
Posts: 8
Joined: Fri Nov 02, 2018 1:44 pm

Re: VL Windows Signature Capture

Post by AndrewLPV »

This looks like a good suggestion, and I will give it a try. In the meantime, I am running into a problem defining a browser component to use in my VL IDE for use in a Window form. It may have something to do with my IDE running on a Windows virtual machine, but I haven’t confirmed that yet. I’ll post my signature solution description once I am done with it.
AndrewLPV
Posts: 8
Joined: Fri Nov 02, 2018 1:44 pm

Re: VL Windows Signature Capture

Post by AndrewLPV »

I have found a couple of suitable signature capture js’s that use Canvas, but when I try to use them in VL’s VA_WEBCTL ActiveX control, it complains that “Object doesn’t support property or method ‘getContext’”. I’m assuming that the VA_WEBCTL control may be at a version that doesn’t yet support Canvas. canvas seems to be the current darling of signature capture. When I try to register a different ActiveX to VL, I get a terminal error in VL and it crashes — but that’s a whole different issue.

Given this, is there a js that might work for me that does not use Canvas and works with the browser version of VA_WEBCTL?
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: VL Windows Signature Capture

Post by MarkDale »

I think it might be possible to get canvas to work inside a web browser activeX.

I can display this html in a web browser control in VLF-WIN.

Code: Select all

<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
	</head>
<body>

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>

<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
</script>

</body>
</html>
I need to put the html file in my local host images directory, and it needs to contain the line with: content="IE-edge", but if I do that I can display the canvas line, inside the activeX, inside a VLF-WIN application.

In visual lansa I am doing this:

Code: Select all

Define_Com Class(#DF_WEBAC.WebBrowser) Name(#WEBBROWSER) Displayposition(1) Height(290) Hint(*MTXTDF_WEBBR) Left(0) Parent(#BODY_PANEL) Tabposition(1) Top(0) Width(512) Visualstyleofparent(False)
...

#uUrl := 'http://localhost:8083/images/MyCanvas.htm'
Invoke Method(#WEBBROWSER.Navigate) Url(#uURL)
The trick with the activeX control is that the web page thinks it is running in IE7, but actually it has access to the later features (in IE11 in my case).

Anyway give it a try (and remember to clear your IE cache)
Post Reply