LibFrameAnchorRegistry-1.0

This project is abandoned.

Whether this project is out of date or its author marked it as abandoned, this project is no longer maintained.

If you wish to take this project over, please report it and state your intentions.

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)

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

  • 2 comments
  • Avatar of mangeg mangeg Nov 12, 2010 at 10:57 UTC - 0 likes

    Sorry, missed this comment. Will be corrected in the next.

  • Avatar of rsmozang rsmozang Oct 28, 2010 at 22:23 UTC - 0 likes

    Please rename the root directory "LibFrameAnchorRegistry-1.0" instead of "LibFrameAnchorRegistry-1-0" or change the .toc file name to "LibFrameAnchorRegistry-1-0". Thanks.

  • 2 comments

Facts

Date created
Oct 23, 2010
Category
Last update
Aug 28, 2012
Development stage
Abandoned
License
All Rights Reserved
Downloads
1,349
Recent files

Authors