/
Standard UIDropDownMenu 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 and UIDropDownMenuTemplates.xml with frames, tables, variables |
and functions renamed to: |
* constants (typed with all CAPS): "LIB_" added at the start |
* functions: "Lib_" added at the start |
== Constants == |
* LIB_UIDROPDOWNMENU_MINBUTTONS |
* LIB_UIDROPDOWNMENU_MAXBUTTONS |
* LIB_UIDROPDOWNMENU_MAXLEVELS |
* LIB_UIDROPDOWNMENU_BUTTON_HEIGHT |
* LIB_UIDROPDOWNMENU_BORDER_HEIGHT |
* LIB_UIDROPDOWNMENU_OPEN_MENU |
* LIB_UIDROPDOWNMENU_INIT_MENU |
* LIB_UIDROPDOWNMENU_MENU_LEVEL |
* LIB_UIDROPDOWNMENU_MENU_VALUE |
* LIB_UIDROPDOWNMENU_SHOW_TIME |
* LIB_UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT |
* LIB_OPEN_DROPDOWNMENUS |
== Functions == |
* Lib_EasyMenu |
* Lib_EasyMenu_Initialize |
* Lib_UIDropDownMenuDelegate_OnAttributeChanged |
* Lib_UIDropDownMenu_InitializeHelper |
* Lib_UIDropDownMenu_Initialize |
* Lib_UIDropDownMenu_SetInitializeFunction |
* Lib_UIDropDownMenu_RefreshDropDownSize |
* Lib_UIDropDownMenu_OnUpdate |
* Lib_UIDropDownMenu_StartCounting |
* Lib_UIDropDownMenu_StopCounting |
* Lib_UIDropDownMenu_CreateInfo |
* Lib_UIDropDownMenu_CreateFrames |
* Lib_UIDropDownMenu_AddSeparator |
* Lib_UIDropDownMenu_AddButton |
* Lib_UIDropDownMenu_AddSeparator |
* Lib_UIDropDownMenu_GetMaxButtonWidth |
* Lib_UIDropDownMenu_GetButtonWidth |
* Lib_UIDropDownMenu_Refresh |
* Lib_UIDropDownMenu_RefreshAll |
* Lib_UIDropDownMenu_SetIconImage |
* Lib_UIDropDownMenu_SetSelectedName |
* Lib_UIDropDownMenu_SetSelectedValue |
* Lib_UIDropDownMenu_SetSelectedID |
* Lib_UIDropDownMenu_GetSelectedName |
* Lib_UIDropDownMenu_GetSelectedID |
* Lib_UIDropDownMenu_GetSelectedValue |
* Lib_UIDropDownMenuButton_OnClick |
* Lib_HideDropDownMenu |
* Lib_ToggleDropDownMenu |
* Lib_CloseDropDownMenus |
* Lib_UIDropDownMenu_OnHide |
* Lib_UIDropDownMenu_SetWidth |
* Lib_UIDropDownMenu_SetButtonWidth |
* Lib_UIDropDownMenu_SetText |
* Lib_UIDropDownMenu_GetText |
* Lib_UIDropDownMenu_ClearAll |
* Lib_UIDropDownMenu_JustifyText |
* Lib_UIDropDownMenu_SetAnchor |
* Lib_UIDropDownMenu_GetCurrentDropDown |
* Lib_UIDropDownMenuButton_GetChecked |
* Lib_UIDropDownMenuButton_GetName |
* Lib_UIDropDownMenuButton_OpenColorPicker |
* Lib_UIDropDownMenu_DisableButton |
* Lib_UIDropDownMenu_EnableButton |
* Lib_UIDropDownMenu_SetButtonText |
* Lib_UIDropDownMenu_SetButtonNotClickable |
* Lib_UIDropDownMenu_SetButtonClickable |
* Lib_UIDropDownMenu_DisableDropDown |
* Lib_UIDropDownMenu_EnableDropDown |
* Lib_UIDropDownMenu_IsEnabled |
* Lib_UIDropDownMenu_GetValue |
== How to use it == |
* Add UIDropDownMenu.xml to your toc. |
* Like ordinal code for UIDropDownMenu with "Lib_" instead. |
$Id$ |
Revision History: |
================= |
v7.2.0.24801 (2017/05/12) |
------------------------- |
- added UIDropDownMenu.xml; |
- removed customized codes in creating buttons; |
- removed customized codes in Lib_UIDropDownMenu_AddButton() |
- added LibStub to set library's version |
v7.2.0.23801-r3 (2017/04/27) |
---------------------------- |
- fixed the loading order in ToC if this get installed separately. |
v7.2.0.23801-r2 (2017/04/17) |
---------------------------- |
- ToC update to support proper loading if user install this library separately; this is for WoW 7.2 release. |
v7.2.0.23801 (2017/03/22) |
-------------------------- |
- fixed the issue when dropdown menu has more than 1 level |
v7.2.0.23789 (2017/03/22) |
-------------------------- |
- lib update to sync with WoW 7.2.0.23789 |
- TOC update to support WoW 7.2.0 |
v7.1.0.22908.r7 (2016/12/26) |
-------------------------- |
- fixes with listframe width |
v7.1.0.22908.r6 (2016/12/26) |
-------------------------- |
- some minor enhancement in logical operation: |
Lib_UIDropDownMenu_AddButton - index's value; width and maxWidth's values |
v7.1.0.22908 (2016/10/27) |
-------------------------- |
- Toc update to support WoW 7.1.0 |
- Codes synch with 7.1.0.22908: |
- Added function Lib_UIDropDownMenu_AddSeparator(info, level) |
v1.2 |
---- |
Updated (thanks to Blazeflack). To use Lib_UIDropDownMenu_AddSeparator left text value empty like |
Code: |
local tabsSubmenu = { |
{ text = "Add new tab", func = AddNewTab, notCheckable = true, keepShownOnClick = false }, |
{ notCheckable = true, notClickable = true }, |
{ text = "Remove active tab", func = ConfirmRemoveTab, notCheckable = true, keepShownOnClick = false }, |
} |
1.1 |
--- |
Fixed first two menu's strata. |
..\FrameXML\UI.xsd"> |
<Script file="UIDropDownMenu.lua"/> |
<Include file="UIDropDownMenuTemplates.xml"/> |
<Script file="EasyMenu.lua"/> |
<Button name="Lib_DropDownList1" toplevel="true" frameStrata="FULLSCREEN_DIALOG" inherits="Lib_UIDropDownListTemplate" hidden="true" id="1"> |
<Size> |
<AbsDimension x="180" y="10"/> |
## X-Category: Libraries |
# ## Check out the following page for more details: |
# ## http://www.wowinterface.com/downloads/info22630-NoTaintUIDropDownMenu.html |
## X-Website: http://www.wowinterface.com/downloads/info22630-NoTaintUIDropDownMenu.html |
LibStub\LibStub.lua |
UIDropDownMenu.xml |
EasyMenu.lua |
-- $Id$ |
-- ---------------------------------------------------------------------------- |
-- Localized Lua globals. |
-- ---------------------------------------------------------------------------- |
local _G = getfenv(0) |
local strsub, strlen, strmatch, gsub = strsub, strlen, strmatch, gsub |
local max, match = max, match |
local securecall, issecure = securecall, issecure |
local tonumber = tonumber |
local type = type |
local wipe = table.wipe |
local CreateFrame, GetCursorPosition, GetCVar, GetScreenHeight, GetScreenWidth, OpenColorPicker, PlaySound = CreateFrame, GetCursorPosition, GetCVar, GetScreenHeight, GetScreenWidth, OpenColorPicker, PlaySound |
-- ---------------------------------------------------------------------------- |
local MAJOR_VERSION = "NoTaint_UIDropDownMenu-7.2.0" |
local MINOR_VERSION = 90000 + tonumber(("$Rev$"):match("%d+")) |
local LibStub = _G.LibStub |
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end |
local Lib = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) |
if not Lib then return end |
-- ////////////////////////////////////////////////////////////// |
LIB_UIDROPDOWNMENU_MINBUTTONS = 8; |
LIB_UIDROPDOWNMENU_MAXBUTTONS = 8; |
LIB_UIDROPDOWNMENU_MAXLEVELS = 2; |