Import from appdata/CodeLibs/UI/UI_LIST.py
With UI_LIST you can make scrollable listboxes (UI_LISTBOX) with customizable content.
First create an instance of UI_LISTBOX.
Create instances of UI_LIST_ITEM and add one or more UI_ELEMENTs to them. Then add the UI_LIST_ITEMs to the listbox.
Define the content of each UI_LIST_ITEM with one or more UI_ELEMENTs
If the text of an UI_ELEMENT is longer than the width of the UI_LIST_ITEM/UI_LIST it belongs to,
it will scroll sidewards.
The Music Player uses a UI_LIST for reference.
Create an instance of this and update it in your update call.
Add UI_LIST_ITEMS (containing UI_ELEMENTS) to the created listbox.
Called when an instance is created.
Removes all items from the list.
Add a UI_LIST_ITEM to the listbox.
Call this in your update function when you want to show and process the listbox.
An item which can be added to a UI_LISTBOX-instance, with some UI_ELEMENTS to show and a function to be called with a value when the item is clicked on.
The constructor function, called when the UI_LIST_ITEM is created.
It maybe adds one UI_ELEMENT with the given text to it.
UI_ELEMENT will show this text on the list item. Default: "@NotSet@"If text is set, then the UI_ELEMENT will be created on position 500, 500 (centered), else no UI_ELEMENT will be created and they have to be added "manually".
Creates an UI_ELEMENT with the given textorpath on the position promillex, promilley and adds it to this UI_LIST_ITEM-instance.
You do NOT need to use this if you add UI_ELEMENTS with createElement.
Else, add your element to the list item with this function.
An UI_ELEMENT is a graphical element on a UI_LIST_ITEM. It can have a text to be shown with the type "text" or a path to an image to be shown with the type "image".
The constructor function, called when the UI_ELEMENT is created. Don't forget to add it to the right UI_LIST_ITEM.
UI_LIST_ITEM in promille.Set the anchor of the UI_ELEMENT.
0 = centered
1 = left/up
-1 = right/down