Macro GUI
Macro GUI is AdvantageBuilder’s HTML‑based user interface system. Macro GUI pages are mini web applications built using HTML, CSS, and JavaScript, and launched directly from Main Macros. They allow you to create forms, dashboards, wizards, data entry screens, and interactive tools.
What Macro GUI Is
Macro GUI consists of HTML files stored under the MacroGUI folder in the Macros ‑ GUI tab. These files are edited using the HTML GUI Editor, which is a default text editor for HTML, CSS, JavaScript, or any other text file.
Macro GUI pages run inside AdvantageBuilder’s embedded browser engine (legacy or Edge mode depending on which launch function is used).
Launching Macro GUI Pages
Macro GUI pages are displayed using one of the following functions:
- showHTMLForm(url)
- launchHTMLForm(url)
- launchHTMLFormEdge(url)
These functions show the GUI page to the user.
Choosing the Browser Engine
- launchHTMLForm – uses the legacy browser engine
- launchHTMLFormEdge – uses the Edge WebView engine
Loading HTML Documents (Not Displayed)
The following functions load HTML documents for parsing or processing, but do not display them:
- loadHTMLDocument(url)
- loadHTMLDocumentEdge(url)
These return an HTMLDocument or HtmlAgilityPack document, allowing you to:
- read HTML content
- extract values
- modify DOM nodes
- process data offline
They are strictly for document access, not UI display.
Passing Parameters to Macro GUI
AdvantageBuilder supports three mechanisms for passing parameters from Main Macros to GUI pages. These mechanisms can be used independently or together.
1. Query Strings
Append ?key=value pairs to the URL. Access them in the GUI using:
QueryString["Planet"]
2. GUI Parameters
Use the GUI Parameters Object Model to store values:
var p = eval(getSourceCode('GUIParameters', 'Macro Main Helpers\\Library', 'GUIParameters'));
p.Add('City', 'New York');
p.Save();
Access them in the GUI using:
macroGUIParams["City"]
3. Macro Arguments
Pass a JavaScript object directly to the launch function:
var args = { StreetName: "George", StreetNumber: "45" };
launchHTMLForm(url, args);
Access them in the GUI using:
args.StreetName
Macro GUI Helpers
Macro GUI Helpers are tools that generate HTML files for you. They appear under the Macro GUI Helpers folder in the Macros - Main tab.
Examples include:
- Create Data Entry Page
- Create Data Search Page
- Create New Blank Page
These helpers create starter HTML/CSS/JS files that you can then edit in the HTML GUI Editor.
They do not load or display HTML documents, and they are not related to
loadHTMLDocument or loadHTMLDocumentEdge.
HTML GUI Editor
The HTML GUI Editor is a default text editor for Macro GUI files. It allows you to edit:
- HTML
- CSS
- JavaScript
- Any other text file
The HTML Editor is the primary tool for creating and editing Macro GUI HTML files. It provides several productivity features through its toolbar, making it especially effective when building HTML based user interfaces.
HTML Auto Code
A typing minimisation feature that provides a hierarchical pop-up menu containing commonly used HTML elements. Simply point and click to insert the selected element's source code directly into your document.
JScript Snippet Library
Contains a collection of reusable JScript code snippets. These snippets can be inserted into your HTML or JavaScript files to speed up development and reduce repetitive coding.
Editor Snippet Library
Provides a collection of ready-to-use code snippets, including complete HTML document templates and core techniques. Some of the more important templates and techniques include:
- GUI Form Common - A shell HTML document designed for files stored in the Common folder. It references all standard script and stylesheet files located in the Common folder.
- GUI Form Specific - A shell HTML document designed for files stored in any folder other than Common. It also references all required script and stylesheet files from the Common folder.
- Parameters - A technique for accessing parameters passed into the HTML document from the Main Macro.
- Query Strings - A technique for accessing data passed into the HTML document via query string from the Main Macro.
- DB Search - A technique for running SQL queries directly from your HTML document using the active database connection, and displaying the results.