Libra

API / Dropdown

Wrapper implementation of the FrameXML UIDropDownMenu API.


Additional available dropdown button properties:

  • attributes - Table which if present will cause the button to gain secure behaviour, applying all the attributes on the table. (out of combat only)
  • tooltipLines - If true will set the tooltipText using several calls to GameTooltip:AddLine(), breaking at \n, instead of using a single string with embedded line breaks.


Dropdown:AddButton(info, level)

Wrapper for UIDropDownMenu_AddButton.
Required if you select menu entries using either of the SetSelected* methods.
If using "MENU" display mode, required to correctly adjust checkable buttons' position. (this is only a minor adjustment and it will actually be fine without it)
Automatically puts the dropdown object on info.owner.


Dropdown:ToggleMenu(value, anchorName, xOffset, yOffset, menuList, level, button, autoHideDelay)

Simple wrapper for ToggleDropDownMenu.
Moves level parameter to after menuList and removes dropdownFrame parameter.
For "Menu" objects, alias method .Toggle is available.


Dropdown:RebuildMenu(level)

Rebuilds the dropdown (if currently showing) at the given level, calling the .initialize function again.

level
The level at which to rebuild the dropdown, or 1 if omitted.


Dropdown:SetDisplayMode(mode)

Sets the display mode used by the dropdown. Taint free equivalent of dropdown.displayMode = mode.

mode
The display mode to be used. "MENU" or any other value.


Dropdown:HideMenu(level)


Dropdown:CloseMenus(level)


Dropdown:SetSelectedName(name)

Taint free wrapper.


Dropdown:SetSelectedValue(value)

Taint free wrapper.


Dropdown:SetSelectedID(id)

Taint free wrapper.


Dropdown:GetSelectedName(name)


Dropdown:GetSelectedValue(value)


Dropdown:GetSelectedID(id)

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

Facts

Date created
Feb 28, 2014
Last updated
Aug 15, 2014

Author