Thread Tools Display Modes
09/20/23, 08:46 AM   #1
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 182
Originally Posted by code65536 View Post
I see there's been a major overhaul of ZO_ComboBox.

ZO_ScrollableComboBox is now gone and has been merged into ZO_ComboBox.
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.
  Reply With Quote
09/20/23, 09:09 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,033
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

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Update 40 (Version 9.2)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off