Panel Element (Data): Difference between revisions

From HLKitWiki
Jump to navigationJump to search
New page: {{context|Kit Reference|Data File Reference}} ==The "panel" Element== Panels contain one or more layouts and orchestrate the presentation of material for a specific ...
 
No edit summary
Line 23: Line 23:
|marginvert
|marginvert
|(Optional) Integer – Specifies the margin gap included at both ends along the vertical axis. The usable height of the panel is the actual height minus double the vertical margin. Default: "0".
|(Optional) Integer – Specifies the margin gap included at both ends along the vertical axis. The usable height of the panel is the actual height minus double the vertical margin. Default: "0".
|-
|underlay
|(Optional) Text – Specifies the filename of a bitmap image that is blitted on top of the background and beneath all other visual elements within the panel. This bitmap file is assumed to reside within the data file folder for the game system. If empty, no underlay bitmap is utilized. Default: Empty.
|-
|-
|}
|}


The "layout" element also possesses child elements that define various facets of the layout. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.
The "panel" element also possesses child elements that define various facets of the panel. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.


:{| class="infotable"
:{| class="infotable"
|class="leftnormal"|[[#live|live]]
|class="leftnormal"|[[#live|live]]
|An optional "live" element may appear as defined by the given link. This element defines a [[Live Tag Expression]] that determines whether the template is shown to the user.
|An optional "live" element may appear as defined by the given link. This element defines a [[Live Tag Expression]] that determines whether the panel is shown to the user.  
|-
|[[#portalref|portalref]]
|Zero or more "portalref" elements may appear as defined by the given link. This element specifies the individual portals which are utilized within the layout.
|-
|-
|[[#templateref|templateref]]
|[[#layoutref|layoutref]]
|Zero or more "templateref" elements may appear as defined by the given link. This element specifies the individual templates which are utilized within the layout.
|Zero or more "layoutref" elements may appear as defined by the given link. This element specifies the individual layouts which are utilized within the panel.
|-
|-
|[[#position|position]]
|[[#position|position]]
|An optional "position" element may appear as defined by the given link. This element defines a [[Position Script]] through which the portals are sized and positioned within the template.
|An optional "position" element may appear as defined by the given link. This element defines a [[Position Script]] through which the contained layouts are sized and positioned within the panel.
|-
|-
|}
|}
Line 45: Line 45:
==The "live" Element{{anchor|live}}==
==The "live" Element{{anchor|live}}==


The "live" element defines a [[Live Tag Expression]] for the layout, which determines whether the layout is shown. The tag expression is compared against the tags assigned to the container associated with the layout (e.g. the actor). If the tag expression is satisfied, the layout is visible, else it is hidden. The complete list of attributes for this element is below.  
The "live" element defines a [[Live Tag Expression]] for the panel, which determines whether the panel is shown. The tag expression is compared against the tags assigned to the container associated with the panel (e.g. the actor). If the tag expression is satisfied, the panel is visible, else it is hidden. For tab panels, hidden implies that the tab itself does not appear. The complete list of attributes for this element is below.  


:{| class="infotable"
:{| class="infotable"
Line 53: Line 53:
|}
|}


==The "portalref" Element{{anchor|portalref}}==
==The "layoutref" Element{{anchor|layoutref}}==


The "portalref" element identifies a portal used within the layout and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.  
The "layoutref" element identifies a layout used within the panel and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.  


:{| class="infotable"
:{| class="infotable"
|class="leftnormal"|portal
|class="leftnormal"|layout
|Id – Unique id of the portal to be utilized within the layout.
|Id – Unique id of the layout to be utilized within the panel.
|-
|-
|reference
|reference
|(Optional) Id – Specifies the alternate unique id to be used when referencing this portal within the Position script. This makes it possible to re-use the same portal more than once within the same layout, giving each instance a different logical id. If empty, the reference id is simply the portal id. Default: Empty.
|(Optional) Id – Specifies the alternate unique id to be used when referencing this layout within the Position script. This makes it possible to re-use the same layout more than once within the same panel, giving each instance a different logical id. If empty, the reference id is simply the layout id. Default: Empty.
|-
|taborder
|(Optional) Integer – Specifies the relative tab order position of the portal and its contents within the overall layout. As long as the tab orders are different for all portals and templates within the layout, HL can properly sequence the flow of control. Default: "0".
|-
|}
 
==The "templateref" Element{{anchor|templateref}}==
 
The "templateref" element identifies a template used within the layout and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.
 
:{| class="infotable"
|class="leftnormal"|template
|Id – Unique id of the template to be utilized within the layout.
|-
|reference
|(Optional) Id – Specifies the alternate unique id to be used when referencing this template within the Position script. This makes it possible to re-use the same template more than once within the same layout, giving each instance a different logical id. If empty, the reference id is simply the template id. Default: Empty.
|-
|thing
|(Optional) Id – Specifies the unique id of the thing or pick that is associated with this template. The given object is used with the template when determining the contents of fields and such. If empty, no thing/pick is associated with the template, which means that the template cannot contain any portals that utilize a field reference. Default: Empty.
|-
|ispick
|(Optional) Boolean – Indicates whether the template is associated with a pick or a thing. If a pick, the first pick within the container that based on the specified thing is used. Default: "yes".
|-
|taborder
|(Optional) Integer – Specifies the relative tab order position of the template and its contents within the overall layout. As long as the tab orders are different for all portals and templates within the layout, HL can properly sequence the flow of control. Default: "0".
|-
|-
|}
|}
Line 93: Line 68:
==The "position" Element{{anchor|position}}==
==The "position" Element{{anchor|position}}==


The "position" element defines a [[Position Script]] for the layout, which performs all the appropriate sizing and positioning of the contained portals and templates within the region of the layout. The complete list of attributes for this element is below.  
The "position" element defines a [[Position Script]] for the panel, which performs all the appropriate sizing and positioning of the contained layouts within the panel. The complete list of attributes for this element is below.  


:{| class="infotable"
:{| class="infotable"
Line 103: Line 78:
==Example==
==Example==


The following example demonstrates what a "layout" element might look like. All default values are assumed for optional attributes.
The following example demonstrates what a "panel" element might look like. All default values are assumed for optional attributes.


<pre>
<pre>
<layout id="journal">
<panel id="basics" name="Basics" order="110"
  <portalref portal="jrTitle"/>
    marginhorz="5" marginvert="5">
  <portalref portal="journal" taborder="10"/>
  <live>!HideTab.basics</live>
   <templateref template="jrHeader" thing="actor"/>
   <layoutref layout="basics"/>
   <position>
   <position>
     ~configure whether our header is visible or not
     ~script code goes here
    ~Note: If the header is non-visible, no space is allotted for it below.
    template[jrHeader].visible = 1
 
    ~position the title at the top, followed by the template, and then the table
    perform portal[jrTitle].autoplace
    perform template[jrHeader].autoplace[6]
    perform portal[journal].autoplace[9]
     </position>
     </position>
   </layout>
   </panel>
</pre>
</pre>

Revision as of 11:39, 3 December 2008

Context: HL Kit &#133; Kit Reference &#133; Data File Reference 

The "panel" Element

Panels contain one or more layouts and orchestrate the presentation of material for a specific region within HL. Panels are used to define the contents of the various tabs shown across the top for editing character data, as well as for summary panels shown on the right. Each panel is specified through the use of a "panel" element. The complete list of attributes for this element is below.

id Id – Specifies the unique id of the layout. This id is used in all references to the layout.
name Text – Public name associated with the panel. Maximum length of 50 characters.
order (Optional) Integer – Specifies the sequence in which this panel is displayed to the user. For a tab-based panel, this value controls the order in which the tabs are shown across the top. For a summary panel, this value controls the default order in which the summary panels are shown. Default: "0".
issummary (Optional) Boolean – Indicates whether this panel is intended for use as a summary panel or a tab-based panel. Default: "no".
marginhorz (Optional) Integer – Specifies the margin gap included at both ends along the horizontal axis. The usable width of the panel is the actual width minus double the horizontal margin. Default: "0".
marginvert (Optional) Integer – Specifies the margin gap included at both ends along the vertical axis. The usable height of the panel is the actual height minus double the vertical margin. Default: "0".
underlay (Optional) Text – Specifies the filename of a bitmap image that is blitted on top of the background and beneath all other visual elements within the panel. This bitmap file is assumed to reside within the data file folder for the game system. If empty, no underlay bitmap is utilized. Default: Empty.

The "panel" element also possesses child elements that define various facets of the panel. The list of these child elements is below and must appear in the order shown. Click on the link to access the details for each element.

live An optional "live" element may appear as defined by the given link. This element defines a Live Tag Expression that determines whether the panel is shown to the user.
layoutref Zero or more "layoutref" elements may appear as defined by the given link. This element specifies the individual layouts which are utilized within the panel.
position An optional "position" element may appear as defined by the given link. This element defines a Position Script through which the contained layouts are sized and positioned within the panel.

The "live" Element

The "live" element defines a Live Tag Expression for the panel, which determines whether the panel is shown. The tag expression is compared against the tags assigned to the container associated with the panel (e.g. the actor). If the tag expression is satisfied, the panel is visible, else it is hidden. For tab panels, hidden implies that the tab itself does not appear. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Live tag expression.

The "layoutref" Element

The "layoutref" element identifies a layout used within the panel and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.

layout Id – Unique id of the layout to be utilized within the panel.
reference (Optional) Id – Specifies the alternate unique id to be used when referencing this layout within the Position script. This makes it possible to re-use the same layout more than once within the same panel, giving each instance a different logical id. If empty, the reference id is simply the layout id. Default: Empty.

The "position" Element

The "position" element defines a Position Script for the panel, which performs all the appropriate sizing and positioning of the contained layouts within the panel. The complete list of attributes for this element is below.

PCDATA Script – Specifies the code comprising the Position script.

Example

The following example demonstrates what a "panel" element might look like. All default values are assumed for optional attributes.

<panel id="basics" name="Basics" order="110"
    marginhorz="5" marginvert="5">
  <live>!HideTab.basics</live>
  <layoutref layout="basics"/>
  <position>
    ~script code goes here
    </position>
  </panel>