WoW LibUIDropDownMenu addon Shadowlands/Burning Crusade Classic 2021
logo
wow addon LibUIDropDownMenu

LibUIDropDownMenu

Game Version: 9.1.0
Total Downloads: 14,330
Updated: Jun 30, 2021
Created: May 24, 2017
download LibUIDropDownMenuDownload Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
v4.06.9010039185 +1 More release 25.11 KB Jun 30, 2021 9.1.0 0 download LibUIDropDownMenu v4.06.9010039185

+1 More releaseDownload
v4.05.9000538556 +1 More release 29.44 KB Jun 14, 2021 9.0.5 337 download LibUIDropDownMenu v4.05.9000538556

+1 More releaseDownload
v4.04.9000538556 +1 More release 29.17 KB Jun 14, 2021 9.0.5 35 download LibUIDropDownMenu v4.04.9000538556

+1 More releaseDownload
v4.03.9000538556 +1 More release 28.90 KB May 18, 2021 9.0.5 463 download LibUIDropDownMenu v4.03.9000538556

+1 More releaseDownload
v4.02.9000538556 +1 More release 28.79 KB May 18, 2021 9.0.5 14 download LibUIDropDownMenu v4.02.9000538556

+1 More releaseDownload
v4.00.9000236639 +1 More release 28.70 KB Nov 22, 2020 9.0.2 775 download LibUIDropDownMenu v4.00.9000236639

+1 More releaseDownload
v3.02.9000136272.01 +1 More release 26.30 KB Oct 20, 2020 9.0.1 543 download LibUIDropDownMenu v3.02.9000136272.01

+1 More releaseDownload
v3.02.9000136272 +1 More release 26.18 KB Oct 18, 2020 9.0.1 273 download LibUIDropDownMenu v3.02.9000136272

+1 More releaseDownload
v3.01.9000135522 +1 More release 26.19 KB Sep 7, 2020 8.3.0 520 download LibUIDropDownMenu v3.01.9000135522

+1 More releaseDownload
v3.00.9000135522 +1 More release 26.17 KB Aug 18, 2020 8.3.0 292 download LibUIDropDownMenu v3.00.9000135522

+1 More releaseDownload
v2.01.8020031429 +1 More release 25.42 KB Sep 2, 2019 8.2.0 936 download LibUIDropDownMenu v2.01.8020031429

+1 More releaseDownload
v2.00.8010028833 +1 More release 25.40 KB Dec 26, 2018 8.1.0 1,138 download LibUIDropDownMenu v2.00.8010028833

+1 More releaseDownload
v1.08.8010028768 +1 More release 23.01 KB Dec 17, 2018 8.1.0 530 download LibUIDropDownMenu v1.08.8010028768

+1 More releaseDownload
v1.08.80001273226 +1 More release 23.16 KB Aug 11, 2018 8.0.1 1,240 download LibUIDropDownMenu v1.08.80001273226

+1 More releaseDownload
v1.08.8000127165 +1 More release 23.05 KB Jul 25, 2018 8.0.1 968 download LibUIDropDownMenu v1.08.8000127165

+1 More releaseDownload
v1.08.8000126433 +1 More release 22.63 KB Apr 24, 2018 7.3.5 580 download LibUIDropDownMenu v1.08.8000126433

+1 More releaseDownload
v1.07.7030525961 +1 More release 19.36 KB Apr 23, 2018 7.3.5 147 download LibUIDropDownMenu v1.07.7030525961

+1 More releaseDownload
v1.07.7030024931 +1 More release 19.27 KB Aug 31, 2017 7.3.0 1,378 download LibUIDropDownMenu v1.07.7030024931

+1 More releaseDownload
v1.06.7030024931 +1 More release 19.29 KB Aug 31, 2017 7.3.0 109 download LibUIDropDownMenu v1.06.7030024931

+1 More releaseDownload
v1.05.7030024920 +1 More release 19.29 KB Aug 29, 2017 7.3.0 92 download LibUIDropDownMenu v1.05.7030024920

+1 More releaseDownload
v1.04.7030024484 +1 More release 19.26 KB Jul 2, 2017 7.2.5 227 download LibUIDropDownMenu v1.04.7030024484

+1 More releaseDownload
v1.03.7030024484 +1 More release 19.21 KB Jun 30, 2017 7.2.5 104 download LibUIDropDownMenu v1.03.7030024484

+1 More releaseDownload
v1.02.7030024484 +1 More release 19.19 KB Jun 30, 2017 7.2.5 70 download LibUIDropDownMenu v1.02.7030024484

+1 More releaseDownload
v1.01.7020024015 +1 More release 19.02 KB May 25, 2017 7.2.0 166 download LibUIDropDownMenu v1.01.7020024015

+1 More releaseDownload
v1.00.7020024015 +1 More release 18.97 KB May 24, 2017 7.2.0 71 download LibUIDropDownMenu v1.00.7020024015

+1 More releaseDownload
r82-alpha +1 More alpha 25.10 KB Jun 30, 2021 9.1.0 0 download LibUIDropDownMenu r82-alpha

+1 More alphaDownload
r81-alpha +1 More alpha 25.10 KB Jun 30, 2021 9.1.0 0 download LibUIDropDownMenu r81-alpha

+1 More alphaDownload
r80-alpha +1 More alpha 25.10 KB Jun 30, 2021 9.1.0 0 download LibUIDropDownMenu r80-alpha

+1 More alphaDownload
r78-alpha +1 More alpha 29.43 KB Jun 14, 2021 9.0.5 6 download LibUIDropDownMenu r78-alpha

+1 More alphaDownload
r76-alpha +1 More alpha 29.16 KB Jun 14, 2021 9.0.5 5 download LibUIDropDownMenu r76-alpha

+1 More alphaDownload
r75-alpha +1 More alpha 28.96 KB May 19, 2021 9.0.5 36 download LibUIDropDownMenu r75-alpha

+1 More alphaDownload
r73-alpha +1 More alpha 28.89 KB May 18, 2021 9.0.5 7 download LibUIDropDownMenu r73-alpha

+1 More alphaDownload
r71-alpha +1 More alpha 28.79 KB May 18, 2021 9.0.5 6 download LibUIDropDownMenu r71-alpha

+1 More alphaDownload
r70-alpha +1 More alpha 28.78 KB May 18, 2021 9.0.2 8 download LibUIDropDownMenu r70-alpha

+1 More alphaDownload
r66-alpha +1 More alpha 28.69 KB Nov 22, 2020 9.0.2 12 download LibUIDropDownMenu r66-alpha

+1 More alphaDownload
r65-alpha +1 More alpha 28.69 KB Nov 18, 2020 9.0.1 41 download LibUIDropDownMenu r65-alpha

+1 More alphaDownload
r64-alpha +1 More alpha 28.60 KB Nov 18, 2020 9.0.1 11 download LibUIDropDownMenu r64-alpha

+1 More alphaDownload
r57-alpha +1 More alpha 26.29 KB Oct 20, 2020 9.0.1 8 download LibUIDropDownMenu r57-alpha

+1 More alphaDownload
r55-alpha +1 More alpha 26.17 KB Oct 18, 2020 9.0.1 8 download LibUIDropDownMenu r55-alpha

+1 More alphaDownload
r53-alpha +1 More alpha 26.18 KB Sep 7, 2020 8.3.0 68 download LibUIDropDownMenu r53-alpha

+1 More alphaDownload
r49-alpha +1 More alpha 26.16 KB Aug 18, 2020 8.3.0 13 download LibUIDropDownMenu r49-alpha

+1 More alphaDownload
r43-alpha +1 More alpha 25.41 KB Sep 2, 2019 8.2.0 48 download LibUIDropDownMenu r43-alpha

+1 More alphaDownload
r41-alpha +1 More alpha 25.39 KB Dec 26, 2018 8.1.0 82 download LibUIDropDownMenu r41-alpha

+1 More alphaDownload
r40-alpha +1 More alpha 25.39 KB Dec 23, 2018 8.1.0 85 download LibUIDropDownMenu r40-alpha

+1 More alphaDownload
r38-alpha +1 More alpha 23.00 KB Dec 17, 2018 8.1.0 68 download LibUIDropDownMenu r38-alpha

+1 More alphaDownload
r36-alpha +1 More alpha 23.15 KB Aug 11, 2018 8.0.1 90 download LibUIDropDownMenu r36-alpha

+1 More alphaDownload
r34-alpha +1 More alpha 23.04 KB Jul 25, 2018 8.0.1 71 download LibUIDropDownMenu r34-alpha

+1 More alphaDownload
r32-alpha +1 More alpha 22.61 KB Apr 24, 2018 7.3.5 71 download LibUIDropDownMenu r32-alpha

+1 More alphaDownload
r31-alpha +1 More alpha 22.62 KB Apr 24, 2018 7.3.5 70 download LibUIDropDownMenu r31-alpha

+1 More alphaDownload
r30-alpha +1 More alpha 22.62 KB Apr 24, 2018 7.3.5 78 download LibUIDropDownMenu r30-alpha

+1 More alphaDownload
r29-alpha +1 More alpha 22.48 KB Apr 23, 2018 7.3.5 77 download LibUIDropDownMenu r29-alpha

+1 More alphaDownload
r27-alpha +1 More alpha 19.35 KB Apr 23, 2018 7.3.5 76 download LibUIDropDownMenu r27-alpha

+1 More alphaDownload
r25-alpha +1 More alpha 19.26 KB Aug 31, 2017 7.3.0 98 download LibUIDropDownMenu r25-alpha

+1 More alphaDownload
r23-alpha +1 More alpha 19.28 KB Aug 31, 2017 7.3.0 84 download LibUIDropDownMenu r23-alpha

+1 More alphaDownload
r21-alpha +1 More alpha 19.28 KB Aug 29, 2017 7.3.0 87 download LibUIDropDownMenu r21-alpha

+1 More alphaDownload
r19-alpha +1 More alpha 19.25 KB Jul 2, 2017 7.2.5 60 download LibUIDropDownMenu r19-alpha

+1 More alphaDownload
r17-alpha +1 More alpha 19.20 KB Jun 30, 2017 7.2.5 38 download LibUIDropDownMenu r17-alpha

+1 More alphaDownload
r15-alpha +1 More alpha 19.18 KB Jun 30, 2017 7.2.5 37 download LibUIDropDownMenu r15-alpha

+1 More alphaDownload
r13-alpha +1 More alpha 19.01 KB May 25, 2017 7.2.0 46 download LibUIDropDownMenu r13-alpha

+1 More alphaDownload
r11-alpha +1 More alpha 18.96 KB May 24, 2017 7.2.0 46 download LibUIDropDownMenu r11-alpha

+1 More alphaDownload
r8-alpha +1 More alpha 18.94 KB May 24, 2017 7.2.0 65 download LibUIDropDownMenu r8-alpha

+1 More alphaDownload
r7-alpha +1 More alpha 18.94 KB May 24, 2017 7.2.0 43 download LibUIDropDownMenu r7-alpha

+1 More alphaDownload

Description

Share this:

About

Standard UIDropDownMenu‘s global functions using protected frames and causing taints when used by third-party addons. But it is possible to avoid taints by using same functionality with that library.

What is it

Library is standard code from Blizzard’s files EasyMenu.lua, UIDropDownMenu.lua, UIDropDownMenu.xml, UIDropDownMenuTemplates.lua and UIDropDownMenuTemplates.xml with frames, tables, variables and functions bounded to the library tables.

Global constants have been added with a prefix “L_“, for example:

  • L_UIDROPDOWNMENU_MINBUTTONS

Addon Dependancy and Configuration

 

  • Embed LibUIDropDownMenu to your addon, you can specify to the subfolder of LibUIDropDownMenu if you feel this keep your addon’s folder structure lighter.
  • Add LibUIDropDownMenu.xml to your toc or your embeds.xml / libs.xml.
  • Make sure your toc file has the following settings:
## Dependencies: LibStub, !LibUIDropDownMenu
  • If your addon doesn’t embed LibStub, you will need it.

How to use it (for addon developer)

Initial Preparation

Assuming your addon is using all the UIDropDownMenu functions from the WoW’s built in function calls, then it is suggested that you have below preparation in your lua codes:

local LibDD = LibStub:GetLibrary(“LibUIDropDownMenu-4.0“)

Function Call Replacement

Depends on which UIDropDownMenu’s function calls you have used in your addon, you will need below similar replacement:

UIDropDownMenu_Initialize => LibDD:UIDropDownMenu_Initialize
UIDropDownMenu_CreateInfo => LibDD:UIDropDownMenu_CreateInfo
UIDropDownMenu_AddButton => LibDD:UIDropDownMenu_AddButton

UIDropDownMenu_AddSeparator => LibDD:UIDropDownMenu_AddSeparator
UIDropDownMenu_AddSpace=> LibDD:UIDropDownMenu_AddSpace

UIDropDownMenu_SetSelectedValue => LibDD:UIDropDownMenu_SetSelectedValue
UIDropDownMenu_SetSelectedName=> LibDD:UIDropDownMenu_SetSelectedName

UIDropDownMenu_SetSelectedID => LibDD:UIDropDownMenu_SetSelectedID
UIDropDownMenu_SetWidth => LibDD:UIDropDownMenu_SetWidth

CloseDropDownMenus => LibDD:CloseDropDownMenus

Creating new UIDropDownMenu

Traditionally you will either create a new frame in your lua codes or with XML by setting the frame to inherit from “UIDropDownMenuTemplate“.

By using this library, you will need to create your menu from like below:

local frame = LibDD:Create_UIDropDownMenu(MyDropDownMenu, parent_frame)

Constants

  • L_UIDROPDOWNMENU_MINBUTTONS
  • L_UIDROPDOWNMENU_MAXBUTTONS
  • L_UIDROPDOWNMENU_MAXLEVELS
  • L_UIDROPDOWNMENU_BUTTON_HEIGHT
  • L_UIDROPDOWNMENU_BORDER_HEIGHT
  • L_UIDROPDOWNMENU_OPEN_MENU
  • L_UIDROPDOWNMENU_INIT_MENU
  • L_UIDROPDOWNMENU_MENU_LEVEL
  • L_UIDROPDOWNMENU_MENU_VALUE
  • L_UIDROPDOWNMENU_SHOW_TIME
  • L_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT
  • L_OPEN_DROPDOWNMENUS
  • L_DropDownList1
  • L_DropDownList2

Button Name

As you (the developers) might be aware that at some point you might need to manipulate the dropdowns by accessing the button names. For example, you have multiple levels of menus and you would like to hide or show some level’s menu button. In that case, you need to make sure you also revise the button name used in your original codes when you are migrating to use LibUIDropDownMenu.

  • L_DropDownList”..i

Example:

	for i = 1, L_UIDROPDOWNMENU_MAXLEVELS, 1 do
		dropDownList = _G["L_DropDownList"..i];
		if ( i >= L_UIDROPDOWNMENU_MENU_LEVEL or frame ~= L_UIDROPDOWNMENU_OPEN_MENU ) then
			dropDownList.numButtons = 0;
			dropDownList.maxWidth = 0;
			for j=1, L_UIDROPDOWNMENU_MAXBUTTONS, 1 do
				button = _G["L_DropDownList"..i.."Button"..j];
				button:Hide();
			end
			dropDownList:Hide();
		end
	end

 

List of button attributes

  • info.text = [STRING] — The text of the button
  • info.value = [ANYTHING] — The value that L_UIDROPDOWNMENU_MENU_VALUE is set to when the button is clicked
  • info.func = [function()] — The function that is called when you click the button
  • info.checked = [nil, true, function] — Check the button if true or function returns true
  • info.isNotRadio = [nil, true] — Check the button uses radial image if false check box image if true
  • info.isTitle = [nil, true] — If it’s a title the button is disabled and the font color is set to yellow
  • info.disabled = [nil, true] — Disable the button and show an invisible button that still traps the mouseover event so menu doesn’t time out
  • info.tooltipWhileDisabled = [nil, 1] — Show the tooltip, even when the button is disabled.
  • info.hasArrow = [nil, true] — Show the expand arrow for multilevel menus
  • info.hasColorSwatch = [nil, true] — Show color swatch or not, for color selection
  • info.r = [1 – 255] — Red color value of the color swatch
  • info.g = [1 – 255] — Green color value of the color swatch
  • info.b = [1 – 255] — Blue color value of the color swatch
  • info.colorCode = [STRING] — “|cAARRGGBB” embedded hex value of the button text color. Only used when button is enabled
  • info.swatchFunc = [function()] — Function called by the color picker on color change
  • info.hasOpacity = [nil, 1] — Show the opacity slider on the colorpicker frame
  • info.opacity = [0.0 – 1.0] — Percentatge of the opacity, 1.0 is fully shown, 0 is transparent
  • info.opacityFunc = [function()] — Function called by the opacity slider when you change its value
  • info.cancelFunc = [function(previousValues)] — Function called by the colorpicker when you click the cancel button (it takes the previous values as its argument)
  • info.notClickable = [nil, 1] — Disable the button and color the font white
  • info.notCheckable = [nil, 1] — Shrink the size of the buttons and don’t display a check box
  • info.owner = [Frame] — Dropdown frame that “owns” the current dropdownlist
  • info.keepShownOnClick = [nil, 1] — Don’t hide the dropdownlist after a button is clicked
  • info.tooltipTitle = [nil, STRING] — Title of the tooltip shown on mouseover
  • info.tooltipText = [nil, STRING] — Text of the tooltip shown on mouseover
  • info.tooltipOnButton = [nil, 1] — Show the tooltip attached to the button instead of as a Newbie tooltip.
  • info.justifyH = [nil, “CENTER”] — Justify button text
  • info.arg1 = [ANYTHING] — This is the first argument used by info.func
  • info.arg2 = [ANYTHING] — This is the second argument used by info.func
  • info.fontObject = [FONT] — font object replacement for Normal and Highlight
  • info.menuTable = [TABLE] — This contains an array of info tables to be displayed as a child menu
  • info.noClickSound = [nil, 1] — Set to 1 to suppress the sound when clicking the button. The sound only plays if .func is set.
  • info.padding = [nil, NUMBER] — Number of pixels to pad the text on the right side
  • info.leftPadding = [nil, NUMBER] — Number of pixels to pad the button on the left side
  • info.minWidth = [nil, NUMBER] — Minimum width for this line
  • info.customFrame = frame — Allows this button to be a completely custom frame, should inherit from UIDropDownCustomMenuEntryTemplate and override appropriate methods.
  • info.icon = [TEXTURE] — An icon for the button.
  • info.mouseOverIcon = [TEXTURE] — An override icon when a button is moused over.
  • info.ignoreAsMenuSelection [nil, true] — Never set the menu text/icon to this, even when this button is checked.

FAQ

Please go to FAQ Pages for more details.

Comments

Add a comment