WoW:XML/SimpleHTML
< XML
Jump to navigation
Jump to search
← 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[edit]
- Inherited by: none, Inherits: Frame, Runtime object: SimpleHTML
- Defined in: Frames, Ui
Elements[edit]
- <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[edit]
- 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[edit]
- OnHyperlinkEnter
- OnHyperlinkLeave
- OnHyperlinkClick
Schemas[edit]
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[edit]
SimpleHTML is like an HTML formattable FontString, in the form of a Frame style Ui element.
Example[edit]
<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[edit]
Other Examples[edit]
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>