-
-
Notifications
You must be signed in to change notification settings - Fork 2
Menu
Documentation for the Menu object. Created with LibDropDown:NewMenu().
See Menu:Toggle().
Toggles the dropdown menu, closing all others (see LibDropDown:CloseAll()).
Update a line with the given index with the supplied data.
-
index
: menu line index (integer) -
data
: line data (table) (see Menu:AddLine(data))
See Menu:AddLine(data), this one does the exact same thing, except
this one can add more than one line at a time.
-
...
: One or more tables containing line information.
Adds a line using the given data to the menu menu.
Everything™ is optional, some are exclusive with others.
-
data
: -
text
: Text to show on the line (string) -
isTitle
: Turns thetext
into a title (boolean) -
isSpacer
: Turns the line into a spacer (boolean) -
func
: Function to execute when clicking the line (function)
Arguments passed:button
,args
(unpacked). -
keepShown
: Keeps the dropdown shown after clicking the line (boolean) -
args
: Table of arguments to pass through to the click function (table) -
tooltip
: Tooltip contents (string) -
tooltipTitle
: Tooltip title (string) -
tooltipWhileDisabled
: Enable tooltips while disabled (boolean) -
checked
: Show or hide a checkbox (boolean/function) -
isRadio
: Turns the checkbox into a radio button (boolean) -
isColorPicker
: Adds a color picker to the line (boolean) -
colorR
: Red color channel, 0-1 (number) -
colorG
: Green color channel, 0-1 (number) -
colorB
: Blue color channel, 0-1 (number) -
colorOpacity
: Alpha channel, 0-1 (number) -
colorPickerCallback
: Callback function for the color picker (function)
Arguments passed:color
, see SharedXML\Util.lua's ColorMixin. -
icon
: Texture path for the icon to embed into the start oftext
(string) -
iconTexCoords
: Texture coordinates for cropping theicon
(array) -
iconWidth
: Width of the displayedicon
(number) -
iconHeight
: Height of the displayedicon
(number) -
iconFileWidth
: File width of theicon
(number) -
iconFileHeight
: File height of theicon
(number) -
atlas
: Atlas to embed into the start oftext
(string) -
atlasWidth
: Width of the displayedatlas
(number) -
atlasHeight
: Height of the displayedatlas
(number) -
atlasOffsetX
: Horizontal offset foratlas
(number) -
atlasOffsetY
: Vertical offset foratlas
(number) -
atlasOffset
: Common offset for both axis foratlas
(number) -
disabled
: Disables the whole line (boolean) -
texture
: Sets background texture that spans the line (string) -
textureColor
: Sets the color of the background texture (ColorMixin object) -
font
: Font to use for the line (string) -
fontSize
: Font size to use for the line, requiresfont
to be set (number) -
fontFlags
: Font flags to use for the line, requiresfont
to be set (string) -
fontObject
: Font object to use for the line (string/FontInstance) -
menu
: Sub-menu for the current menu line (array)
This needs to contain one or more tables ofdata
(all of the above) in an
indexed array. Can be chained.
The following are exclusive options, only one can be used at a time:
isSpacer
isTitle
menu
isColorPicker
checked
font
fontObject
Removes a specific line by index.
-
index
: Number between 1 and Menu:NumLines()
Removes all lines in the menu.
Returns the number of lines in the menu.
Iterates through every line and refreshes it with the latest data.
If used to refresh the checked state of a line, make sure to set the lines' data.checked
to a
function that will return the current state.
Sets the active style for all menus related to this one.
-
name
: Name of registered style (see LibDropDown:RegisterStyle)
Returns the name of the active style for the menu (and child menus).
Replaces the default anchor with a custom one. Exact same parameters as in Widgets:SetPoint, read that documentation instead.
Returns the point data for the registered anchor (see Widgets:GetPoint).
Allows the anchor to be overridden and places the menu on the cursor.
-
state
: Enables/disables cursor anchoring (boolean)
Returns the boolean state of whether the menu should be anchored to the cursor or not.
Sets the alignment of check/radio buttons within the menu.
-
alignment
: Either "LEFT" or "RIGHT" (default) (string)