The most sophisticated control over text display is offered by SimpleHTML widgets. When its text is set to a string containing valid HTML markup, a SimpleHTML widget will parse the content into its various blocks and sections, and lay the text out. While it supports most common text commands, a SimpleHTML widget accepts an additional argument to most of these; if provided, the element argument will specify the HTML elements to which the new style information should apply, such as formattedText:SetTextColor("h2", 1, 0.3, 0.1) which will cause all level 2 headers to display in red. If no element name is specified, the settings apply to the SimpleHTML widget's default font.
Like ScrollingMessageFrame, SimpleHTML also provides hyperlink support, including a hook to control the formatting of hyperlinked text with :SetHyperlinkFormat. This function takes a string, which is provided to string.format along with strings representing the hyperlink's address and body text, and produces the appropriate link and color codes along with any other desired formatting.
This widget does not support scrolling by itself, but you can use it as a ScrollChild to support longer blocks of text. In addition, it is used by the stock UI to display the contents of the books that your character may find lying around inns and libraries.
Defined Methods
- filename, fontHeight, flags = SimpleHTML:GetFont(["element"]) - Returns basic properties of a font used in the frame
- font = SimpleHTML:GetFontObject(["element"]) - Returns the `Font` object from which the properties of a font used in the frame are inherited
- format = SimpleHTML:GetHyperlinkFormat() - Returns the format string used for displaying hyperlinks in the frame
- enabled = SimpleHTML:GetHyperlinksEnabled() - Returns whether hyperlinks in the frame's text are interactive
- indent = SimpleHTML:GetIndentedWordWrap(["element"]) - Returns whether long lines of text are indented when wrapping
- justify = SimpleHTML:GetJustifyH(["element"]) - Returns the horizontal alignment style for text in the frame
- justify = SimpleHTML:GetJustifyV(["element"]) - Returns the vertical alignment style for text in the frame
- shadowR, shadowG, shadowB, shadowAlpha = SimpleHTML:GetShadowColor(["element"]) - Returns the shadow color for text in the frame
- xOffset, yOffset = SimpleHTML:GetShadowOffset(["element"]) - Returns the offset of text shadow from text in the frame
- spacing = SimpleHTML:GetSpacing(["element"]) - Returns the amount of spacing between lines of text in the frame
- textR, textG, textB, textAlpha = SimpleHTML:GetTextColor(["element"]) - Returns the color of text in the frame
- isValid = SimpleHTML:SetFont(["element",] "filename", fontHeight, "flags") - Sets basic properties of a font used in the frame
- SimpleHTML:SetFontObject(["element",] font) or SimpleHTML:SetFontObject(["element",] "name") - Sets the `Font` object from which the properties of a font used in the frame are inherited
- SimpleHTML:SetHyperlinkFormat("format") - Sets the format string used for displaying hyperlinks in the frame
- SimpleHTML:SetHyperlinksEnabled(enable) - Enables or disables hyperlink interactivity in the frame
- SimpleHTML:SetIndentedWordWrap(["element",] indent) - Sets whether long lines of text are indented when wrapping
- SimpleHTML:SetJustifyH(["element",] "justify") - Sets the horizontal alignment style for text in the frame
- SimpleHTML:SetJustifyV(["element",] "justify") - Sets the vertical alignment style for text in the frame
- SimpleHTML:SetShadowColor(["element",] shadowR, shadowG, shadowB, shadowAlpha) - Sets the shadow color for text in the frame
- SimpleHTML:SetShadowOffset(["element",] xOffset, yOffset) - Returns the offset of text shadow from text in the frame
- SimpleHTML:SetSpacing(["element",] spacing) - Sets the amount of spacing between lines of text in the frame
- SimpleHTML:SetText("text") - Sets the text to be displayed in the SimpleHTML frame
- SimpleHTML:SetTextColor(["element",] textR, textG, textB, textAlpha) - Sets the color of text in the frame
Inherited Methods
- SimpleHTML:AllowAttributeChanges() - Temporarily allows insecure code to modify the frame's attributes during combat
- enabled = SimpleHTML:CanChangeAttribute() - Returns whether secure frame attributes can currently be changed
- canChange = SimpleHTML:CanChangeProtectedState() - Returns whether protected properties of the region can be changed by non-secure scripts
- SimpleHTML:ClearAllPoints() - Removes all anchor points from the region
- animationGroup = SimpleHTML:CreateAnimationGroup(["name" [, "inheritsFrom"]]) - Creates a new AnimationGroup as a child of the region
- fontstring = SimpleHTML:CreateFontString(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/FontString|`FontString`]] as a child of the frame
- texture = SimpleHTML:CreateTexture(["name" [, "layer" [, "inherits"]]]) - Creates a new [[docs/widgets/Texture|`Texture`]] as a child of the frame
- region = SimpleHTML:CreateTitleRegion() - Creates a title region for dragging the frame
- SimpleHTML:DisableDrawLayer("layer") - Prevents display of all child objects of the frame on a specified graphics layer
- SimpleHTML:EnableDrawLayer("layer") - Allows display of all child objects of the frame on a specified graphics layer
- SimpleHTML:EnableJoystick(enable) - Enables or disables joystick interactivity
- SimpleHTML:EnableKeyboard(enable) - Enables or disables keyboard interactivity for the frame
- SimpleHTML:EnableMouse(enable) - Enables or disables mouse interactivity for the frame
- SimpleHTML:EnableMouseWheel(enable) - Enables or disables mouse wheel interactivity for the frame
- alpha = SimpleHTML:GetAlpha() - Returns the opacity of the region relative to its parent
- ... = SimpleHTML:GetAnimationGroups() - Returns a list of animation groups belonging to the region
- value = SimpleHTML:GetAttribute("name") - Returns the value of a secure frame attribute
- backdrop = SimpleHTML:GetBackdrop() - Returns information about the frame's backdrop graphic
- red, green, blue, alpha = SimpleHTML:GetBackdropBorderColor() - Returns the shading color for the frame's border graphic
- red, green, blue, alpha = SimpleHTML:GetBackdropColor() - Returns the shading color for the frame's background graphic
- bottom = SimpleHTML:GetBottom() - Returns the distance from the bottom of the screen to the bottom of the region
- left, bottom, width, height = SimpleHTML:GetBoundsRect() - Returns the position and dimension of the smallest area enclosing the frame and its children
- x, y = SimpleHTML:GetCenter() - Returns the screen coordinates of the region's center
- ... = SimpleHTML:GetChildren() - Returns a list of child frames of the frame
- left, right, top, bottom = SimpleHTML:GetClampRectInsets() - Returns offsets from the frame's edges used when limiting user movement or resizing of the frame
- depth = SimpleHTML:GetDepth() - Returns the 3D depth of the frame (for stereoscopic 3D setups)
- SimpleHTML:GetDontSavePosition() - This function is not yet documented
- alpha = SimpleHTML:GetEffectiveAlpha() - Returns the overall opacity of the frame
- depth = SimpleHTML:GetEffectiveDepth() - Returns the overall 3D depth of the frame (for stereoscopic 3D configurations)
- scale = SimpleHTML:GetEffectiveScale() - Returns the overall scale factor of the frame
- level = SimpleHTML:GetFrameLevel() - Sets the level at which the frame is layered relative to others in its strata
- strata = SimpleHTML:GetFrameStrata() - Returns the general layering strata of the frame
- height = SimpleHTML:GetHeight() - Returns the height of the region
- left, right, top, bottom = SimpleHTML:GetHitRectInsets() - Returns the insets from the frame's edges which determine its mouse-interactable area
- id = SimpleHTML:GetID() - Returns the frame's numeric identifier
- left = SimpleHTML:GetLeft() - Returns the distance from the left edge of the screen to the left edge of the region
- maxWidth, maxHeight = SimpleHTML:GetMaxResize() - Returns the maximum size of the frame for user resizing
- minWidth, minHeight = SimpleHTML:GetMinResize() - Returns the minimum size of the frame for user resizing
- name = SimpleHTML:GetName() - Returns the widget object's name
- numChildren = SimpleHTML:GetNumChildren() - Returns the number of child frames belonging to the frame
- numPoints = SimpleHTML:GetNumPoints() - Returns the number of anchor points defined for the region
- numRegions = SimpleHTML:GetNumRegions() - Returns the number of non-Frame child regions belonging to the frame
- type = SimpleHTML:GetObjectType() - Returns the object's widget type
- parent = SimpleHTML:GetParent() - Returns the object's parent object
- point, relativeTo, relativePoint, xOffset, yOffset = SimpleHTML:GetPoint(index) - Returns information about one of the region's anchor points
- left, bottom, width, height = SimpleHTML:GetRect() - Returns the position and dimensions of the region
- ... = SimpleHTML:GetRegions() - Returns a list of non-Frame child regions belonging to the frame
- right = SimpleHTML:GetRight() - Returns the distance from the left edge of the screen to the right edge of the region
- scale = SimpleHTML:GetScale() - Returns the frame's scale factor
- handler = SimpleHTML:GetScript("scriptType") - Returns the widget's handler function for a script
- width, height = SimpleHTML:GetSize() - Returns the width and height of the region
- region = SimpleHTML:GetTitleRegion() - Returns the frame's TitleRegion object
- top = SimpleHTML:GetTop() - Returns the distance from the bottom of the screen to the top of the region
- width = SimpleHTML:GetWidth() - Returns the width of the region
- hasScript = SimpleHTML:HasScript("scriptType") - Returns whether the widget supports a script handler
- SimpleHTML:Hide() - Hides the region
- SimpleHTML:HookScript("scriptType", handler) - Securely hooks a script handler
- SimpleHTML:IgnoreDepth(enable) - Sets whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = SimpleHTML:IsClampedToScreen() - Returns whether the frame's boundaries are limited to those of the screen
- isDragging = SimpleHTML:IsDragging() - Returns whether the region is currently being dragged
- registered = SimpleHTML:IsEventRegistered("event") - Returns whether the frame is registered for a given [[docs/events|event]]
- enabled = SimpleHTML:IsIgnoringDepth() - Returns whether the frame's depth property is ignored (for stereoscopic 3D setups)
- enabled = SimpleHTML:IsJoystickEnabled() - Returns whether joystick interactivity is enabled for the frame
- enabled = SimpleHTML:IsKeyboardEnabled() - Returns whether keyboard interactivity is enabled for the frame
- enabled = SimpleHTML:IsMouseEnabled() - Returns whether mouse interactivity is enabled for the frame
- isOver = SimpleHTML:IsMouseOver([topOffset [, leftOffset [, bottomOffset [, rightOffset]]]]) - Returns whether the mouse cursor is over the given region
- enabled = SimpleHTML:IsMouseWheelEnabled() - Returns whether mouse wheel interactivity is enabled for the frame
- movable = SimpleHTML:IsMovable() - Returns whether the frame can be moved by the user
- isType = SimpleHTML:IsObjectType("type") - Returns whether the object belongs to a given widget type
- isProtected, explicit = SimpleHTML:IsProtected() - Returns whether the region is protected
- enabled = SimpleHTML:IsResizable() - Returns whether the frame can be resized by the user
- shown = SimpleHTML:IsShown() - Returns whether the region is shown
- enabled = SimpleHTML:IsToplevel() - Returns whether the frame is automatically raised to the front when clicked
- enabled = SimpleHTML:IsUserPlaced() - Returns whether the frame is flagged for automatic saving and restoration of position and dimensions
- visible = SimpleHTML:IsVisible() - Returns whether the region is visible
- SimpleHTML:Lower() - Reduces the frame's frame level below all other frames in its strata
- SimpleHTML:Raise() - Increases the frame's frame level above all other frames in its strata
- SimpleHTML:RegisterAllEvents() - Registers the frame for all events
- SimpleHTML:RegisterEvent("event") - Registers the frame for an [[docs/events|event]]
- SimpleHTML:RegisterForDrag(...) - Registers the frame for dragging
- SimpleHTML:SetAllPoints([region]) or SimpleHTML:SetAllPoints(["name"]) - Sets all anchor points of the region to match those of another region
- SimpleHTML:SetAlpha(alpha) - Sets the opacity of the region relative to its parent
- SimpleHTML:SetAttribute("name", value) - Sets a secure frame attribute
- SimpleHTML:SetBackdrop(backdrop) - Sets a backdrop graphic for the frame
- SimpleHTML:SetBackdropBorderColor(red, green, blue [, alpha]) - Sets a shading color for the frame's border graphic
- SimpleHTML:SetBackdropColor(red, green, blue [, alpha]) - Sets a shading color for the frame's background graphic
- SimpleHTML:SetClampRectInsets(left, right, top, bottom) - Sets offsets from the frame's edges used when limiting user movement or resizing of the frame
- SimpleHTML:SetClampedToScreen(enable) - Sets whether the frame's boundaries should be limited to those of the screen
- SimpleHTML:SetDepth(depth) - Sets the 3D depth of the frame (for stereoscopic 3D configurations)
- SimpleHTML:SetDontSavePosition() - This function is not yet documented
- SimpleHTML:SetFrameLevel(level) - Sets the level at which the frame is layered relative to others in its strata
- SimpleHTML:SetFrameStrata("strata") - Sets the general layering strata of the frame
- SimpleHTML:SetHeight(height) - Sets the region's height
- SimpleHTML:SetHitRectInsets(left, right, top, bottom) - Sets the insets from the frame's edges which determine its mouse-interactable area
- SimpleHTML:SetID(id) - Sets a numeric identifier for the frame
- SimpleHTML:SetMaxResize(maxWidth, maxHeight) - Sets the maximum size of the frame for user resizing
- SimpleHTML:SetMinResize(minWidth, minHeight) - Sets the minimum size of the frame for user resizing
- SimpleHTML:SetMovable(enable) - Sets whether the frame can be moved by the user
- SimpleHTML:SetParent(frame) or SimpleHTML:SetParent("name") - Makes another frame the parent of this region
- SimpleHTML:SetPoint("point" [, relativeTo [, "relativePoint" [, xOffset [, yOffset]]]]) - Sets an anchor point for the region
- SimpleHTML:SetResizable(enable) - Sets whether the frame can be resized by the user
- SimpleHTML:SetScale(scale) - Sets the frame's scale factor
- SimpleHTML:SetScript("scriptType", handler) - Sets the widget's handler function for a script
- SimpleHTML:SetSize(width, height) - Sets the size of the region to the specified values
- SimpleHTML:SetToplevel(enable) - Sets whether the frame should automatically come to the front when clicked
- SimpleHTML:SetUserPlaced(enable) - Flags the frame for automatic saving and restoration of position and dimensions
- SimpleHTML:SetWidth(width) - Sets the region's width
- SimpleHTML:Show() - Shows the region
- SimpleHTML:StartMoving() - Begins repositioning the frame via mouse movement
- SimpleHTML:StartSizing() - Begins resizing the frame via mouse movement
- SimpleHTML:StopAnimating() - Stops any active animations involving the region or its children
- SimpleHTML:StopMovingOrSizing() - Ends movement or resizing of the frame initiated with [[docs/widgets/Frame/StartMoving|`:StartMoving()`]] or [[docs/widgets/Frame/StartSizing|`:StartSizing()`]]
- SimpleHTML:UnregisterAllEvents() - Unregisters the frame from any [[docs/events|events]] for which it is registered
- SimpleHTML:UnregisterEvent("event") - Unregisters the frame for an event
Script Handlers
- OnAttributeChanged(self, "name", value) - Run when a frame attribute is changed
- OnChar(self, "text") - Run for each text character typed in the frame
- OnDisable(self) - Run when the frame is disabled
- OnDragStart(self, "button") - Run when the mouse is dragged starting in the frame
- OnDragStop(self) - Run when the mouse button is released after a drag started in the frame
- OnEnable(self) - Run when the frame is enabled
- OnEnter(self, motion) - Run when the mouse cursor enters the frame's interactive area
- OnEvent(self, "event", ...) - Run whenever an [[docs/events|event]] fires for which the frame is registered
- OnHide(self) - Run when the frame's visbility changes to hidden
- OnHyperlinkClick(self, "linkData", "link", "button") - Run when the mouse clicks a hyperlink in the scrolling message frame or SimpleHTML frame
- OnHyperlinkEnter(self, "linkData", "link") - Run when the mouse moves over a hyperlink in the scrolling message frame or SimpleHTML frame
- OnHyperlinkLeave(self, "linkData", "link") - Run when the mouse moves away from a hyperlink in the scrolling message frame or SimpleHTML frame
- OnKeyDown(self, "key") - Run when a keyboard key is pressed if the frame is keyboard enabled
- OnKeyUp(self, "key") - Run when a keyboard key is released if the frame is keyboard enabled
- OnLeave(self, motion) - Run when the mouse cursor leaves the frame's interactive area
- OnLoad(self) - Run when the frame is created
- OnMouseDown(self, "button") - Run when a mouse button is pressed while the cursor is over the frame
- OnMouseUp(self, "button") - Run when the mouse button is released following a mouse down action in the frame
- OnMouseWheel(self, delta) - Run when the frame receives a mouse wheel scrolling action
- OnReceiveDrag(self) - Run when the mouse button is released after dragging into the frame
- OnShow(self) - Run when the frame becomes visible
- OnSizeChanged(self, width, height) - Run when a frame's size changes
- OnUpdate(self, elapsed) - Run each time the screen is drawn by the game engine