So I have an output table I'm using to display weapon info on a character sheet. The last row of the layout is a multi-line portal for any special notes that might apply to the weapon. I then set the height to be the bottom of this portal, so if it's 1 line or 3 lines of info, it all fits.
The problem I'm running into is that it seems to size to the first element in the template and and then doesnt' resize for later elements. Is this just the way it is or am I doing something wrong?
The problem I'm running into is that it seems to size to the first element in the template and and then doesnt' resize for later elements. Is this just the way it is or am I doing something wrong?
Code:
<portal
id="oRWeapon"
style="outTblGrid">
<output_table
component="WeapRange"
showtemplate="oWeapRPick"
headertemplate="oWeapRPick"
showsortset="Armory">
<list><![CDATA[
]]></list>
</output_table>
</portal>
<template
id="oWeapRPick"
name="Output Melee Weapon Table"
compset="Ranged"
marginvert="2">
<portal
id="name"
style="outTitle">
<output_label
field="shortname">
</output_label>
</portal>
<portal
id="rat"
style="outNameMed">
<output_label
field="wpNetAtk">
</output_label>
</portal>
<portal
id="pow"
style="outNameMed">
<output_label
field="wpDamage">
</output_label>
</portal>
<portal
id="range"
style="outNameMed">
<output_label
field="wpRange">
</output_label>
</portal>
<portal
id="AOE"
style="outNameMed">
<output_label
field="wpAOE">
</output_label>
</portal>
<portal
id="special"
style="outPlainLt">
<output_label
field="wpNotes"
ismultiline="yes">
</output_label>
</portal>
<!-- Portals used as the header -->
<portal
id="hdrtitle"
style="outTitle"
isheader="yes">
<output_label
text="Ranged Weapons">
</output_label>
</portal>
<portal
id="hdrRAT"
style="outHeader"
isheader="yes">
<output_label
text="RAT">
</output_label>
</portal>
<portal
id="hdrPOW"
style="outHeader"
isheader="yes">
<output_label
text="POW">
</output_label>
</portal>
<portal
id="hdrRange"
style="outHeader"
isheader="yes">
<output_label
text="Range">
</output_label>
</portal>
<portal
id="hdrAOE"
style="outHeader"
isheader="yes">
<output_label
text="AOE">
</output_label>
</portal>
<position><![CDATA[
~our height is based on the tallest portal within
~doneif (issizing <> 0)
portal[name].top = 0
portal[name].left = 0
portal[name].width = width
portal[rat].top = portal[name].bottom
portal[rat].left = 0
portal[rat].width = width / 4
portal[range].top = portal[name].bottom
portal[range].left = portal[rat].right
portal[range].width = width / 4
portal[AOE].top = portal[name].bottom
portal[AOE].left = portal[range].right
portal[AOE].width = width / 4
portal[pow].top = portal[name].bottom
portal[pow].left = portal[AOE].right
portal[pow].width = width / 4
portal[special].top = portal[rat].bottom
portal[special].left = 0
portal[special].width = width
perform portal[special].autoheight
height = portal[special].bottom
]]></position>
<header><![CDATA[
~our header height is the title plus a gap plus the header text
height = portal[hdrtitle].height + 10 + portal[hdrRAT].height
~doneif (issizing <> 0)
~our title spans the entire width of the template
portal[hdrtitle].width = width
~each of our header labels has the same width as the corresponding data beneath
portal[hdrRAT].width = portal[rat].width
portal[hdrPOW].width = portal[pow].width
portal[hdrRange].width = portal[range].width
portal[hdrAOE].width = portal[AOE].width
~center each header label on the corresponding data beneath
perform portal[hdrRAT].centeron[horz,rat]
perform portal[hdrPOW].centeron[horz,pow]
perform portal[hdrRange].centeron[horz,range]
perform portal[hdrAOE].centeron[horz,AOE]
~align all header labels at the bottom of the header region
perform portal[hdrRAT].alignedge[bottom,0]
perform portal[hdrPOW].alignedge[bottom,0]
perform portal[hdrRange].alignedge[bottom,0]
perform portal[hdrAOE].alignedge[bottom,0]
]]></header>
</template>