View Single Post
09/20/23, 09:09 AM   #11
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,999
Originally Posted by ZOS_DanBatson View Post
Yea sorry about this. The old drop downs didn't have a way to be both multi-select and scrollable. We needed to fuse the two together, so we needed an overhaul. We did our best to keep as many names and functions that same as we could, and to alias what we could, but it's not a perfect one to one. Depending on your use cases, you may need to modify some things.
As ZO_ComboBox was using ZO_Menu prior to U40, to populate the entries in the combobox, it was supported by LibCustomMenu and it's features like submenus and headerlines.

Now with U40 this is not possible anymore ZO_Menu is not used anymore to show the combobox items but a scrollable list is used to populate the entries.
-> This affects all addons using ZO_ComboBox AND overriding e.g. function comboBox:AddMenuItems to populate the items manually/changed.
For example looping comoBox.m_sortedItems manually to use AddCustomMenuItem or AddCustomSubmenuItem to populate the entries via LibCustomMenu.

If you haven't overwritten the combobox's AddMenuItem, or any other to poulate the items shown at the dropdown, it should be compatible with the new scroll list by default.




I guess the easist way to achieve the old behavor, and support submenus and header lines again, is to recreate the old U39 ZO_ComboBox with a custom name as a library e.g. then,
which still uses ZO_Menu, in order to make it support LibCustomMenu and it's features again.

Another approach could be to use LibCustomMenu's class Submenu to create a new submenu via ZO_Menu, and anchor/show it at the scroll list'e entries as the mouse is moved over the entry (e.g. by using ZO_ComboBox:SetEntryMouseOverCallbacks(onMouseEnterCallback, onMouseExitCallback)).

Edit - Solution: Scrollable combobox with submenus (scrollable, and nested submenus)
The existing library LibScrollableMenu was doing almost everything that was needed already, I just had to change a few API functions to the new U40 stuff and add some more features and a simpler API, like LibCustomMenu's, to enable the scroll helper and submenus (also with scrollable entries -> nice!!!).

You can find the changes here at GitHub:
https://github.com/Baertram/eso-LibScrollableMenu
-> Thanks to kyoma and tomstocks for the base work on that library! It saved a bunch of time.

Usage (onyl works on U40!!! PTS!!!)
Explained at the library addon page -> Comments:
https://www.esoui.com/downloads/file...=3546#comments

Or at the GitHub repo, readme.md:
https://github.com/Baertram/eso-LibS...ster/readme.md

Last edited by Baertram : 09/26/23 at 08:31 AM.
  Reply With Quote