Pages: 1
Print
Author Topic: Using xft form functions in external Macros  (Read 2236 times)
jan.kostelansky@aerosofts
Member

Posts: 5


« on: April 09, 2014, 08:16:35 AM »

Hi all,

Say I have my .NET project with XMetal Macros ( On_Document_Save.js , On_Enter.js and etc) and some XFT forms I'm using. In one of the forms inside the Declarations Event I defined a function MyFunction();

How can I call this function from the XMetal Macros?

Thanks you,
AeroSoft Systems Inc.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: July 09, 2014, 12:46:03 PM »

I'm attaching an example that shows how this can be done.

I've tested it with XMetaL Author Enterprise version 9 but it should work with previous releases (probably back to version 3) and with XMetaL Author Essential. It should also work with XMAX though the macro the launches the XFT would need to be modified in that case so the form could be found.

Installation:
1. Download and unzip the file named controlXFTfromMacro.zip
2. Copy example.xft to the Forms subfolder in your XMetaL Author (Enterprise or Essential) installation.
3. Copy example.mcr to the Startup subfolder in your XMetaL Author (Enterprise or Essential) installation.

Running the Example:
1. Launch XMetaL Author (Enterprise or Essential).
2. Run the macro named "Example Form - Start". This will launch the form.
3. Click the button on the form. This is a standard button and just shows that the XFT is working as it should. It should display an alert box containing the text "Button Clicked".
4. Run the macro named "Example Form - Click Hidden Button". This shows how you can control objects on a form from a macro. It should display an alert box containing the text "Hidden button clicked!". The macro "clicks" the button on the form and that displays the alert.
5. Run the macro named "Example Form - Run Internal Function". This shows how you can pass information from a macro into a form. It should display an alert box containing the text "Passing this string into the XFT function named 'formExposeFn'." That string is defined in the macro and passed into the form.

See comments in the MCR file for explanations on the code in each macro.

* controlXFTfromMacro.zip (1.34 KB - downloaded 223 times.)
« Last Edit: July 09, 2014, 12:48:53 PM by Derek Read » Logged
Pages: 1
Print
Jump to: