# AccuTerm GUI Template / Macro Format

Updated: 1/19/2021, 8:38:14 PM
Created: 1/19/2021, 8:38:14 PM
Last Updated By: Ryan Medina
Read Time: 4 minute(s)

The template generated by the AccuTerm GUI Designer is actually a macro consisting only of Create and SetProp commands. A macro generated by the ATGUIBEGINMACRO / ATGUIENDMACRO routines, may also include Method commands (Reset, Clear, Show, Hide, Activate, Insert, Remove, Enable, Disable, Move).

A macro is stored as a dynamic array where the first line is a header, the second line is a Context set command, and the last line is a Context restore command. Lines in between the Context set and Context restore may consist of Create, SetProp and Method commands. Macros may be nested within other macros, however, the nested macro header is not included in the nesting macro. The nested Context commands are included. This allows a macro recorded in one coordinate system to be "played" correctly in another coordinate system.

Each command (line) in the macro is a multi-valued string with the first value being the command code (GC... constants defined in ATGUIEQUATES). Other values are defined by the particular command and may include sub-valued fields.

Items that are new with GUI version 1.2 are shown in blue text.

# The Macro Header (first line in macro)

value 1 "TEMPLATE" or "MACRO"
value 2 time/date stamp (date.time form). The exact value not critical and is used to validate locally cached macros. When a macro or template is updated, this value must be updated to a different value for caching to function correctly.
value 3 permanent macro ID (optional) - if specified it is used to form the filename for the locally cached copy of the macro. If it is omitted, the macro is not cached.
value 4 associated program file and item ID (optional) - used by the GUI designer to open the wED code editor for the program associated with a GUI project. The filename is stored in subvalue 1, the item ID in sub-value 2. Sub-value 3 is the code style, used by the code generator. The style is matched against the Style setting in the Info section of the code template files in the GUILIB folder. Sub-value 4 is the code casing preference used by the code generator (0 = upper case, 1 = lower case, 2 = mixed case).

# Context set command (second line in macro)

value 1 GCCONTEXT (0)
value 2 version of GUI system which created the macro (ATGUIVERSION constant in ATGUIEQUATES).
value 3 coordinate scale for commands in macro

# Context restore command (last line in macro)

value 1 GCCONTEXT (0)
value 2 -1

# Create command

value 1 GCCREATE (2)
value 2 ID of object being created (AppID or AppIDFormID or AppIDFormID*ControlID)
value 3 ID of object's parent control (null if parent is form or app)
value 4 object type (use the GX... constants in ATGUIEQUATES)
value 5 left
value 6 top
value 7 width
value 8 height
value 9 event mask (formed by adding desired GE... constants in ATGUIEQUATES together).

# SetProp command

value 1 GCSETPROP (4)
value 2 Object ID. ID is formed by concatenating the App ID, Form ID and Control ID using an asterisk (*) to separate the fields. To set an item property, the Item ID is the fourth field.
value 3 property code (use the GP... constants in ATGUIEQUATES)
value 4 column (usually zero, but may be non-zero when setting a single element of an array property).
value 5 row (usually zero, but may be non-zero when setting a row (or single element) of an array property).
values 6+ property value. Some properties support multiple columns and/or rows. These are included here.

# Mehod command

value 1 GCMETHOD (6)
value 2 Object ID
value 3 method code (use the GM...constants in ATGUIEQUATES)
value 4 method argument(s)