Layout-1.0
From WowAce Wiki
[edit]
API Documentation
Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.
[edit]
:CreateFrame("type" , "name" , parent , "inherit")
[edit]
Arguments
- "type"
- string - frame type, e.g. "Frame", "Button", "EditBox"
- "name"
- string - global name, can be nil
- parent
- frame - the new frame's parent. MUST be the frame object, not the name. can be nil
- "inherit"
- string - list of templates, e.g. "GameMenuButtonTemplate", "SecureActionButtonTemplate, ActionBarButtonTemplate". can be nil
[edit]
Notes
- Creates a new frame using the API version of CreateFrame with the given parameters
- it extends the frame with additional methodes like frame:SetLayout
[edit]
Returns
frame - A new frame
[edit]
Example
local button = Layout:CreateFrame("Button", "ExampleButton", UIParent, "GameMenuButtonTemplate")
buttton:SetLayout(ExampleLayout)
#FORCE_DOC
[edit]
:ExtendFrame(frame)
[edit]
Arguments
- frame
- frame - the frame to extend
[edit]
Notes
- Injects some additional methodes in the frame
- To create and extend a frame use Layout:CreateFrame
[edit]
Example
Layout:ExtendFrame(Minimap) Minimap:SetLayout(ExampleLayout) #FORCE_DOC
[edit]
:FrameClearLayout(self)
[edit]
Arguments
- self
- frame - The frame
[edit]
Notes
- Clears the frame's layout
- If the frames OnSizeChanged script is the standard function it will be removed, too
[edit]
Example
exampleFrame:ClearLayout() #FORCE_DOC
[edit]
:FrameGetLayout(self)
[edit]
Arguments
- self
- frame - The frame
[edit]
Returns
layout - The frames layout or nil
[edit]
Example
local lay = exampleFrame:GetLayout() if lay then -- ... #FORCE_DOC
[edit]
:FrameOnResize(self)
[edit]
Arguments
- self
- type - (needs documentation)
[edit]
:FrameSetLayout(self , layout)
[edit]
Arguments
- self
- frame - The frame
- layout
- layout - The frame's new layout, can be nil
[edit]
Notes
- This methode will be injected into new frames via Layout:ExtendFrame
- Sets the frame's layout
- If the frame allready has a layout or layout is nil, frame:ClearLayout() will be called
- If the frame has no OnSizeChanged script, it will be set to a standard function wich refresh the frame's layout
[edit]
Example
local frame = Layout:CreateFrame("Frame", "name", UIParent, "SomeTemplate")
local hlay = Layout:NewLayout("HLayout")
--...
frame:SetLayout(hlay)
#FORCE_DOC
[edit]
:GetLayoutClass("name")
[edit]
Arguments
- "name"
- string - The layout's name
[edit]
Notes
- Use this to access LayoutClass
[edit]
Returns
AceOO-Class - The layout class
[edit]
Example
local LayoutClass = Layout:GetLayoutClass("LayoutClass")
local MyLayout = AceOO.Class(LayoutClass)
#FORCE_DOC
[edit]
:HasLayout("name")
[edit]
Arguments
- "name"
- string - The layout's name
[edit]
Returns
- boolean - is a layout with this name registered
[edit]
Example
if not Layout:HasLayout("ExampleLayout") then
Layout:RegisterLayout("ExampleLayout", layoutObject)
end
#FORCE_DOC
[edit]
:NewLayout("name")
[edit]
Arguments
- "name"
- string - The layout's name
[edit]
Notes
- Creates and returns a new layout
- To access virtual layouts like LayoutClass use GetLayoutClass
[edit]
Returns
layout - The new layout object
[edit]
Example
local hlay = Layout:NewLayout("HLayout")
exampleFrame:SetLayout(hlay)
#FORCE_DOC
[edit]
:RegisterLayout("name" , layout)
[edit]
Arguments
- "name"
- string - The layout's name
- layout
- layout - The layout
[edit]
Notes
- Registeres the given layout with the given name.
- All layouts must inherit LayoutClass
[edit]
Example
local MyLayout = AceOO.Class(LayoutClass)
--...
Layout:RegisterLayout("ExampleLayout", MyLayout)
#FORCE_DOC
[edit]
:activate(self , oldLib , oldDeactivate)
[edit]
Arguments
- self
- type - (needs documentation)
- oldLib
- type - (needs documentation)
- oldDeactivate
- type - (needs documentation)
[edit]
:isLayout(l)
[edit]
Arguments
- l
- type - (needs documentation)
[edit]
:isWidget(w)
[edit]
Arguments
- w
- type - (needs documentation)
| | This addon page is not claimed. Please see Unclaimed Addon Pages for more details. |

