OneCore-1.0

API / OneFrame

OneFrame.lua provies frame creation and handling code for OneSuite


FrameHelpers:CustomizeFrame(db)

Will customize a frame based on the values stored in a db table

Parameters

db
the database table on which to base the customization.


FrameHelpers:GetPosition()

Gets the current positionTable of the frame, returns a string for parent


FrameHelpers:SetPosition(position)

Wrapper for setting of position, will also ClearAllPoints first

Parameters

position
represents a position

Usage

-- Only parent is required, all other values are defaults
frame:SetPosition({ parent=frame, attachAt="TOPLEFT", attachTo="TOPRIGHT", left=0, top=0 })


FrameHelpers:SetSize(width, height)

Wraper for SetWidth and SetHeight

Parameters

width
passed into SetWidth
height
passed into SetHeight


OneFrame:CreateBaseFrame(framename, width, height)

Creates a simple empty frame with the appropriate attributes and backgrounds

Parameters

framename
used as the frame's name in CreateFrame
width
the width of the frame, defaults to 200
height
the height of the frame, defaults to 200


OneFrame:CreateFontString(parent, color, size)

Creates a fontstring object

Parameters

parent
the frame the fontstring is created on
color
the text color, a rgb table, defaults to white
size
the size of the font, defaults to 13


OneFrame:CreateKeyringButton(parent)

Creates a keyring button

Parameters

parent


OneFrame:CreateMainFrame(framename, moneyType)

Creates a main frame, complete with fixins and widgets and stuff.

Parameters

framename
the name of the frame, passed into CreateFrame
moneyType
the type of moneyframe to use on this frame.


OneFrame:CreateSideBar(framename, parent, width, height)

Creates a sidebar frame and attaches it to the given base frame.

Parameters

framename
used as the frame's name in CreateFrame
parent
the frame to attach to
width
the width of the frame, defaults to 60
height
the height of the frame, defaults to 223


OneFrame:CreateSmallMoneyFrame(framename, parent, type)

Creates a small money frame that's slightly customized

Parameters

framename
the name used when creating the moneyframe
parent
the frame this moneyframe will belong to
type
the type of money frame we're making


setup_embed_and_upgrade(lib, store, mixins)

This will setup the embed function on the library as well as upgrade any old embeds will also upgrade the store

Parameters

lib
the library being setup
store
a table used to keep track of what was previously embedded, this is for upgrading.
mixins
a table of what needs to be mixed in


You must login to post a comment. Don't have an account? Register to get one!