468 lines
16 KiB
Lua
468 lines
16 KiB
Lua
---@meta
|
|
|
|
---@class Frame : Region
|
|
Frame = {
|
|
--- Aborts the current drag operation.
|
|
--- @example
|
|
--- myFrame:AbortDrag()
|
|
AbortDrag = function(self) end,
|
|
|
|
--- Returns true if secure frame attributes can be changed.
|
|
--- @return boolean canChange True if attributes can be changed.
|
|
--- @example
|
|
--- local canChange = myFrame:CanChangeAttribute()
|
|
CanChangeAttribute = function(self) end,
|
|
|
|
--- Creates and returns a FontString as a child of this Frame.
|
|
--- @param self Frame
|
|
--- @param name string? Optional. The name of the FontString.
|
|
--- @param layer string? Optional. The layer of the FontString.
|
|
--- @param inheritsFrom string? Optional. The name of the FontString to inherit from.
|
|
--- @return FontString fontString The created FontString.
|
|
--- @example
|
|
--- local myFontString = myFrame:CreateFontString("MyFontString", "OVERLAY")
|
|
CreateFontString = function(self, name, layer, inheritsFrom) end,
|
|
|
|
--- Creates a Texture as a child of this Frame.
|
|
--- @param self Frame
|
|
--- @param name string? Optional. The name of the Texture.
|
|
--- @param layer string? Optional. The layer of the Texture.
|
|
--- @param inheritsFrom string? Optional. The name of the Texture to inherit from.
|
|
--- @return Texture texture The created Texture.
|
|
--- @example
|
|
--- local myTexture = myFrame:CreateTexture("MyTexture", "BACKGROUND")
|
|
CreateTexture = function(self, name, layer, inheritsFrom) end,
|
|
|
|
--- Creates a title region for the frame if it does not have one.
|
|
--- @param self Frame
|
|
--- @return Region titleRegion The created title region.
|
|
--- @example
|
|
--- myFrame:CreateTitleRegion()
|
|
CreateTitleRegion = function(self) end,
|
|
|
|
--- Disables rendering of "regions" (fontstrings, textures) in the specified draw layer.
|
|
--- @param self Frame
|
|
--- @param layer string The layer to disable.
|
|
--- @example
|
|
--- myFrame:DisableDrawLayer("BORDER")
|
|
DisableDrawLayer = function(self, layer) end,
|
|
|
|
--- Enables rendering of "regions" (fontstrings, textures) in the specified draw layer.
|
|
--- @param self Frame
|
|
--- @param layer string The layer to enable.
|
|
--- @example
|
|
--- myFrame:EnableDrawLayer("BORDER")
|
|
EnableDrawLayer = function(self, layer) end,
|
|
|
|
--- Sets the opacity of the frame.
|
|
--- @param self Frame
|
|
--- @param alpha number The opacity value (0 to 1).
|
|
--- @example
|
|
--- myFrame:SetAlpha(0.5) -- Set to 50% opacity
|
|
SetAlpha = function(self, alpha) end,
|
|
|
|
--- Returns the frame's numeric identifier.
|
|
--- @param self Frame
|
|
--- @return number id The frame's ID.
|
|
--- @example
|
|
--- local id = myFrame:GetID()
|
|
GetID = function(self) end,
|
|
|
|
--- Shows this object (it will appear if its parent is visible).
|
|
--- @example
|
|
--- myFrame:Show()
|
|
Show = function(self) end,
|
|
|
|
--- Hides this object (it and all of its children will disappear).
|
|
--- @example
|
|
--- myFrame:Hide()
|
|
Hide = function(self) end,
|
|
|
|
--- Starts moving the frame via mouse movement.
|
|
--- @example
|
|
--- myFrame:StartMoving()
|
|
StartMoving = function(self) end,
|
|
|
|
--- Stops moving the frame.
|
|
--- @example
|
|
--- myFrame:StopMovingOrSizing()
|
|
StopMovingOrSizing = function(self) end,
|
|
|
|
--- Sets whether the frame can be moved.
|
|
--- @param self Frame
|
|
--- @param movable boolean True to allow moving.
|
|
--- @example
|
|
--- myFrame:SetMovable(true)
|
|
SetMovable = function(self, movable) end,
|
|
|
|
--- Sets the frame's level.
|
|
--- @param self Frame
|
|
--- @param level number The level to set.
|
|
--- @example
|
|
--- myFrame:SetFrameLevel(5)
|
|
SetFrameLevel = function(self, level) end,
|
|
|
|
--- Sets the frame's strata.
|
|
--- @param self Frame
|
|
--- @param strata string The strata to set (e.g., "BACKGROUND", "MEDIUM", "HIGH").
|
|
--- @example
|
|
--- myFrame:SetFrameStrata("HIGH")
|
|
SetFrameStrata = function(self, strata) end,
|
|
|
|
--- Registers the frame for a specific event.
|
|
--- @param self Frame
|
|
--- @param eventName string The name of the event to register.
|
|
--- @example
|
|
--- myFrame:RegisterEvent("PLAYER_LOGIN")
|
|
RegisterEvent = function(self, eventName) end,
|
|
|
|
--- Unregisters an event from the frame.
|
|
--- @param self Frame
|
|
--- @param eventName string The name of the event to unregister.
|
|
--- @example
|
|
--- myFrame:UnregisterEvent("PLAYER_LOGIN")
|
|
UnregisterEvent = function(self, eventName) end,
|
|
|
|
--- Sets the backdrop of the frame according to the specification provided.
|
|
--- @param self Frame
|
|
--- @param backdropTable table? Optional. A table defining the backdrop.
|
|
--- @example
|
|
--- myFrame:SetBackdrop({bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background"})
|
|
SetBackdrop = function(self, backdropTable) end,
|
|
|
|
--- Sets the frame's backdrop color.
|
|
--- @param self Frame
|
|
--- @param r number The red component of the color.
|
|
--- @param g number The green component of the color.
|
|
--- @param b number The blue component of the color.
|
|
--- @param a number? Optional. The alpha component of the color.
|
|
--- @example
|
|
--- myFrame:SetBackdropColor(0, 0, 0, 0.5) -- Set to semi-transparent black
|
|
SetBackdropColor = function(self, r, g, b, a) end,
|
|
|
|
--- Sets the frame's backdrop border color.
|
|
--- @param self Frame
|
|
--- @param r number The red component of the border color.
|
|
--- @param g number The green component of the border color.
|
|
--- @param b number The blue component of the border color.
|
|
--- @param a number? Optional. The alpha component of the border color.
|
|
--- @example
|
|
--- myFrame:SetBackdropBorderColor(1, 1, 1) -- Set to white
|
|
SetBackdropBorderColor = function(self, r, g, b, a) end,
|
|
|
|
--- Sets whether this frame will get keyboard input.
|
|
--- @param self Frame
|
|
--- @param enableFlag boolean True to enable keyboard input.
|
|
--- @example
|
|
--- myFrame:EnableKeyboard(true)
|
|
EnableKeyboard = function(self, enableFlag) end,
|
|
|
|
--- Sets whether this frame will get mouse input.
|
|
--- @param self Frame
|
|
--- @param enableFlag boolean True to enable mouse input.
|
|
--- @example
|
|
--- myFrame:EnableMouse(true)
|
|
EnableMouse = function(self, enableFlag) end,
|
|
|
|
--- Sets whether this frame will get mouse wheel notifications.
|
|
--- @param self Frame
|
|
--- @param enableFlag boolean True to enable mouse wheel notifications.
|
|
--- @example
|
|
--- myFrame:EnableMouseWheel(true)
|
|
EnableMouseWheel = function(self, enableFlag) end,
|
|
|
|
--- Sets the height of the object.
|
|
--- @param self Frame
|
|
--- @param height number The height to set.
|
|
--- @example
|
|
--- myFrame:SetHeight(200)
|
|
SetHeight = function(self, height) end,
|
|
|
|
--- Sets the width of the object.
|
|
--- @param self Frame
|
|
--- @param width number The width to set.
|
|
--- @example
|
|
--- myFrame:SetWidth(300)
|
|
SetWidth = function(self, width) end,
|
|
|
|
--- Sets the size of the frame.
|
|
--- @param self Frame
|
|
--- @param width number The width to set.
|
|
--- @param height number The height to set.
|
|
--- @example
|
|
--- myFrame:SetSize(300, 200)
|
|
SetSize = function(self, width, height) end,
|
|
|
|
--- Sets the parent for this frame.
|
|
--- @param self Frame|string The parent frame or name of the parent frame.
|
|
--- @example
|
|
--- myFrame:SetParent(otherFrame)
|
|
SetParent = function(self, parent) end,
|
|
|
|
--- Returns the first existing attribute of (prefix..name..suffix), ("*"..name..suffix), (prefix..name.."*"), ("*"..name.."*"), (name).
|
|
--- @param self Frame
|
|
--- @param prefix string The prefix to use.
|
|
--- @param name string The name of the attribute.
|
|
--- @param suffix string The suffix to use.
|
|
--- @return any attribute The found attribute.
|
|
--- @example
|
|
--- local attr = myFrame:GetAttribute("prefix", "name", "suffix")
|
|
GetAttribute = function(self, prefix, name, suffix) end,
|
|
|
|
--- Creates and returns a backdrop table suitable for use in SetBackdrop.
|
|
--- @param self Frame
|
|
--- @return table backdropTable The backdrop table.
|
|
--- @example
|
|
--- local backdrop = myFrame:GetBackdrop()
|
|
GetBackdrop = function(self) end,
|
|
|
|
--- Gets the frame's backdrop border color (r, g, b, a).
|
|
--- @param self Frame
|
|
--- @return number r The red component.
|
|
--- @return number g The green component.
|
|
--- @return number b The blue component.
|
|
--- @return number a The alpha component.
|
|
--- @example
|
|
--- local r, g, b, a = myFrame:GetBackdropBorderColor()
|
|
GetBackdropBorderColor = function(self) end,
|
|
|
|
--- Gets the frame's backdrop color (r, g, b, a).
|
|
--- @param self Frame
|
|
--- @return number r The red component.
|
|
--- @return number g The green component.
|
|
--- @return number b The blue component.
|
|
--- @return number a The alpha component.
|
|
--- @example
|
|
--- local r, g, b, a = myFrame:GetBackdropColor()
|
|
GetBackdropColor = function(self) end,
|
|
|
|
--- Gets the list of "children" (frames and things derived from frames) of this frame.
|
|
--- @param self Frame
|
|
--- @return table children The list of child frames.
|
|
--- @example
|
|
--- local children = myFrame:GetChildren()
|
|
GetChildren = function(self) end,
|
|
|
|
--- Gets the modifiers to the frame's rectangle used for clamping the frame to screen.
|
|
--- @param self Frame
|
|
--- @return number left The left modifier.
|
|
--- @return number right The right modifier.
|
|
--- @return number top The top modifier.
|
|
--- @return number bottom The bottom modifier.
|
|
--- @example
|
|
--- local left, right, top, bottom = myFrame:GetClampRectInsets()
|
|
GetClampRectInsets = function(self) end,
|
|
|
|
--- Gets the effective alpha of a frame.
|
|
--- @param self Frame
|
|
--- @return number alpha The effective alpha.
|
|
--- @example
|
|
--- local alpha = myFrame:GetEffectiveAlpha()
|
|
GetEffectiveAlpha = function(self) end,
|
|
|
|
--- Gets the scale factor of this object relative to the root window.
|
|
--- @param self Frame
|
|
--- @return number scale The effective scale.
|
|
--- @example
|
|
--- local scale = myFrame:GetEffectiveScale()
|
|
GetEffectiveScale = function(self) end,
|
|
|
|
--- Gets the level of this frame.
|
|
--- @param self Frame
|
|
--- @return number level The frame level.
|
|
--- @example
|
|
--- local level = myFrame:GetFrameLevel()
|
|
GetFrameLevel = function(self) end,
|
|
|
|
--- Gets the strata of this frame.
|
|
--- @param self Frame
|
|
--- @return string strata The frame strata.
|
|
--- @example
|
|
--- local strata = myFrame:GetFrameStrata()
|
|
GetFrameStrata = function(self) end,
|
|
|
|
--- Gets the type of this frame.
|
|
--- @param self Frame
|
|
--- @return string frameType The frame type.
|
|
--- @example
|
|
--- local frameType = myFrame:GetFrameType()
|
|
GetFrameType = function(self) end,
|
|
|
|
--- Gets the frame's hit rectangle inset distances (l, r, t, b).
|
|
--- @param self Frame
|
|
--- @return number left The left inset.
|
|
--- @return number right The right inset.
|
|
--- @return number top The top inset.
|
|
--- @return number bottom The bottom inset.
|
|
--- @example
|
|
--- local left, right, top, bottom = myFrame:GetHitRectInsets()
|
|
GetHitRectInsets = function(self) end,
|
|
|
|
--- Gets the frame's maximum allowed resize bounds (w, h).
|
|
--- @param self Frame
|
|
--- @return number maxWidth The maximum width.
|
|
--- @return number maxHeight The maximum height.
|
|
--- @example
|
|
--- local maxWidth, maxHeight = myFrame:GetMaxResize()
|
|
GetMaxResize = function(self) end,
|
|
|
|
--- Gets the frame's minimum allowed resize bounds (w, h).
|
|
--- @param self Frame
|
|
--- @return number minWidth The minimum width.
|
|
--- @return number minHeight The minimum height.
|
|
--- @example
|
|
--- local minWidth, minHeight = myFrame:GetMinResize()
|
|
GetMinResize = function(self) end,
|
|
|
|
--- Gets the number of "children" (frames and things derived from frames) this frame has.
|
|
--- @param self Frame
|
|
--- @return number numChildren The number of children.
|
|
--- @example
|
|
--- local numChildren = myFrame:GetNumChildren()
|
|
GetNumChildren = function(self) end,
|
|
|
|
--- Returns the number of "regions" (fontstrings, textures) belonging to this frame.
|
|
--- @param self Frame
|
|
--- @return number numRegions The number of regions.
|
|
--- @example
|
|
--- local numRegions = myFrame:GetNumRegions()
|
|
GetNumRegions = function(self) end,
|
|
|
|
--- Returns the "regions" (fontstrings, textures) of the frame (multiple return values) belonging to this frame.
|
|
--- @param self Frame
|
|
--- @return ... any regions The regions belonging to this frame.
|
|
--- @example
|
|
--- local regions = {myFrame:GetRegions()}
|
|
GetRegions = function(self) end,
|
|
|
|
--- Gets the scale factor of this object relative to its parent.
|
|
--- @param self Frame
|
|
--- @return number scale The scale factor.
|
|
--- @example
|
|
--- local scale = myFrame:GetScale()
|
|
GetScale = function(self) end,
|
|
|
|
--- Gets the function for one of this frame's handlers.
|
|
--- @param self Frame
|
|
--- @param handler string The handler name.
|
|
--- @return function handlerFunction The handler function.
|
|
--- @example
|
|
--- local handlerFunction = myFrame:GetScript("OnClick")
|
|
GetScript = function(self, handler) end,
|
|
|
|
--- Returns true if the frame can be given a handler of the specified type.
|
|
--- @param self Frame
|
|
--- @param handler string The handler name.
|
|
--- @return boolean canHaveHandler True if it can have the handler.
|
|
--- @example
|
|
--- local canHaveHandler = myFrame:HasScript("OnClick")
|
|
HasScript = function(self, handler) end,
|
|
|
|
--- Hooks a secure frame script.
|
|
--- @param self Frame
|
|
--- @param handler string The handler name.
|
|
--- @param func function The function to hook.
|
|
--- @example
|
|
--- myFrame:HookScript("OnClick", function() print("Clicked!") end)
|
|
HookScript = function(self, handler, func) end,
|
|
|
|
--- Sets whether the frame is prohibited from being dragged off screen.
|
|
--- @param self Frame
|
|
--- @param clamped boolean True to enable clamping.
|
|
--- @example
|
|
--- myFrame:SetClampedToScreen(true)
|
|
SetClampedToScreen = function(self, clamped) end,
|
|
|
|
--- Modifies the frame's rectangle used to prevent dragging offscreen.
|
|
--- @param self Frame
|
|
--- @param left number The left inset.
|
|
--- @param right number The right inset.
|
|
--- @param top number The top inset.
|
|
--- @param bottom number The bottom inset.
|
|
--- @example
|
|
--- myFrame:SetClampRectInsets(5, 5, 5, 5)
|
|
SetClampRectInsets = function(self, left, right, top, bottom) end,
|
|
|
|
--- Sets the inset distances for the frame's hit rectangle.
|
|
--- @param self Frame
|
|
--- @param left number The left inset.
|
|
--- @param right number The right inset.
|
|
--- @param top number The top inset.
|
|
--- @param bottom number The bottom inset.
|
|
--- @example
|
|
--- myFrame:SetHitRectInsets(5, 5, 5, 5)
|
|
SetHitRectInsets = function(self, left, right, top, bottom) end,
|
|
|
|
--- Sets the ID of this frame.
|
|
--- @param self Frame
|
|
--- @param id number The ID to set.
|
|
--- @example
|
|
--- myFrame:SetID(1)
|
|
SetID = function(self, id) end,
|
|
|
|
--- Sets the maximum dimensions this frame can be resized to.
|
|
--- @param self Frame
|
|
--- @param maxWidth number The maximum width.
|
|
--- @param maxHeight number The maximum height.
|
|
--- @example
|
|
--- myFrame:SetMaxResize(800, 600)
|
|
SetMaxResize = function(self, maxWidth, maxHeight) end,
|
|
|
|
--- Sets the minimum dimensions this frame can be resized to.
|
|
--- @param self Frame
|
|
--- @param minWidth number The minimum width.
|
|
--- @param minHeight number The minimum height.
|
|
--- @example
|
|
--- myFrame:SetMinResize(200, 150)
|
|
SetMinResize = function(self, minWidth, minHeight) end,
|
|
|
|
--- Sets whether the frame can be resized.
|
|
--- @param self Frame
|
|
--- @param isResizable boolean True to make the frame resizable.
|
|
--- @example
|
|
--- myFrame:SetResizable(true)
|
|
SetResizable = function(self, isResizable) end,
|
|
|
|
--- Sets the scale factor of this frame relative to its parent.
|
|
--- @param self Frame
|
|
--- @param scale number The scale factor to set.
|
|
--- @example
|
|
--- myFrame:SetScale(1.5)
|
|
SetScale = function(self, scale) end,
|
|
|
|
--- Sets the function to use for a handler on this frame.
|
|
--- @param self Frame
|
|
--- @param handler string The handler name.
|
|
--- @param func function The function to set.
|
|
--- @example
|
|
--- myFrame:SetScript("OnClick", function() print("Clicked!") end)
|
|
SetScript = function(self, handler, func) end,
|
|
|
|
--- Sets whether the frame should raise itself when clicked.
|
|
--- @param self Frame
|
|
--- @param isTopLevel boolean True to set as top-level.
|
|
--- @example
|
|
--- myFrame:SetToplevel(true)
|
|
SetToplevel = function(self, isTopLevel) end,
|
|
|
|
--- Sets whether the frame has been relocated by the user.
|
|
--- @param self Frame
|
|
--- @param isUserPlaced boolean True to mark as user-placed.
|
|
--- @example
|
|
--- myFrame:SetUserPlaced(true)
|
|
SetUserPlaced = function(self, isUserPlaced) end,
|
|
|
|
--- Starts sizing this frame using the specified anchor point.
|
|
--- @param self Frame
|
|
--- @param point string The anchor point to use.
|
|
--- @example
|
|
--- myFrame:StartSizing("TOPLEFT")
|
|
StartSizing = function(self, point) end,
|
|
|
|
--- Indicates that this frame should no longer be notified when any events occur.
|
|
--- @param self Frame
|
|
--- @example
|
|
--- myFrame:UnregisterAllEvents()
|
|
UnregisterAllEvents = function(self) end,
|
|
}
|