Layout-1.0

From WowAce Wiki
Jump to: navigation, search

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:CreateFrame("type" , "name" , parent , "inherit")

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

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

Returns

frame - A new frame

Example

  local button = Layout:CreateFrame("Button", "ExampleButton", UIParent, "GameMenuButtonTemplate")
  buttton:SetLayout(ExampleLayout)
#FORCE_DOC

:ExtendFrame(frame)

Arguments

frame
frame - the frame to extend

Notes

  • Injects some additional methodes in the frame
  • To create and extend a frame use Layout:CreateFrame

Example

  Layout:ExtendFrame(Minimap)
  Minimap:SetLayout(ExampleLayout)
#FORCE_DOC

:FrameClearLayout(self)

Arguments

self
frame - The frame

Notes

  • Clears the frame's layout
  • If the frames OnSizeChanged script is the standard function it will be removed, too

Example

  exampleFrame:ClearLayout()
#FORCE_DOC

:FrameGetLayout(self)

Arguments

self
frame - The frame

Returns

layout - The frames layout or nil

Example

  local lay = exampleFrame:GetLayout()
  if lay then
  -- ...
#FORCE_DOC

:FrameOnResize(self)

Arguments

self
type - (needs documentation)


:FrameSetLayout(self , layout)

Arguments

self
frame - The frame
layout
layout - The frame's new layout, can be nil

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

Example

  local frame = Layout:CreateFrame("Frame", "name", UIParent, "SomeTemplate")
  local hlay  = Layout:NewLayout("HLayout")
  --...
  frame:SetLayout(hlay) 
#FORCE_DOC

:GetLayoutClass("name")

Arguments

"name"
string - The layout's name

Notes

  • Use this to access LayoutClass

Returns

AceOO-Class - The layout class

Example

  local LayoutClass = Layout:GetLayoutClass("LayoutClass")
  local MyLayout = AceOO.Class(LayoutClass)
#FORCE_DOC

:HasLayout("name")

Arguments

"name"
string - The layout's name

Returns

  • boolean - is a layout with this name registered

Example

  if not Layout:HasLayout("ExampleLayout") then
    Layout:RegisterLayout("ExampleLayout", layoutObject)
  end
#FORCE_DOC

:NewLayout("name")

Arguments

"name"
string - The layout's name

Notes

  • Creates and returns a new layout
  • To access virtual layouts like LayoutClass use GetLayoutClass

Returns

layout - The new layout object

Example

  local hlay = Layout:NewLayout("HLayout")
  exampleFrame:SetLayout(hlay)
#FORCE_DOC

:RegisterLayout("name" , layout)

Arguments

"name"
string - The layout's name
layout
layout - The layout

Notes

  • Registeres the given layout with the given name.
  • All layouts must inherit LayoutClass

Example

  local MyLayout = AceOO.Class(LayoutClass)
  --...
  Layout:RegisterLayout("ExampleLayout", MyLayout)
#FORCE_DOC

:activate(self , oldLib , oldDeactivate)

Arguments

self
type - (needs documentation)
oldLib
type - (needs documentation)
oldDeactivate
type - (needs documentation)


:isLayout(l)

Arguments

l
type - (needs documentation)


:isWidget(w)

Arguments

w
type - (needs documentation)
Ability Vanish.png This addon page is not claimed.
Please see Unclaimed Addon Pages for more details.