API Docs (pts)
A UI element of type Layout or derived from Layout.
Signals that the frame's vertices have moved.
Usage:
Signals that the frame's size has changed.
Usage:
Attaches an event handler to an event.
Usage:
| Layout:EventAttach(handle, callback, label) |
| Layout:EventAttach(handle, callback, label, priority) |
| Parameter | Type | Datatype | Description |
| callback | parameter | function | A global event handler function. This will be called when the event fires. The first parameter will be the standard frame event handle, any other parameters will follow that. |
| handle | parameter | eventFrame | A handle to a frame event, usually pulled out of the "Event.UI." hierarchy. |
| label | parameter | string | Human-readable label used to identify the handler in error reports, performance reports, and for later detaching. |
| priority | parameter | number | Priority of the event handler. Higher numbers trigger first. |
- noSecureFrameAndEnvironment
- true
Detaches an event handler from an event. Any parameter can be 'nil', and this is interpreted as a wildcard. If multiple events match the constraints, only one will be detached.
Usage:
| Layout:EventDetach(handle, callback) |
| Layout:EventDetach(handle, callback, label) |
| Layout:EventDetach(handle, callback, label, priority) |
| Layout:EventDetach(handle, callback, label, priority, owner) |
| Parameter | Type | Datatype | Description |
| callback | parameter | function/nil | A callback function to search for. |
| handle | parameter | eventFrame | A handle to a frame event, usually pulled out of the "Event.UI." hierarchy. |
| label | parameter | string/nil | Human-readable label used to identify the handler in error reports, performance reports, and for later detaching. |
| owner | parameter | string/nil | Owner to search for. |
| priority | parameter | number/nil | Priority of the event handler. Higher numbers trigger first. |
Lists the current event handlers for an event.
Usage:
| result = Layout:EventList(handle) |
| Parameter | Type | Datatype | Description |
| handle | parameter | eventFrame | A handle to a frame event, usually pulled out of the "Event.UI." hierarchy. |
| result | result | table | A table of event handlers for this event. |
- members
-
| handler |
The handler that will be called when the event fires.
|
| label |
Human-readable label used to identify the handler in error reports, performance reports, and for later detaching.
|
| macro |
The macro that will run when the event fires.
|
| owner |
Owner to search for.
|
| priority |
Priority of the event handler. Higher numbers trigger first.
|
Gets the macro that will be triggered when this event occurs.
Usage:
| macro = Layout:EventMacroGet(handle) |
| Parameter | Type | Datatype | Description |
| handle | parameter | eventFrame | A handle to a frame event, usually pulled out of the "Event.UI." hierarchy. |
| macro | result | string/nil | The macro that will be triggered. |
Sets the macro that will be triggered when this event occurs.
Usage:
| Layout:EventMacroSet(handle, macro) |
| Parameter | Type | Datatype | Description |
| handle | parameter | eventFrame | A handle to a frame event, usually pulled out of the "Event.UI." hierarchy. |
| macro | parameter | string/nil | The macro to trigger. nil to clear the macro. |
- requireSecureFrameAndInsecureEnvironment
- true
Retrieves the Y position of the bottom edge of this element.
Usage:
| bottom = Layout:GetBottom() |
| Parameter | Type | Datatype | Description |
| bottom | result | number | The Y position of the bottom edge of this element. |
Retrieves the complete bounds of this element.
Usage:
| left, top, right, bottom = Layout:GetBounds() |
| Parameter | Type | Datatype | Description |
| bottom | result | number | The Y position of the bottom edge of this element. |
| left | result | number | The X position of the left edge of this element. |
| right | result | number | The X position of the right edge of this element. |
| top | result | number | The Y position of the top edge of this element. |
Retrieves the event table of this element. By default, this value is also stored in "this.Event".
Usage:
| eventTable = Layout:GetEventTable() |
| Parameter | Type | Datatype | Description |
| eventTable | result | table | The event table of this element. |
Retrieves the height of this element.
Usage:
| height = Layout:GetHeight() |
| Parameter | Type | Datatype | Description |
| height | result | number | The height of this element. |
Retrieves the X position of the left edge of this element.
Usage:
| left = Layout:GetLeft() |
| Parameter | Type | Datatype | Description |
| left | result | number | The X position of the left edge of this element. |
Retrieves the name of this element.
Usage:
| name = Layout:GetName() |
| Parameter | Type | Datatype | Description |
| name | result | string | The name of this element, as provided by the addon that created it. |
Retrieves the owner of this element.
Usage:
| owner = Layout:GetOwner() |
| Parameter | Type | Datatype | Description |
| owner | result | string | The owner of this element. Given as an addon identifier. |
Retrieves the X position of the right edge of this element.
Usage:
| right = Layout:GetRight() |
| Parameter | Type | Datatype | Description |
| right | result | number | The X position of the right edge of this element. |
Retrieves the Y position of the top edge of this element.
Usage:
| top = Layout:GetTop() |
| Parameter | Type | Datatype | Description |
| top | result | number | The Y position of the top edge of this element. |
Retrieves the type of this element.
Usage:
| type = Layout:GetType() |
| Parameter | Type | Datatype | Description |
| type | result | string | The type of this element. |
Retrieves the width of this element.
Usage:
| width = Layout:GetWidth() |
| Parameter | Type | Datatype | Description |
| width | result | number | The width of this element. |
Read all set points and sizes from this frame.
Usage:
| results = Layout:ReadAll() |
| Parameter | Type | Datatype | Description |
| results | result | table | Result table. Contains data in the following format: {x = {size = (size), [(position)] = {layout = (layout), position = (position), offset = (offset)}}, y = (the same thing)}. |
Read a set height from this frame.
Usage:
| height = Layout:ReadHeight() |
| Parameter | Type | Datatype | Description |
| height | result | number | The parameter passed to SetHeight(), or nil if no such parameter has been passed. |
Read a set point from this frame. Must be given a single-axis coordinate.
Usage:
| layout, position, offset = Layout:ReadPoint(coordinate) |
| layout, position, offset = Layout:ReadPoint(x, y) |
| origin, offset = Layout:ReadPoint(coordinate) |
| origin, offset = Layout:ReadPoint(x, y) |
| Parameter | Type | Datatype | Description |
| coordinate | parameter | string | Named coordinate. Must be a one-axis coordinate. |
| x | parameter | number/nil | X coordinate of the point. Either this or Y must be nil. |
| y | parameter | number/nil | Y coordinate of the point. Either this or X must be nil. |
| layout | result | Layout | The table that this point is pinned to. |
| offset | result | number | The offset in pixels from the source location to the actual location. |
| origin | result | string | The string "origin". |
| position | result | number | The position on "layout" that this point is pinned. 0 refers to the top or left edge, 1 refers to the bottom or right edge. |
Read a set width from this frame.
Usage:
| width = Layout:ReadWidth() |
| Parameter | Type | Datatype | Description |
| width | result | number | The parameter passed to SetWidth(), or nil if no such parameter has been passed. |