Central registry for addons to register their frames as possible frame anchor. Other addons can then retrieve the list of anchor and then let their user anchor the addon to whatever frame they like.
To register a frame with the registry:
LibStub("LibFrameAnchorRegistry-1.0"):RegisterAnchor("MyCateogry", "NameOfFrame", "Identidy", frame)
To register with sub-categories:
LibStub("LibFrameAnchorRegistry-1.0"):RegisterAnchor("MyCateogry\001MySub-Category", "NameOfFrame", "Identidy", frame)
To retrieve the actual frame:
local anchor = LibStub("LibFrameAnchorRegistry-1.0"):GetAnchor(db.AnchorID)
To use with AceConfig:
local frame CreateFrame("Frame", nil, UIparent) local options = { type = "group", args = { drop = { name = "Test", desc = "Some testing", type = "select", width = "double", values = function() return LibStub("LibFrameAnchorRegistry-1.0"):GetAnchors(frame) end, set = function(info, ident, name, frame) db.AnchorID = ident end, get = function() return db.AnchorID end, dialogControl = "FrameAnchorDropdown", }, }, } LibStub("AceConfig-3.0"):RegisterOptionsTable("Options", options, {"/myslash", "/my"})
To use stand-alone:
local frame CreateFrame("Frame", nil, UIparent) local t = AceGUI:Create("FrameAnchorDropdown") t:SetList(FA:GetAnchors(frame )) t:SetLabel("Anchor") t:SetValue(db.FrameAnchorID) t:SetCallback("OnValueChanged", function(self, event, ident, name, frame) db.FrameAnchorID = ident end)
- 2 comments
- 2 comments
Facts
- Date created
- Oct 23, 2010
- Category
- Last update
- Aug 28, 2012
- Development stage
- Beta
- License
- All Rights Reserved
- Curse link
- LibFrameAnchorRegistry-1.0
- Downloads
- 1,146
- Recent files
- A: 0.1b-8-g8c3be6b for 5.0.4 Aug 28, 2012
- A: 0.1b-6-g6da2656 for 4.0.1 Nov 13, 2010
- A: 0.1b-5-g53054bb for 4.0.1 Nov 13, 2010
- A: 0.1b-3-g733196d for 4.0.1 Nov 06, 2010
- A: 0.1b-2-gf7ee88a for 4.0.1 Oct 27, 2010
- Reply
- #2
mangeg Nov 12, 2010 at 10:57 UTC - 0 likesSorry, missed this comment. Will be corrected in the next.
- Reply
- #1
rsmozang Oct 28, 2010 at 22:23 UTC - 0 likesPlease rename the root directory "LibFrameAnchorRegistry-1.0" instead of "LibFrameAnchorRegistry-1-0" or change the .toc file name to "LibFrameAnchorRegistry-1-0". Thanks.