<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to UI_LIST</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>Recent changes to UI_LIST</description><atom:link href="https://sourceforge.net/p/pirobot/wiki/UI_LIST/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 15 Jan 2025 01:48:00 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/pirobot/wiki/UI_LIST/feed" rel="self" type="application/rss+xml"/><item><title>UI_LIST modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -36,7 +36,7 @@
 ##UI_LIST_ITEM
 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.

-###__init__(self, func, value, text)
+### _ _ init _ _ (self, func, value, text)
 The constructor function, called when the `UI_LIST_ITEM` is created. 
 It maybe adds one `UI_ELEMENT` with the given text to it.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Wed, 15 Jan 2025 01:48:00 -0000</pubDate><guid>https://sourceforge.net4545ffb90dba94822d4e007842f3181bd866f23a</guid></item><item><title>UI_LIST modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -16,21 +16,13 @@
 Create an instance of this and update it in your update call.
 Add `UI_LIST_ITEMS` (containing `UI_ELEMENTS`) to the created listbox.

-###__init__(self, promilleposx, promilleposy, promillewidth, promilleheight, orientation, pixelsitemheight, fgcol,bgcol)
+### _ _ init _ _ (self, promilleposx, promilleposy, promillewidth, promilleheight, orientation, pixelsitemheight, fgcol,bgcol)
 Called when an instance is created.
-####promilleposx, promilleposy
-The position of the listbox on the screen in promille.
-####promillewidth, promilleheight
-The size of the listbox on the screen in promille.
-####orientation
-The orientation on the screen. (0-3)
-Default: -1 - take the default orientation.
-####pixelsitemheight
-The default height of a list item in pixels.
-Default: 100
-####fgcol, bgcol
-The foreground and background color of this listbox.
-Default: UITools.fgcol, UITools.bgcol
+- promilleposx, promilleposy: The position of the listbox on the screen in promille.
+- promillewidth, promilleheight: The size of the listbox on the screen in promille.
+- orientation: The orientation on the screen. (0-3) Default: -1 - take the default orientation.
+- pixelsitemheight: The default height of a list item in pixels. Default: 100
+- fgcol, bgcol: The foreground and background color of this listbox. Default: UITools.fgcol, UITools.bgcol

 ###clearItems(self)
 Removes all items from the list.
@@ -48,26 +40,17 @@
 The constructor function, called when the `UI_LIST_ITEM` is created. 
 It maybe adds one `UI_ELEMENT` with the given text to it.

-####func
-The function to call when clicked on.
-Default: 0
-####value
-Maybe the function needs a value. This is it.
-Default: 0
-####text
-The added `UI_ELEMENT` will show this text on the list item.
-Default: "@NotSet@"
+- func: The function to call when clicked on. Default: 0
+- value: Maybe the function needs a value. This is it. Default: 0
+- text: The added `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".

 ###createElement(self, textorpath, promillex, promilley, typ)
 Creates an `UI_ELEMENT` with the given `textorpath` on the position `promillex, promilley` and adds it to this `UI_LIST_ITEM`-instance.
-####textorpath
-The text to be shown or the path to the image if typ is "image".
-####promillex, promilley
-The position on the list item in promille.
-####typ
-"text" for text.
-"image" for image. NOT IMPLEMENTED YET.
+- textorpath: The text to be shown or the path to the image if typ is "image".
+- promillex, promilley: The position on the list item in promille.
+- typ: "text" for text, "image" for image. NOT IMPLEMENTED YET.

 ###addElement(self, element: UI_ELEMENT)
 You do NOT need to use this if you add `UI_ELEMENTS` with `createElement`.
@@ -76,19 +59,12 @@
 ##UI_ELEMENT
 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".

-###__init__(self, textorpath, promilleposx, promilleposy, typ)
+### _ _ init _ _ (self, textorpath, promilleposx, promilleposy, typ)
 The constructor function, called when the `UI_ELEMENT` is created. Don't forget to add it to the right `UI_LIST_ITEM`.

-####textorpath
-The text to be shown or the path to the image to be shown.
-
-####promillex, promilley
-The position on the `UI_LIST_ITEM` in promille.
-
-####typ
-The type of the UI_ELEMENT.
-Can be "text" or "image" (not implemented yet).
-Default: "text"
+- textorpath: The text to be shown or the path to the image to be shown.
+- promillex, promilley: The position on the `UI_LIST_ITEM` in promille.
+- typ: The type of the UI_ELEMENT. Can be "text" or "image" (not implemented yet). Default: "text"

 ###setAnchor(self, anchorx, anchory)
 Set the anchor of the `UI_ELEMENT`.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Wed, 15 Jan 2025 01:47:35 -0000</pubDate><guid>https://sourceforge.netd5b89246a7e11e062fad9c8105491c09b839ca97</guid></item><item><title>UI_LIST modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -5,7 +5,7 @@
 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 them to the 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_ELEMENT`s
 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.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Mon, 06 Jan 2025 04:54:30 -0000</pubDate><guid>https://sourceforge.net83a78a7337c794d1569ad36454f36dfb53883452</guid></item><item><title>UI_LIST modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -45,7 +45,9 @@
 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.

 ###__init__(self, func, value, text)
-Inits the UI_LIST_ITEM and adds one UI_ELEMENT with the given text to it.
+The constructor function, called when the `UI_LIST_ITEM` is created. 
+It maybe adds one `UI_ELEMENT` with the given text to it.
+
 ####func
 The function to call when clicked on.
 Default: 0
@@ -55,9 +57,10 @@
 ####text
 The added `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".

 ###createElement(self, textorpath, promillex, promilley, typ)
-Creates an `UI_ELEMENT` with the given `textorpath` on the position `promillex, promilley` on this `UI_LIST_ITEM`-instance.
+Creates an `UI_ELEMENT` with the given `textorpath` on the position `promillex, promilley` and adds it to this `UI_LIST_ITEM`-instance.
 ####textorpath
 The text to be shown or the path to the image if typ is "image".
 ####promillex, promilley
@@ -70,3 +73,25 @@
 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.

+##UI_ELEMENT
+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".
+
+###__init__(self, textorpath, promilleposx, promilleposy, typ)
+The constructor function, called when the `UI_ELEMENT` is created. Don't forget to add it to the right `UI_LIST_ITEM`.
+
+####textorpath
+The text to be shown or the path to the image to be shown.
+
+####promillex, promilley
+The position on the `UI_LIST_ITEM` in promille.
+
+####typ
+The type of the UI_ELEMENT.
+Can be "text" or "image" (not implemented yet).
+Default: "text"
+
+###setAnchor(self, anchorx, anchory)
+Set the anchor of the `UI_ELEMENT`.
+0 = centered
+1 = left/up
+-1 = right/down
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Mon, 06 Jan 2025 03:36:36 -0000</pubDate><guid>https://sourceforge.net2a43a39519a551c6ff5ed142883726c9e346a325</guid></item><item><title>UI_LIST modified by Benedict Jäggi</title><link>https://sourceforge.net/p/pirobot/wiki/UI_LIST/</link><description>&lt;div class="markdown_content"&gt;&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#ui_list"&gt;UI_LIST&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#ui_listbox"&gt;UI_LISTBOX&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#initself-promilleposx-promilleposy-promillewidth-promilleheight-orientation-pixelsitemheight-fgcolbgcol"&gt;init(self, promilleposx, promilleposy, promillewidth, promilleheight, orientation, pixelsitemheight, fgcol,bgcol)&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#promilleposx-promilleposy"&gt;promilleposx, promilleposy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#promillewidth-promilleheight"&gt;promillewidth, promilleheight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#orientation"&gt;orientation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#pixelsitemheight"&gt;pixelsitemheight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#fgcol-bgcol"&gt;fgcol, bgcol&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#clearitemsself"&gt;clearItems(self)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#additemself-item-ui_list_item"&gt;addItem(self, item: UI_LIST_ITEM)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#updateself-screen-deltatime"&gt;update(self, screen, deltatime)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#ui_list_item"&gt;UI_LIST_ITEM&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#initself-func-value-text"&gt;init(self, func, value, text)&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#func"&gt;func&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#value"&gt;value&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#text"&gt;text&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#createelementself-textorpath-promillex-promilley-typ"&gt;createElement(self, textorpath, promillex, promilley, typ)&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#textorpath"&gt;textorpath&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#promillex-promilley"&gt;promillex, promilley&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#typ"&gt;typ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#addelementself-element-ui_element"&gt;addElement(self, element: UI_ELEMENT)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h1 id="ui_list"&gt;UI_LIST&lt;/h1&gt;
&lt;p&gt;Import from &lt;code&gt;appdata/CodeLibs/UI/UI_LIST.py&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;UI_LIST&lt;/code&gt; you can make scrollable listboxes (&lt;code&gt;UI_LISTBOX&lt;/code&gt;) with customizable content.&lt;/p&gt;
&lt;p&gt;First create an instance of &lt;code&gt;UI_LISTBOX&lt;/code&gt;.&lt;br/&gt;
Create instances of &lt;code&gt;UI_LIST_ITEM&lt;/code&gt; and add them to the listbox. &lt;br/&gt;
Define the content of each &lt;code&gt;UI_LIST_ITEM&lt;/code&gt; with one or more &lt;code&gt;UI_ELEMENT&lt;/code&gt;s&lt;br/&gt;
If the text of an &lt;code&gt;UI_ELEMENT&lt;/code&gt; is longer than the width of the &lt;code&gt;UI_LIST_ITEM/UI_LIST&lt;/code&gt; it belongs to,&lt;br/&gt;
it will scroll sidewards.&lt;/p&gt;
&lt;p&gt;The Music Player uses a &lt;code&gt;UI_LIST&lt;/code&gt; for reference.&lt;/p&gt;
&lt;h2 id="ui_listbox"&gt;UI_LISTBOX&lt;/h2&gt;
&lt;p&gt;Create an instance of this and update it in your update call.&lt;br/&gt;
Add &lt;code&gt;UI_LIST_ITEMS&lt;/code&gt; (containing &lt;code&gt;UI_ELEMENTS&lt;/code&gt;) to the created listbox.&lt;/p&gt;
&lt;h3 id="initself-promilleposx-promilleposy-promillewidth-promilleheight-orientation-pixelsitemheight-fgcolbgcol"&gt;&lt;strong&gt;init&lt;/strong&gt;(self, promilleposx, promilleposy, promillewidth, promilleheight, orientation, pixelsitemheight, fgcol,bgcol)&lt;/h3&gt;
&lt;p&gt;Called when an instance is created.&lt;/p&gt;
&lt;h4 id="promilleposx-promilleposy"&gt;promilleposx, promilleposy&lt;/h4&gt;
&lt;p&gt;The position of the listbox on the screen in promille.&lt;/p&gt;
&lt;h4 id="promillewidth-promilleheight"&gt;promillewidth, promilleheight&lt;/h4&gt;
&lt;p&gt;The size of the listbox on the screen in promille.&lt;/p&gt;
&lt;h4 id="orientation"&gt;orientation&lt;/h4&gt;
&lt;p&gt;The orientation on the screen. (0-3)&lt;br/&gt;
Default: -1 - take the default orientation.&lt;/p&gt;
&lt;h4 id="pixelsitemheight"&gt;pixelsitemheight&lt;/h4&gt;
&lt;p&gt;The default height of a list item in pixels.&lt;br/&gt;
Default: 100&lt;/p&gt;
&lt;h4 id="fgcol-bgcol"&gt;fgcol, bgcol&lt;/h4&gt;
&lt;p&gt;The foreground and background color of this listbox.&lt;br/&gt;
Default: UITools.fgcol, UITools.bgcol&lt;/p&gt;
&lt;h3 id="clearitemsself"&gt;clearItems(self)&lt;/h3&gt;
&lt;p&gt;Removes all items from the list.&lt;/p&gt;
&lt;h3 id="additemself-item-ui_list_item"&gt;addItem(self, item: UI_LIST_ITEM)&lt;/h3&gt;
&lt;p&gt;Add a &lt;code&gt;UI_LIST_ITEM&lt;/code&gt; to the listbox.&lt;/p&gt;
&lt;h3 id="updateself-screen-deltatime"&gt;update(self, screen, deltatime)&lt;/h3&gt;
&lt;p&gt;Call this in your update function when you want to show and process the listbox.&lt;/p&gt;
&lt;h2 id="ui_list_item"&gt;UI_LIST_ITEM&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;h3 id="initself-func-value-text"&gt;&lt;strong&gt;init&lt;/strong&gt;(self, func, value, text)&lt;/h3&gt;
&lt;p&gt;Inits the UI_LIST_ITEM and adds one UI_ELEMENT with the given text to it.&lt;/p&gt;
&lt;h4 id="func"&gt;func&lt;/h4&gt;
&lt;p&gt;The function to call when clicked on.&lt;br/&gt;
Default: 0&lt;/p&gt;
&lt;h4 id="value"&gt;value&lt;/h4&gt;
&lt;p&gt;Maybe the function needs a value. This is it.&lt;br/&gt;
Default: 0&lt;/p&gt;
&lt;h4 id="text"&gt;text&lt;/h4&gt;
&lt;p&gt;The added &lt;code&gt;UI_ELEMENT&lt;/code&gt; will show this text on the list item.&lt;br/&gt;
Default: "@NotSet@"&lt;/p&gt;
&lt;h3 id="createelementself-textorpath-promillex-promilley-typ"&gt;createElement(self, textorpath, promillex, promilley, typ)&lt;/h3&gt;
&lt;p&gt;Creates an &lt;code&gt;UI_ELEMENT&lt;/code&gt; with the given &lt;code&gt;textorpath&lt;/code&gt; on the position &lt;code&gt;promillex, promilley&lt;/code&gt; on this &lt;code&gt;UI_LIST_ITEM&lt;/code&gt;-instance.&lt;/p&gt;
&lt;h4 id="textorpath"&gt;textorpath&lt;/h4&gt;
&lt;p&gt;The text to be shown or the path to the image if typ is "image".&lt;/p&gt;
&lt;h4 id="promillex-promilley"&gt;promillex, promilley&lt;/h4&gt;
&lt;p&gt;The position on the list item in promille.&lt;/p&gt;
&lt;h4 id="typ"&gt;typ&lt;/h4&gt;
&lt;p&gt;"text" for text.&lt;br/&gt;
"image" for image. NOT IMPLEMENTED YET.&lt;/p&gt;
&lt;h3 id="addelementself-element-ui_element"&gt;addElement(self, element: UI_ELEMENT)&lt;/h3&gt;
&lt;p&gt;You do NOT need to use this if you add &lt;code&gt;UI_ELEMENTS&lt;/code&gt; with &lt;code&gt;createElement&lt;/code&gt;.&lt;br/&gt;
Else, add your element to the list item with this function.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benedict Jäggi</dc:creator><pubDate>Mon, 06 Jan 2025 03:13:29 -0000</pubDate><guid>https://sourceforge.net725cb96701dc2306145dffc56a4cdb20000da67b</guid></item></channel></rss>