Thursday, April 12, 2012

SimpleHTML

[:1]Simple Question:

How can i use SimpleHTML?

http://www.wowwiki.com/UIOBJECT_SimpleHTML|||Well, that actually boils down to:

- Where can I learn HTML to make web pages

and then you can use that knowledge to make/edit wowwiki.com-pages

and just in case you were on the wrong track: SimpleHTML is not an addon. It's a way to create/edit wowwiki.com-pages.|||SimpleHTML is a Widget that you can use to display simple .html (or .htm) files on the local disc. That is you can use the "file" attribute to set the SimpleHTML to show the file:


Code:
<SimpleHTML name="MyHTML" file="MyHtmlFile.html">
.. Anchors
.. Size
.. Layers
.. Frames
<FontString inherits="GameFontNormal"/>
<FontStringHeader1 inherits="GameFontNormalLarge"/>

</SimpleHTML>

The FontString and FontStringHeader1 define the font to use for normal text and the <H1> tags in the HTML file.

A good use for SimpleHTML is to create a .html file to display your add-ons patch notes and make them accessible in-game using the SimpleHTML widget.|||ok, thank you

this works for me

with one exception: the path to the html-file:

file="MyHtmlFile.html" (doesnt work)

file="Interface\AddOns\MyAddOn\MyHtmlFile.html" (works)|||I'm trying to create a SimpleHTML widget to use with AceGUI-3.0.

I believe I have the widget working, but I want to read in a html file.

How do you read in the .html file from the lua code? I thought it would basically be SimpleHTML object.file = "html file", but that does not seem to work.

Any help would greatly be appreciated!

Define the widget


Code:
-----------------------------------------------------
-- HELP WIDGET
-----------------------------------------------------
do
local Type = "SimpleHTML"
local Version = 8
local function OnAcquire(self)
self:SetText("")
end
local function OnRelease(self)
self.frame:ClearAllPoints()
self.frame:Hide()
end
local function SetText(self, text)
self.frame:SetText(text or "")
end
local function SetWidth(self, w)
self.frame:SetWidth(w)
end
local function Constructor()
local frame = CreateFrame("SimpleHTML",nil,UIParent)
local self = {}
self.type = Type
self.OnRelease = OnRelease
self.OnAcquire = OnAcquire
self.SetText = SetText
self.SetWidth = SetWidth
self.frame = frame
frame.obj = self
frame:SetHeight(18)
frame:SetWidth(200)
frame:SetFontObject(GameFontHighlightSmall)
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(Type,Constructor,Version)
end

Creating the help frame


Code:
-- Create a container frame
local f = AceGUI:Create("Frame")

f:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
f:SetTitle("Personal Loot Help")
--f:SetStatusText("Status Bar")
f:SetLayout("Flow")

local html = AceGUI:Create("SimpleHTML")
html:SetWidth(170)
html.file = "Help\PersonalLoot.html"
-- Add the SimpleHTML to the container
f:AddChild(html)

No comments:

Post a Comment