WoW:XML/SimpleHTML: Difference between revisions
< XML
Jump to navigation
Jump to search
(Created page with 'Derived from: Frame Elements: FontString, FontStringHeader1, FontStringHeader2, FontStringHeader3 Attributes: files') |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{uixmlelem}} | |||
SimpleHTML is a [[XML/Frame|Frame]] type that can display formatted HTML or plain text. SimpleHTML is used as an element of a [[XML/Frames]] array. See also [[UIOBJECT SimpleHTML]]. | |||
== Inheritance == | |||
: Inherited by: none, Inherits: [[XML/Frame|Frame]], Runtime object: [[UIOBJECT SimpleHTML|SimpleHTML]] | |||
: Defined in: [[XML/Frames|Frames]], [[XML/Ui|Ui]] | |||
Attributes: | == Elements == | ||
* <[[XML/FontString|FontString]]> - a FontString that defines the font to be used for the SimpleHTML box text, use this or the font attribute. Required unless 'font' attribute is set. | |||
* <[[XML/FontStringHeader1|FontStringHeader1]]> | |||
* <[[XML/FontStringHeader2|FontStringHeader2]]> | |||
* <[[XML/FontStringHeader3|FontStringHeader3]]> | |||
== Attributes == | |||
* font (string) - A virtual Font, FontFamily or virtual FontString to use for font settings for the HTML or plain text. Basically a named font, like 'GameFontNormal'. Works like 'inherit' for the built in FontString element. Is not the same the FontString 'font' attribute, and setting to a font file path will not work. | |||
* file (string) - path and file name of text file to load that contains html to display. like: 'Interface\AddOns\MyAddon\html.txt' | |||
* hyperlinkFormat (string) | |||
* resizeToFitContents (boolean) | |||
* disallowFormatting (boolean) | |||
== Events == | |||
* OnHyperlinkEnter | |||
* OnHyperlinkLeave | |||
* OnHyperlinkClick | |||
== Schemas == | |||
As of Ui 36949 90002 | |||
<pre> | |||
<xs:complexType name="SimpleHTMLType"> | |||
<xs:complexContent> | |||
<xs:extension base="ui:FrameType"> | |||
<xs:sequence> | |||
<xs:element ref="FontString"/> | |||
<xs:sequence minOccurs="0"> | |||
<xs:choice maxOccurs="unbounded"> | |||
<xs:element name="FontStringHeader1" type="ui:FontStringType"/> | |||
<xs:element name="FontStringHeader2" type="ui:FontStringType"/> | |||
<xs:element name="FontStringHeader3" type="ui:FontStringType"/> | |||
</xs:choice> | |||
</xs:sequence> | |||
</xs:sequence> | |||
<xs:attribute name="font" type="xs:string"/> | |||
<xs:attribute name="file" type="xs:string"/> | |||
<xs:attribute name="hyperlinkFormat" type="xs:string" default="|H%s|h%s|h"/> | |||
<xs:attribute name="resizeToFitContents" type="xs:boolean" default="false"/> | |||
</xs:extension> | |||
</xs:complexContent> | |||
</xs:complexType> | |||
<xs:element name="SimpleHTML" type="ui:SimpleHTMLType" substitutionGroup="ui:Frame"/> | |||
</pre> | |||
== Summary == | |||
SimpleHTML is like an HTML formattable FontString, in the form of a Frame style Ui element. | |||
=== Example === | |||
<Frame name="MyFrame"> | |||
<Frames> | |||
<SimpleHTML name="$parentHTML"> | |||
<Size x="200" y="200" /> | |||
<Anchors> | |||
<Anchor point="TOP"> | |||
<Offset x="0" y="-22" /> | |||
</Anchor> | |||
</Anchors> | |||
<FontString inherits="GameFontNormal" justifyV="TOP" justifyH="LEFT" /> | |||
</SimpleHTML > | |||
</Frames> | |||
</Frame> | |||
== Details == | |||
== Other Examples == | |||
Simple example using an existing font template that loads html form a file. | |||
<pre> | |||
<SimpleHTML font="GameFontNormal" file="Interface\AddOns\WowAddon6\html.txt"> | |||
<Size x="200" y="200" /> | |||
<Anchors> | |||
<Anchor point="CENTER" /> | |||
</Anchors> | |||
</SimpleHTML> | |||
</pre> | |||
From default UI, retail build version 36949, 90002, Blizzard_EncounterJournal.xml: | |||
<pre> | |||
<SimpleHTML parentKey="Text" inherits="InlineHyperlinkFrameTemplate"> | |||
<Size x="95" y="10"/> | |||
<Anchors> | |||
<Anchor point="TOPLEFT" relativeKey="$parent.Bullet" relativePoint="TOPRIGHT" x="4" y="0"/> | |||
</Anchors> | |||
<FontString inherits="GameFontBlack" justifyH="LEFT" justifyV="TOP"> | |||
<Color r="0.25" g="0.1484375" b=".02" a="1"/> | |||
</FontString> | |||
<Scripts> | |||
<OnHyperlinkEnter function="EncounterJournal_OnHyperlinkEnter"/> | |||
</Scripts> | |||
</SimpleHTML> | |||
</pre> | |||
From default UI, retail build version 36949, 90002, Blizzard_GuildInfo.xml: | |||
<pre> | |||
<SimpleHTML name="GuildInfoMOTD" disallowFormatting="true"> | |||
<Size> | |||
<AbsDimension x="284" y="42"/> | |||
</Size> | |||
<Scripts> | |||
<OnHyperlinkClick> | |||
SetItemRef(link, text, button, self); | |||
</OnHyperlinkClick> | |||
</Scripts> | |||
<FontString inherits="GameFontNormalSmall" justifyH="LEFT" justifyV="TOP" spacing="2"> | |||
<Color r="1" g="1" b="1"/> | |||
</FontString> | |||
</SimpleHTML> | |||
</pre> | |||
[[Category:XML elements]] | [[Category:XML elements]] |
Revision as of 03:31, 18 December 2020
← XML UI ← XML elements < SimpleHTML
SimpleHTML is a Frame type that can display formatted HTML or plain text. SimpleHTML is used as an element of a XML/Frames array. See also UIOBJECT SimpleHTML.
Inheritance
- Inherited by: none, Inherits: Frame, Runtime object: SimpleHTML
- Defined in: Frames, Ui
Elements
- <FontString> - a FontString that defines the font to be used for the SimpleHTML box text, use this or the font attribute. Required unless 'font' attribute is set.
- <FontStringHeader1>
- <FontStringHeader2>
- <FontStringHeader3>
Attributes
- font (string) - A virtual Font, FontFamily or virtual FontString to use for font settings for the HTML or plain text. Basically a named font, like 'GameFontNormal'. Works like 'inherit' for the built in FontString element. Is not the same the FontString 'font' attribute, and setting to a font file path will not work.
- file (string) - path and file name of text file to load that contains html to display. like: 'Interface\AddOns\MyAddon\html.txt'
- hyperlinkFormat (string)
- resizeToFitContents (boolean)
- disallowFormatting (boolean)
Events
- OnHyperlinkEnter
- OnHyperlinkLeave
- OnHyperlinkClick
Schemas
As of Ui 36949 90002
<xs:complexType name="SimpleHTMLType">
<xs:complexContent>
<xs:extension base="ui:FrameType">
<xs:sequence>
<xs:element ref="FontString"/>
<xs:sequence minOccurs="0">
<xs:choice maxOccurs="unbounded">
<xs:element name="FontStringHeader1" type="ui:FontStringType"/>
<xs:element name="FontStringHeader2" type="ui:FontStringType"/>
<xs:element name="FontStringHeader3" type="ui:FontStringType"/>
</xs:choice>
</xs:sequence>
</xs:sequence>
<xs:attribute name="font" type="xs:string"/>
<xs:attribute name="file" type="xs:string"/>
<xs:attribute name="hyperlinkFormat" type="xs:string" default="|H%s|h%s|h"/>
<xs:attribute name="resizeToFitContents" type="xs:boolean" default="false"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="SimpleHTML" type="ui:SimpleHTMLType" substitutionGroup="ui:Frame"/>
Summary
SimpleHTML is like an HTML formattable FontString, in the form of a Frame style Ui element.
Example
<Frame name="MyFrame"> <Frames> <SimpleHTML name="$parentHTML"> <Size x="200" y="200" /> <Anchors> <Anchor point="TOP"> <Offset x="0" y="-22" /> </Anchor> </Anchors> <FontString inherits="GameFontNormal" justifyV="TOP" justifyH="LEFT" /> </SimpleHTML > </Frames> </Frame>
Details
Other Examples
Simple example using an existing font template that loads html form a file.
<SimpleHTML font="GameFontNormal" file="Interface\AddOns\WowAddon6\html.txt">
<Size x="200" y="200" />
<Anchors>
<Anchor point="CENTER" />
</Anchors>
</SimpleHTML>
From default UI, retail build version 36949, 90002, Blizzard_EncounterJournal.xml:
<SimpleHTML parentKey="Text" inherits="InlineHyperlinkFrameTemplate">
<Size x="95" y="10"/>
<Anchors>
<Anchor point="TOPLEFT" relativeKey="$parent.Bullet" relativePoint="TOPRIGHT" x="4" y="0"/>
</Anchors>
<FontString inherits="GameFontBlack" justifyH="LEFT" justifyV="TOP">
<Color r="0.25" g="0.1484375" b=".02" a="1"/>
</FontString>
<Scripts>
<OnHyperlinkEnter function="EncounterJournal_OnHyperlinkEnter"/>
</Scripts>
</SimpleHTML>
From default UI, retail build version 36949, 90002, Blizzard_GuildInfo.xml:
<SimpleHTML name="GuildInfoMOTD" disallowFormatting="true">
<Size>
<AbsDimension x="284" y="42"/>
</Size>
<Scripts>
<OnHyperlinkClick>
SetItemRef(link, text, button, self);
</OnHyperlinkClick>
</Scripts>
<FontString inherits="GameFontNormalSmall" justifyH="LEFT" justifyV="TOP" spacing="2">
<Color r="1" g="1" b="1"/>
</FontString>
</SimpleHTML>