Context: HL Kit Kit Reference Script Types
Initial Context: Template Alternate Context: None Fields Finalized? Yes Where Used: Templates Procedure Use: None
The Header script utilizes the following special symbols:
-None- There are no special symbols for a Header script
The Header script behaves very similarly to the Position script. This script's purpose is to handle the sizing and positioning of visual elements in one specific situation. When the same template is used within a table for positioning both items and a header, the Header script serves to position the header portals. If two separate templates are used for items versus header, the Position script for each is used and the Header script is not employed.
Although the behaviors are similar, the Header script is distinct from the Position script in a variety of ways. First of all, portals within the template that are designated as "isheader" are only accessible via the Header script, hence the name. Second, the Header script is invoked after the normal Position script. This allows the header contents to be sized and positioned relative to the final locations for non-header portals. To make this easy, the Header script can access both header and non-header portals, although any positioning changes to non-header portals is ignored.
For more details, please see the section on dual-purpose headers.
We'll assume that there are two fields within each item of the table that we want to put a simple header above. Let's call them "damage" and "range", and each is shown within its own portal. These two portals are positioned via the Position script, so the Header script will position the header labels directly above those portals.
~our header height is the height of our labels height = portal[hdrdamage].height ~if this is a "sizing" calculation, we're done if (issizing <> 0) then done endif ~each of our header labels has the same width as the corresponding data beneath portal[hdrdamage].width = portal[damage].width portal[hdrrange].width = portal[range].width ~center each header label on the corresponding data beneath perform portal[hdrdamage].centeron[horz,damage] perform portal[hdrrange].centeron[horz,range] ~align all header labels at the bottom of the header region perform portal[hdrdamage].alignedge[bottom,0] perform portal[hdrrange].alignedge[bottom,0]