General XMetaL Discussion
[email protected] April 9, 2014 at 2:16 pm
Using xft form functions in external MacrosApril 9, 2014 at 2:16 pmParticipants 0Replies 1Last Activity 8 years, 10 months ago
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?
AeroSoft Systems Inc.Derek Read July 9, 2014 at 6:46 pm
Reply to: Using xft form functions in external MacrosJuly 9, 2014 at 6:46 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.
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.
- You must be logged in to reply to this topic.