Quantcast
Download
(19 Kb)
Download
Updated: 08-31-17 08:32 AM
Compatibility:
Shadows of Argus (7.3.0)
Updated:08-31-17 08:32 AM
Created:05-24-17 12:08 PM
Downloads:321
Favorites:6
MD5:
7.3.0

LibUIDropDownMenu

Version: v1.07.7030024931
by: arith [More]

About

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 : "L_" added at the start
  • functions: "L_" added at the start

How to use it (for addon developer)
  • Embed LibUIDropDownMenu to your addon, you can specify to the subfolder of LibUIDropDownMenu if you feel this keep the 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:
    Code:
    ## OptionalDeps: LibStub, LibUIDropDownMenu
  • If your addon doesn't embed LibStub, you will need it.
  • Like ordinal code for UIDropDownMenu with "L_" instead.

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


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

Functions
EasyMenu
  • L_EasyMenu
  • L_EasyMenu_Initialize

UIDropDown
  • L_UIDropDownMenuDelegate_OnAttributeChanged
  • L_UIDropDownMenu_InitializeHelper
  • L_UIDropDownMenu_Initialize
  • L_UIDropDownMenu_SetInitializeFunction
  • L_UIDropDownMenu_RefreshDropDownSize
  • L_UIDropDownMenu_OnUpdate
  • L_UIDropDownMenu_StartCounting
  • L_UIDropDownMenu_StopCounting
  • L_UIDropDownMenu_CreateInfo
  • L_UIDropDownMenu_CreateFrames
  • L_UIDropDownMenu_AddSeparator
  • L_UIDropDownMenu_AddButton
  • L_UIDropDownMenu_AddSeparator
  • L_UIDropDownMenu_GetMaxButtonWidth
  • L_UIDropDownMenu_GetButtonWidth
  • L_UIDropDownMenu_Refresh
  • L_UIDropDownMenu_RefreshAll
  • L_UIDropDownMenu_SetIconImage
  • L_UIDropDownMenu_SetSelectedName
  • L_UIDropDownMenu_SetSelectedValue
  • L_UIDropDownMenu_SetSelectedID
  • L_UIDropDownMenu_GetSelectedName
  • L_UIDropDownMenu_GetSelectedID
  • L_UIDropDownMenu_GetSelectedValue
  • L_UIDropDownMenuButton_OnClick
  • L_HideDropDownMenu
  • L_ToggleDropDownMenu
  • L_CloseDropDownMenus
  • L_UIDropDownMenu_OnHide
  • L_UIDropDownMenu_SetWidth
  • L_UIDropDownMenu_SetButtonWidth
  • L_UIDropDownMenu_SetText
  • L_UIDropDownMenu_GetText
  • L_UIDropDownMenu_ClearAll
  • L_UIDropDownMenu_JustifyText
  • L_UIDropDownMenu_SetAnchor
  • L_UIDropDownMenu_GetCurrentDropDown
  • L_UIDropDownMenuButton_GetChecked
  • L_UIDropDownMenuButton_GetName
  • L_UIDropDownMenuButton_OpenColorPicker
  • L_UIDropDownMenu_DisableButton
  • L_UIDropDownMenu_EnableButton
  • L_UIDropDownMenu_SetButtonText
  • L_UIDropDownMenu_SetButtonNotClickable
  • L_UIDropDownMenu_SetButtonClickable
  • L_UIDropDownMenu_DisableDropDown
  • L_UIDropDownMenu_EnableDropDown
  • L_UIDropDownMenu_IsEnabled
  • L_UIDropDownMenu_GetValue

FAQ

Please go to FAQ Pages for more details.

Revision History:
=================

v1.07.7030024931 (2017/08/31)
-----------------------------
- Remove PlaySound compact code.

v1.06.7030024931 (2017/08/31)
-----------------------------
- Remove PlaySound compact code.

v1.05.7030024920 (2017/08/29)
-----------------------------
- ToC update to support WoW 7.3.0

v1.04.7030024484 (2017/07/02)
-----------------------------
- Changed soundkit's ID to key indicator likes SOUNDKIT.U_CHAT_SCROLL_BUTTON

v1.03.7030024484 (2017/06/30)
-----------------------------
- Update version number

v1.02.7030024484 (2017/06/30)
-----------------------------
- Updated PlaySound API's usage method to support both 7.2.5 and 7.3.0 of WoW clients

v1.01.7020024015 (2017/05/25)
----------------------------
- Fixed the wrong name of LibEasyMenu.lua specified in LibUIDropDownMenu.xml

v1.00.7020024015 (2017/05/24)
----------------------------
- Clone from NoTaint_UIDropDownMenu v7.2.0.24015-r2
- Changed LIB_ and Lib_ to L_ to prevent from conflict with outdated
NoTaint_UIDropDownMenu being loaded from other addons
Optional Files (0)


Archived Files (5)
File Name
Version
Size
Author
Date
v1.05.703002492
19kB
arith
08-29-17 08:39 AM
v1.04.703002448
19kB
arith
07-02-17 08:35 AM
v1.03.703002448
19kB
arith
06-30-17 01:44 AM
v1.01.702002401
19kB
arith
05-24-17 10:29 PM
v1.00.702002401
19kB
arith
05-24-17 12:08 PM


Post A Reply Comment Options
Unread 07-28-17, 11:56 PM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Originally Posted by coani
Thanks for the quick look, Poss works for me now, and this made me realize I forgot to check for those Show/Hide/Toggle calls in another addon I had tried to change, didn't realize I broke a button in the ui on it which I never used myself
Guess I'll take a better look now at other addons that use Bliz's UIDropDownMenu and have caused problems, especially in combat, and see if I can get them to behave better.

Thanks for your help & work!

Good to know it works, and good luck.
Report comment to moderator  
Reply With Quote
Unread 07-28-17, 04:47 AM  
coani
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 39
Uploads: 3
Thanks for the quick look, Poss works for me now, and this made me realize I forgot to check for those Show/Hide/Toggle calls in another addon I had tried to change, didn't realize I broke a button in the ui on it which I never used myself
Guess I'll take a better look now at other addons that use Bliz's UIDropDownMenu and have caused problems, especially in combat, and see if I can get them to behave better.

Thanks for your help & work!


Originally Posted by arith
Originally Posted by arith
Originally Posted by coani
I have a problem. With my extremely limited knowledge in mucking about with lua, I had converted a few addons that used uidropdownmenu to using the older lib_uidropdownmenu, and those worked fine.
With the L_ lib version here, I updated them (locally) to make use of it, which worked fine *except* for one: Possessions ( http://www.wowinterface.com/download...atefor7.2.html ). I had posted some time ago my lib_ version under other files there (so you can look if you want), but when I tried to update Poss to use the L_ lib version instead, I got this lua error, and I'm stumped how to fix it:

...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: attempt to index local 'filterText' (a nil value)
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: in function `L_UIDropDownMenu_SetText'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:685: in function `L_UIDropDownMenu_Refresh'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:746: in function `L_UIDropDownMenu_SetSelectedID'
Possessions\Possessions-r14.lua:761: in function `Possessions_ClearDropDowns'
Possessions\Possessions-r14.lua:610: in function `Possessions_Show'
Possessions\Possessions-r14.lua:620: in function `Possessions_Toggle'
Possessions\Possessions-r14.lua:627: in function `Possessions_SlashCommandHandler'
Possessions\Possessions-r14.lua:1349: in function `?'
FrameXML\ChatFrame.lua:4486: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4154: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:4190: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>

I had also tried to do same update to the newer r14 version of Poss, getting same error there.
I did a quick fix and it looks to be working fine. You can find the revised files here.

Let me know if any problem.
One note on my changes:
  • DropDownList1: This need to be changed to L_DropDownList1. I will update the document to reflect it.
Report comment to moderator  
Reply With Quote
Unread 07-27-17, 09:08 PM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Originally Posted by arith
Originally Posted by coani
I have a problem. With my extremely limited knowledge in mucking about with lua, I had converted a few addons that used uidropdownmenu to using the older lib_uidropdownmenu, and those worked fine.
With the L_ lib version here, I updated them (locally) to make use of it, which worked fine *except* for one: Possessions ( http://www.wowinterface.com/download...atefor7.2.html ). I had posted some time ago my lib_ version under other files there (so you can look if you want), but when I tried to update Poss to use the L_ lib version instead, I got this lua error, and I'm stumped how to fix it:

...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: attempt to index local 'filterText' (a nil value)
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: in function `L_UIDropDownMenu_SetText'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:685: in function `L_UIDropDownMenu_Refresh'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:746: in function `L_UIDropDownMenu_SetSelectedID'
Possessions\Possessions-r14.lua:761: in function `Possessions_ClearDropDowns'
Possessions\Possessions-r14.lua:610: in function `Possessions_Show'
Possessions\Possessions-r14.lua:620: in function `Possessions_Toggle'
Possessions\Possessions-r14.lua:627: in function `Possessions_SlashCommandHandler'
Possessions\Possessions-r14.lua:1349: in function `?'
FrameXML\ChatFrame.lua:4486: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4154: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:4190: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>

I had also tried to do same update to the newer r14 version of Poss, getting same error there.
I did a quick fix and it looks to be working fine. You can find the revised files here.

Let me know if any problem.
One note on my changes:
  • DropDownList1: This need to be changed to L_DropDownList1. I will update the document to reflect it.
Report comment to moderator  
Reply With Quote
Unread 07-27-17, 10:11 AM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Originally Posted by coani
I have a problem. With my extremely limited knowledge in mucking about with lua, I had converted a few addons that used uidropdownmenu to using the older lib_uidropdownmenu, and those worked fine.
With the L_ lib version here, I updated them (locally) to make use of it, which worked fine *except* for one: Possessions ( http://www.wowinterface.com/download...atefor7.2.html ). I had posted some time ago my lib_ version under other files there (so you can look if you want), but when I tried to update Poss to use the L_ lib version instead, I got this lua error, and I'm stumped how to fix it:

...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: attempt to index local 'filterText' (a nil value)
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: in function `L_UIDropDownMenu_SetText'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:685: in function `L_UIDropDownMenu_Refresh'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:746: in function `L_UIDropDownMenu_SetSelectedID'
Possessions\Possessions-r14.lua:761: in function `Possessions_ClearDropDowns'
Possessions\Possessions-r14.lua:610: in function `Possessions_Show'
Possessions\Possessions-r14.lua:620: in function `Possessions_Toggle'
Possessions\Possessions-r14.lua:627: in function `Possessions_SlashCommandHandler'
Possessions\Possessions-r14.lua:1349: in function `?'
FrameXML\ChatFrame.lua:4486: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4154: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:4190: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>

I had also tried to do same update to the newer r14 version of Poss, getting same error there.
I did a quick fix and it looks to be working fine. You can find the revised files here.

Let me know if any problem.
Last edited by arith : 07-27-17 at 08:54 PM.
Report comment to moderator  
Reply With Quote
Unread 07-27-17, 09:43 AM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Originally Posted by coani
I have a problem. With my extremely limited knowledge in mucking about with lua, I had converted a few addons that used uidropdownmenu to using the older lib_uidropdownmenu, and those worked fine.
With the L_ lib version here, I updated them (locally) to make use of it, which worked fine *except* for one: Possessions ( http://www.wowinterface.com/download...atefor7.2.html ). I had posted some time ago my lib_ version under other files there (so you can look if you want), but when I tried to update Poss to use the L_ lib version instead, I got this lua error, and I'm stumped how to fix it:

...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: attempt to index local 'filterText' (a nil value)
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: in function `L_UIDropDownMenu_SetText'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:685: in function `L_UIDropDownMenu_Refresh'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:746: in function `L_UIDropDownMenu_SetSelectedID'
Possessions\Possessions-r14.lua:761: in function `Possessions_ClearDropDowns'
Possessions\Possessions-r14.lua:610: in function `Possessions_Show'
Possessions\Possessions-r14.lua:620: in function `Possessions_Toggle'
Possessions\Possessions-r14.lua:627: in function `Possessions_SlashCommandHandler'
Possessions\Possessions-r14.lua:1349: in function `?'
FrameXML\ChatFrame.lua:4486: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4154: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:4190: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>


I had also tried to do same update to the newer r14 version of Poss, getting same error there.
Just downloaded the r14, it's now using the WoW's built-in UIDropDownMenu functions.
Report comment to moderator  
Reply With Quote
Unread 07-27-17, 05:23 AM  
coani
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 1
File comments: 39
Uploads: 3
I have a problem. With my extremely limited knowledge in mucking about with lua, I had converted a few addons that used uidropdownmenu to using the older lib_uidropdownmenu, and those worked fine.
With the L_ lib version here, I updated them (locally) to make use of it, which worked fine *except* for one: Possessions ( http://www.wowinterface.com/download...atefor7.2.html ). I had posted some time ago my lib_ version under other files there (so you can look if you want), but when I tried to update Poss to use the L_ lib version instead, I got this lua error, and I'm stumped how to fix it:

...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: attempt to index local 'filterText' (a nil value)
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:1102: in function `L_UIDropDownMenu_SetText'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:685: in function `L_UIDropDownMenu_Refresh'
...DropDownMenu\LibUIDropDownMenu\LibUIDropDownMenu.lua:746: in function `L_UIDropDownMenu_SetSelectedID'
Possessions\Possessions-r14.lua:761: in function `Possessions_ClearDropDowns'
Possessions\Possessions-r14.lua:610: in function `Possessions_Show'
Possessions\Possessions-r14.lua:620: in function `Possessions_Toggle'
Possessions\Possessions-r14.lua:627: in function `Possessions_SlashCommandHandler'
Possessions\Possessions-r14.lua:1349: in function `?'
FrameXML\ChatFrame.lua:4486: in function `ChatEdit_ParseText'
FrameXML\ChatFrame.lua:4154: in function `ChatEdit_SendText'
FrameXML\ChatFrame.lua:4190: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>


I had also tried to do same update to the newer r14 version of Poss, getting same error there.
Report comment to moderator  
Reply With Quote
Unread 06-01-17, 12:56 AM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Re: Titan Panel Inclusion

Originally Posted by HonorGoG
Titan Panel will be using this library moving forward. I'm getting hammered by complaints about incompatible library references within NoTaint and there is little I can do except something radical like this. I just need to make it easy for the plugin authors that will need to migrate so I will be including your readme file over on the titanpanel.org portal.
That's what I have been experiencing, and that's why I finally decided to create a new lib with new prefix, hoping this makes things easily.

Let me know if anything I can help.
Report comment to moderator  
Reply With Quote
Unread 05-31-17, 10:21 PM  
HonorGoG
An Aku'mai Servant
 
HonorGoG's Avatar
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 77
Uploads: 3
Titan Panel Inclusion

Titan Panel will be using this library moving forward. I'm getting hammered by complaints about incompatible library references within NoTaint and there is little I can do except something radical like this. I just need to make it easy for the plugin authors that will need to migrate so I will be including your readme file over on the titanpanel.org portal.
Report comment to moderator  
Reply With Quote
Unread 05-24-17, 10:27 PM  
arith
A Fallenroot Satyr
 
arith's Avatar
AddOn Author - Click to view AddOns

Forum posts: 29
File comments: 65
Uploads: 25
Originally Posted by yj368413
Is there a mistake in LibUIDropDownMenu.xml line 6 ?

<Script file="LibEasyMenu"/> → <Script file="LibEasyMenu.lua"/>
Oops, you are right. I will fix it right away.
Report comment to moderator  
Reply With Quote
Unread 05-24-17, 09:29 PM  
yj368413
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 28
Uploads: 6
Is there a mistake in LibUIDropDownMenu.xml line 6 ?

<Script file="LibEasyMenu"/> → <Script file="LibEasyMenu.lua"/>
__________________
www.maorui.org
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.