12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1208 Part IV ■ <strong>Reference</strong>UpdateScrollChildRectUpdates the position <strong>of</strong> the scroll frame’s child.ScrollFrame:UpdateScrollChildRect()The ScrollFrame automatically adjusts the position <strong>of</strong> the child frame whenscrolled, but manually updating its position may be necessary when changingthe size or contents <strong>of</strong> the child frame.SimpleHTMLThe most sophisticated control over text display is <strong>of</strong>fered by SimpleHTML widgets.When its text is set to a string containing valid HTML markup, a SimpleHTMLwidget will parse the content into its various blocks <strong>and</strong> sections, <strong>and</strong> lay the textout. While it supports most common text comm<strong>and</strong>s, a SimpleHTML widget acceptsan additional argument to most <strong>of</strong> these; if provided, the element argument willspecify the HTML elements to which the new style in<strong>for</strong>mation should apply, such as<strong>for</strong>mattedText:SetTextColor(“h2“, 1, 0.3, 0.1) which will cause all level 2headers to display in red. If no element name is specified, the settings apply to theSimpleHTML widget’s default font.Like ScrollingMessageFrame, SimpleHTML also provides hyperlink support, includinga hook to control the <strong>for</strong>matting <strong>of</strong> hyperlinked text with :SetHyperlinkFormat.This function takes a string, which is provided to string.<strong>for</strong>mat along with stringsrepresenting the hyperlink’s address <strong>and</strong> body text, <strong>and</strong> produces the appropriate link<strong>and</strong> color codes along with any other desired <strong>for</strong>matting.This widget does not support scrolling by itself, but you can use it as a ScrollChildto support longer blocks <strong>of</strong> text. In addition, it is used by the stock UI to display thecontents <strong>of</strong> the books that your character may find lying around inns <strong>and</strong> libraries.SimpleHTML has all the methods from Frame, plus the following:GetFontReturns basic properties <strong>of</strong> a font used in the frame.filename, fontHeight, flags = SimpleHTML:GetFont([“element“])Arguments:element (optional)—Name <strong>of</strong> an HTML element <strong>for</strong> which to return font in<strong>for</strong>mation(e.g. p, h1); if omitted, returns in<strong>for</strong>mation about the frame’s default font(string)Returns:filename—Path to a font file (string)fontHeight—Height (point size) <strong>of</strong> the font to be displayed (in pixels) (number)flags—Additional properties <strong>for</strong> the font specified by one or more (separatedby commas) <strong>of</strong> the following tokens: (string)MONOCHROME - Font is rendered without anti-aliasingOUTLINE - Font is displayed with a black outlineTHICKOUTLINE - Font is displayed with a thick black outline

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!