WoW:XML properties: Difference between revisions

 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{uixmlprop}}
{{uixmlprop}}
[[XML properties]] are complex [[XML]] elements used to help define major Ui [[XML elements]], for creating WoW UI frames and widgets. See also [[XML elements]], [[XML attributes]], and [[XML types]].
[[FrameXML]] [[XML properties]], as used here are common complex [[XML]] elements, used to help define major Ui [[XML elements]] for creating WoW UI frames and widgets. See also [[XML elements]], [[XML attributes]], and [[XML types]].


== Summary ==
== Summary ==
In XML, 'attributes' are the "inline" properties of an 'element', like <element attribute="value"/>. Each 'element' may also contain its own child elements, like <element><element attribute="value"/><element attribute="value"/></element>. An element is defined by both its attributes, and by any 'child elements' it may have. The intent for this reference is to document all of the actual complex properties, like <Size> or <Anchor>, for major elements that are not regular attributes. These along with attributes, make up the definition of a major XML Ui elements like widgets.  
A particular element is defined by both its attributes, and by any 'child elements' it may have. These along with attributes, all together make up the definition major XML Ui elements, like widgets.  


Properties are usually defined in a standard order in a major element, like <Size> before <Anchors>. Major Ui elements are almost never placed directly inside another major Ui element, but inside list properties like <Frames>. Each major element only uses a subset of the properties below, like <nowiki><Font></nowiki> does not use <Scripts>.
In XML, 'attributes' are the in-line properties of an 'element', like:
<element attribute="value"/>
Each 'element' may also contain its own child elements, like:
<element>
  <element attribute="value"/>
  <element attribute="value"/>
</element>
The intent for this reference is to document all of the actual common complex properties, like '<nowiki><Size></nowiki>' or '<nowiki><Anchor></nowiki>', for major elements that are not regular attributes. A standard FrameXML XML property use to define a size of 100 x 100 looks like:
<Size>
  <AbsDimension x="100" y="100" />
</Size>
Properties are usually defined in a standard order in a major element, like <nowiki><Size></nowiki>' must come before '<nowiki><Anchors></nowiki>', or it may not work correctly.
 
Major Ui elements are almost never placed directly inside another major Ui element, but inside list properties like '<nowiki><Frames></nowiki>'. Each major element only uses a subset of the properties below, like '<nowiki><Font></nowiki>' does not use '<nowiki><Scripts></nowiki>', like.
<Frame>
  <Size> <-- FrameXML standard property not in a list
    <AbsDimension x="100" y="100" />
  </Size>
  <Frames>
    <Frame> <-- major FrameXML element in a list
      ...
    </Frame>
  </Frames>
  <Scripts>
    <Script ... />  <-- major FrameXML element in a list
  </Scripts>
</Frame>


== Reference ==
== Reference ==
Line 115: Line 141:
* minResize ([[XML/Dimension|Dimension]]) - lower bounds of a frames size
* minResize ([[XML/Dimension|Dimension]]) - lower bounds of a frames size
* maxResize ([[XML/Dimension|Dimension]]) - upper bounds of a frames size
* maxResize ([[XML/Dimension|Dimension]]) - upper bounds of a frames size
=== [[XML/Script|Script]] ===
Lua script handler defined inside a [[XML/Scripts|Scripts]] element.


=== [[XML/Scripts|Scripts]] ===
=== [[XML/Scripts|Scripts]] ===
This element accepts specific script handler elements of a [[XML/Script|Script]] type. See [[:Category:Widget event handlers]] for more detail on individual handler semantics, and [[Widget handlers]] for which element types use handlers.
This element accepts specific script handler elements of a [[XML/Script|Script]] type. See the [[:Category:Widget event handlers|widget event handlers category]] for more detail on individual handler semantics, and [[Widget handlers]] for which element types use handlers.
Script types:
Script types:
* OnLoad
* OnLoad
Line 123: Line 152:
* OnSizeChanged
* OnSizeChanged
* OnEvent
* OnEvent
* OnUpdate
* OnUpdate(self, elapsed)
* OnShow
* OnShow
* OnHide
* OnHide