WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Problem in dropdown menu (https://www.wowinterface.com/forums/showthread.php?t=57827)

gmarco 02-18-20 10:30 PM

Problem in dropdown menu
 
Hi all,

I am looking some help to try to fix a problem in one of my addon:

gmFonts
https://www.wowinterface.com/downloa...4-gmFonts.html

It used a component by phanx to make the font selector:

PhanxConfig-Dropdown.lua
https://github.com/phanx-wow/PhanxCo...g-Dropdown.lua

But with the patch it was not unable to select the items anymore.

I have checked my code and I don't think it is a fault by it so a filled a iussue case to phanx to git but I sadly think she doesn't follow it anymore.

So I am here to ask if someone can help to debug it or is using it and has fixed or has alternative to it.

Thanks.

wardz 02-19-20 01:26 AM

Had this issue earlier aswell, it's because CloseDropDownMenus() is now called every time you click something ingame so it closes the phanx dropdown before you get to actually click on any entries. I've submitted a pull request to PhanxConfig-Dropdown now that should fix it.

Fizzlemizz 02-19-20 01:51 AM

See also: https://us.forums.blizzard.com/en/wo...haviour/416933

gmarco 02-19-20 10:58 AM

Thanks so much for your help.

It works nicely if I put the unregister event in my addon:

Lua Code:
  1. local ADDON = ...
  2.  
  3. local size={}
  4. local prgname = "|cffffd200MyFonts|r"
  5. local string_format = string.format
  6.  
  7. local BUTTON_HEIGHT = 40
  8. local BUTTON_WIDTH = 150
  9.  
  10. local lsmfontsmenu
  11. local gmfontsmenu
  12.  
  13. UIParent:UnregisterEvent("GLOBAL_MOUSE_DOWN")
  14.  
  15. -- saved variables
  16. GMFONTS = GMFONTS or {}
  17.  
  18. blabla blabla


But what I get as side effect of this ?

May I break something else ?

Thanks.

Fizzlemizz 02-19-20 01:02 PM

It seems primarily to effect clearing a dropdown entry if it has autocomplete and you click in it.

Edit: It does some other things that also happen on GLOBAL_MOUSE_UP so unless someone moves the mouse off the field before releasing, it shouldn't be effected.

gmarco 02-19-20 05:08 PM

I have implemented this in the options frame hoping not to break too many things.

When someone find the way to patch the phanx code please let me know and I remove this :)

In the meantime thanks so much to everyone for the help.
It is really appreciated help.

gmarco 02-19-20 05:11 PM

Quote:

Originally Posted by Fizzlemizz (Post 335175)
It seems primarily to effect clearing a dropdown entry if it has autocomplete and you click in it.

Edit: It does some other things that also happen on GLOBAL_MOUSE_UP so unless someone moves the mouse off the field before releasing, it shouldn't be effected.

Hi Fizzlemizz,

Do you think it should be better to:

Lua Code:
  1. UIParent:UnregisterEvent("GLOBAL_MOUSE_UP")

too ?

Thanks ...

Fizzlemizz 02-19-20 05:38 PM

There should not be any need to do that if you aren't seeing any ill effects (GLOBAL_MOUSE_UP also performs some of the tasks done by mouse down like hiding the dropbox so you would loose those if you unregistered it).


All times are GMT -6. The time now is 10:46 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI