Portal Target References: Difference between revisions
New page: {{context|Kit Reference|Target References}} The "portal" script context governs the operations that can be applied to portals within templates and layouts. The complete list of target ref... |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{context|Kit Reference|Target References}} | {{context|Kit Reference|Target References}} | ||
See Also: [[Portal Context Transitions]] | |||
The "portal" script context governs the operations that can be applied to portals within templates and layouts. The complete list of target references for portals is presented in the table below. | The "portal" script context governs the operations that can be applied to portals within templates and layouts. The complete list of target references for portals is presented in the table below. | ||
Line 6: | Line 8: | ||
|class="leftnormal"|width | |class="leftnormal"|width | ||
|(Left, Right, Number) Accesses the width of the portal. Unless explicitly specified within the XML, the width of a portal is automatically initialized appropriately to the nature of the portal. Setting the width of a table portal triggers immediate re-sizing of all items within the table.<br> | |(Left, Right, Number) Accesses the width of the portal. Unless explicitly specified within the XML, the width of a portal is automatically initialized appropriately to the nature of the portal. Setting the width of a table portal triggers immediate re-sizing of all items within the table.<br> | ||
Example: result = | Example: result = portal[portalid].width<br> | ||
Example: | Example: portal[portalid].width = 42 | ||
|- | |- | ||
|height | |height | ||
|(Left, Right, Number) Accesses the height of the portal. Unless explicitly specified within the XML, the height of a portal is automatically initialized appropriately to the nature of the portal. Setting the height of a table portal triggers immediate re-sizing of all items within the table.<br> | |(Left, Right, Number) Accesses the height of the portal. Unless explicitly specified within the XML, the height of a portal is automatically initialized appropriately to the nature of the portal. Setting the height of a table portal triggers immediate re-sizing of all items within the table.<br> | ||
Example: result = | Example: result = portal[portalid].height<br> | ||
Example: | Example: portal[portalid]height = 42 | ||
|- | |- | ||
|left | |left | ||
|(Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.<br> | |(Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.<br> | ||
Example: result = | Example: result = portal[portalid].left<br> | ||
Example: | Example: portal[portalid].left = 42 | ||
|- | |- | ||
|top | |top | ||
|(Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.<br> | |(Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.<br> | ||
Example: result = | Example: result = portal[portalid].top<br> | ||
Example: | Example: portal[portalid].top = 42 | ||
|- | |- | ||
|right | |right | ||
|(Right, Number) Returns the position of the right edge of the portal within the containing visual element.<br> | |(Right, Number) Returns the position of the right edge of the portal within the containing visual element.<br> | ||
Example: result = | Example: result = portal[portalid].right | ||
|- | |- | ||
|bottom | |bottom | ||
|(Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.<br> | |(Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.<br> | ||
Example: result = | Example: result = portal[portalid].bottom | ||
|- | |- | ||
|visible | |visible | ||
|(Left, Right, Number) Controls the visibility of the portal within the containing visual element. A non-zero value indicates the portal is visible and a zero value indicates hidden.<br> | |(Left, Right, Number) Controls the visibility of the portal within the containing visual element. A non-zero value indicates the portal is visible and a zero value indicates hidden.<br> | ||
Example: result = | Example: result = portal[portalid].visible<br> | ||
Example: | Example: portal[portalid].visible = 1 | ||
|- | |- | ||
|scrollbar | |scrollbar | ||
|(Right, Number) Returns the width of a scroller, in pixels.<br> | |(Right, Number) Returns the width of a scroller, in pixels.<br> | ||
Example: result = | Example: result = portal[portalid].scrollbar | ||
|- | |- | ||
|autowidth | |autowidth | ||
|( | |(Right, Number) Sets the width of the portal to the default width based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autowidth" to set the portal width appropriately for that font size and portal text.<br> | ||
Example: | Example: perform portal[portalid].autowidth<br> | ||
|- | |- | ||
|autoheight | |autoheight | ||
|( | |(Right, Number) Sets the height of the portal to the default height based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autoheight" to set the portal height appropriately for that font size and portal text.<br> | ||
Example: | Example: perform portal[portalid].autoheight<br> | ||
|- | |- | ||
| | |autosize | ||
|( | |(Right, Number) Calling "autosize" has the same effect as performing both an "autowidth" and an "autoheight".<br> | ||
Example: | Example: perform portal[portalid].autosize<br> | ||
|- | |- | ||
|autoplace[''gap''] | |autoplace[''gap''] | ||
|(Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for [[Using Automatic Placement|automatic placement]]. The ''gap'' parameter specifies the gap to be used between this portal and the previously placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Automatic placement for portals can only be used within layouts. A value of zero is always returned.<br> | |(Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for [[Using Automatic Placement|automatic placement]]. The ''gap'' parameter specifies the gap to be used between this portal and the previously placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Automatic placement for portals can only be used within layouts. A value of zero is always returned.<br> | ||
Example: perform | Example: perform portal[portalid].autoplace[42]<br> | ||
Example: perform this. | Example: perform portal[portalid].autoplace | ||
|- | |||
|batchadd[''gap''] | |||
|(Right, Number) Queues the portal for batch placement within the containing layout, subject to the standard rules for [[Using Batch Placement|batch placement]]. As with "autoplace", the ''gap'' parameter specifies the gap to be used between this portal and the previous placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Batch placement for portals can only be used within layouts. A value of zero is always returned.<br> | |||
Example: perform portal[portalid].batchadd[42]<br> | |||
Example: perform portal[portalid].batchadd | |||
|- | |- | ||
|} | |} |
Latest revision as of 05:43, 20 December 2013
Context: HL Kit … Kit Reference … Target References
See Also: Portal Context Transitions
The "portal" script context governs the operations that can be applied to portals within templates and layouts. The complete list of target references for portals is presented in the table below.
width (Left, Right, Number) Accesses the width of the portal. Unless explicitly specified within the XML, the width of a portal is automatically initialized appropriately to the nature of the portal. Setting the width of a table portal triggers immediate re-sizing of all items within the table.
Example: result = portal[portalid].width
Example: portal[portalid].width = 42height (Left, Right, Number) Accesses the height of the portal. Unless explicitly specified within the XML, the height of a portal is automatically initialized appropriately to the nature of the portal. Setting the height of a table portal triggers immediate re-sizing of all items within the table.
Example: result = portal[portalid].height
Example: portal[portalid]height = 42left (Left, Right, Number) Accesses the position of the left edge of the portal within the containing visual element.
Example: result = portal[portalid].left
Example: portal[portalid].left = 42top (Left, Right, Number) Accesses the position of the top edge of the portal within the containing visual element.
Example: result = portal[portalid].top
Example: portal[portalid].top = 42right (Right, Number) Returns the position of the right edge of the portal within the containing visual element.
Example: result = portal[portalid].right
bottom (Right, Number) Returns the position of the bottom edge of the portal within the containing visual element.
Example: result = portal[portalid].bottom
visible (Left, Right, Number) Controls the visibility of the portal within the containing visual element. A non-zero value indicates the portal is visible and a zero value indicates hidden.
Example: result = portal[portalid].visible
Example: portal[portalid].visible = 1scrollbar (Right, Number) Returns the width of a scroller, in pixels.
Example: result = portal[portalid].scrollbar
autowidth (Right, Number) Sets the width of the portal to the default width based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autowidth" to set the portal width appropriately for that font size and portal text.
Example: perform portal[portalid].autowidth
autoheight (Right, Number) Sets the height of the portal to the default height based on the current style and portal contents. For example, if you change the font size of a portal, you can call "autoheight" to set the portal height appropriately for that font size and portal text.
Example: perform portal[portalid].autoheight
autosize (Right, Number) Calling "autosize" has the same effect as performing both an "autowidth" and an "autoheight".
Example: perform portal[portalid].autosize
autoplace[gap] (Right, Number) Automatically places the portal within the containing layout, subject to the standard rules for automatic placement. The gap parameter specifies the gap to be used between this portal and the previously placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Automatic placement for portals can only be used within layouts. A value of zero is always returned.
Example: perform portal[portalid].autoplace[42]
Example: perform portal[portalid].autoplacebatchadd[gap] (Right, Number) Queues the portal for batch placement within the containing layout, subject to the standard rules for batch placement. As with "autoplace", the gap parameter specifies the gap to be used between this portal and the previous placed element. The parameter can be omitted, in which case the established "autogap" is utilized. Batch placement for portals can only be used within layouts. A value of zero is always returned.
Example: perform portal[portalid].batchadd[42]
Example: perform portal[portalid].batchadd