<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_ListDef</id>
	<title>GUI Scripting: ListDef - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_ListDef"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;action=history"/>
	<updated>2026-04-30T09:29:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=30098&amp;oldid=prev</id>
		<title>Geep: Add category tag</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=30098&amp;oldid=prev"/>
		<updated>2022-11-04T17:44:56Z</updated>

		<summary type="html">&lt;p&gt;Add category tag&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:44, 4 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l175&quot;&gt;Line 175:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 175:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===A ListDef that Didn&amp;#039;t Make the Cut===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===A ListDef that Didn&amp;#039;t Make the Cut===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There was an initial attempt, In mainmenu_success.gui, to employ a listDef to show a list of statistics. This was replaced by a column of stacked windowDefs instead, because (reports greebo): &amp;quot;listDefs don&amp;#039;t get updated in the GUI unless you call gui-&amp;gt;StateChanged(), which in turn breaks the main menu. Hence: text fields instead of listDefs.&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There was an initial attempt, In mainmenu_success.gui, to employ a listDef to show a list of statistics. This was replaced by a column of stacked windowDefs instead, because (reports greebo): &amp;quot;listDefs don&amp;#039;t get updated in the GUI unless you call gui-&amp;gt;StateChanged(), which in turn breaks the main menu. Hence: text fields instead of listDefs.&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{GUI}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29917&amp;oldid=prev</id>
		<title>Geep: /* Properties Specific to ListDefs */</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29917&amp;oldid=prev"/>
		<updated>2022-10-14T16:04:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Properties Specific to ListDefs&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:04, 14 October 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot;&gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Properties Specific to ListDefs==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Properties Specific to ListDefs==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;® = A property known as a &quot;register&quot;, that can be altered at runtime by binding it to a GUI:: parameter, or in a &quot;set&quot; or &quot;transition&quot; script command. Other properties cannot be so altered.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;® = A property known as a &quot;register&quot;, that can be altered at runtime by binding it to a GUI:: parameter, or in a &quot;set&quot; or &quot;transition&quot; script command. Other properties cannot be so altered&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, nor appear within event handlers&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Data Source===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Data Source===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Listname &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot;====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Listname &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot;====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29791&amp;oldid=prev</id>
		<title>Geep at 21:47, 16 August 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29791&amp;oldid=prev"/>
		<updated>2022-08-16T21:47:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:47, 16 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Title: GUI Scripting: ListDef&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;This page is part of a series. See [[GUI Scripting Language]] for overview.&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;This page is part of a series. See [[GUI Scripting Language]] for overview.&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Introduction==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29790&amp;oldid=prev</id>
		<title>Geep: Add Internationalization? Sorry</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29790&amp;oldid=prev"/>
		<updated>2022-08-16T21:45:28Z</updated>

		<summary type="html">&lt;p&gt;Add Internationalization? Sorry&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:45, 16 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l170&quot;&gt;Line 170:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 170:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Internally, the actual data representing each table row is in a tab-separated string, placed into string array &amp;quot;listItems&amp;quot;. This is pre-populated before rendering. There&amp;#039;s also an array of integers, currentSel, that contains the 0-based indices of rows currently selected. This information is also stored in state interger variables named listName_sel_number, with a count in listname_sel_numsel. If the count is zero, listname_sel_0 is -1.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Internally, the actual data representing each table row is in a tab-separated string, placed into string array &amp;quot;listItems&amp;quot;. This is pre-populated before rendering. There&amp;#039;s also an array of integers, currentSel, that contains the 0-based indices of rows currently selected. This information is also stored in state interger variables named listName_sel_number, with a count in listname_sel_numsel. If the count is zero, listname_sel_0 is -1.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===Internationalization? Sorry===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;There appears to be no inherent i18n support in listDef. That is, in the prepopulated string array &quot;listItems&quot;, with tab-separated substrings, the prefix &quot;#str_&quot; has no special meaning or handling. So if you want to localize the list contents, this must be done by detecting the TDM language in effect, then prepopulating listItems with the language-specific content. This evidently is not done currently, e.g., in DownloadMenu.cpp or MissionManager.cpp  or server-side, so the FM titles displayed are not translated.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===A ListDef that Didn&amp;#039;t Make the Cut===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===A ListDef that Didn&amp;#039;t Make the Cut===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There was an initial attempt, In mainmenu_success.gui, to employ a listDef to show a list of statistics. This was replaced by a column of stacked windowDefs instead, because (reports greebo): &amp;quot;listDefs don&amp;#039;t get updated in the GUI unless you call gui-&amp;gt;StateChanged(), which in turn breaks the main menu. Hence: text fields instead of listDefs.&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There was an initial attempt, In mainmenu_success.gui, to employ a listDef to show a list of statistics. This was replaced by a column of stacked windowDefs instead, because (reports greebo): &amp;quot;listDefs don&amp;#039;t get updated in the GUI unless you call gui-&amp;gt;StateChanged(), which in turn breaks the main menu. Hence: text fields instead of listDefs.&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29780&amp;oldid=prev</id>
		<title>Geep: create this article</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_ListDef&amp;diff=29780&amp;oldid=prev"/>
		<updated>2022-08-13T22:01:08Z</updated>

		<summary type="html">&lt;p&gt;create this article&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Title: GUI Scripting: ListDef&lt;br /&gt;
&amp;#039;&amp;#039;This page is part of a series. See [[GUI Scripting Language]] for overview.&amp;#039;&amp;#039;&lt;br /&gt;
==Introduction==&lt;br /&gt;
One of the more complex controls, a listDef displays a vertical list of items in rows, from which the user selects by clicking. A row can be composed of multiple data columns, that the listDef defines using &amp;quot;tab stops&amp;quot;. A column of this table will have either text or icons in it.&lt;br /&gt;
&lt;br /&gt;
The listDef GUI does not itself populate a list, but relies on associated C++ code to do so, typically with a dynamic list.&lt;br /&gt;
&lt;br /&gt;
===ListDefs in TDM&amp;#039;s Main Menu System===&lt;br /&gt;
====Load/Save====&lt;br /&gt;
After hitting &amp;quot;Load/Save&amp;quot;, a page with a list of saved missions appears. Each row has 3 text columns: a short name for the save, and the date and time when saved. This employs &amp;quot;listDef LGSaveGameList&amp;quot; in tdm_gui01.pk4\guis\mainmenu_loadsave.gui . When a game is in-process and this menu is invoked, the user is able to select a row. At that point, &amp;quot;Load&amp;quot;, &amp;quot;Save&amp;quot;, and &amp;quot;Delete&amp;quot; buttons become enabled, along with a field to rename a saved game, e.g., from an autogenerated name like &amp;quot;QuickSave_0&amp;quot; to something more meaningful.&lt;br /&gt;
&lt;br /&gt;
====New Mission====&lt;br /&gt;
After hitting &amp;quot;New Mission&amp;quot;, the &amp;quot;Available Missions&amp;quot; list appears, showing FMs installed locally. Games played to completion are marked with a green checkmark icon in the second column. This employs &amp;quot;listDef choosemod_list&amp;quot; in mainmenu_newgame.gui . See &amp;quot;New Mission Example&amp;quot; further below.&lt;br /&gt;
&lt;br /&gt;
====Download Missions====&lt;br /&gt;
From the menu page with &amp;quot;Available Missions&amp;quot; just discussed, the &amp;quot;Download Missions&amp;quot; button brings up two pages. The lefthand one, &amp;quot;Online Mission Archive&amp;quot;, has a list &amp;quot;Downloadable Missions&amp;quot; using a single-column listDef populated by the server. The righthand one, &amp;quot;Download Status&amp;quot;, has a &amp;quot;Selected for Download&amp;quot; list, populated by the user. These two pages are defined in mainmenu_download.gui, that has &amp;quot;listDef available_list&amp;quot; and &amp;quot;listDef selected_list&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Beneath the lefthand list are two buttons, &amp;quot;Select All &amp;gt;&amp;gt;&amp;quot; and &amp;quot;Select for download &amp;gt;&amp;gt;&amp;quot;. These copy entries from the lefthand list to the righthand. Note that the lefthand list is not multiple-selection. Instead, the user populates the righthand list one selection at a time (or all - with a dedicated button). Clicking an FM in the righthand list deletes it, undoing its selection for download. &amp;quot;Selected for Download&amp;quot; has 2 text columns. Once downloading begins, the second column shows the percentage downloaded so far.&lt;br /&gt;
&lt;br /&gt;
===Keystrokes and Mouse Actions===&lt;br /&gt;
&amp;#039;&amp;#039;This is somewhat simplified. See &amp;quot;Additional Notes&amp;quot; below for more.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Adjusting the Set of Visible Rows within the Scrollable Area====&lt;br /&gt;
* LMB drag vertical scrollbar thumb: adjust rows.&lt;br /&gt;
* LMB click in scrollbar area: thumb jumps to location; adjust rows.&lt;br /&gt;
* Up arrow or mouse wheel up or RMB above scrollbar thumb: up 1 row.&lt;br /&gt;
* Down arrow or mouse wheel down or RMB below scrollbar thumb: down 1 row.&lt;br /&gt;
* Page Up: up by the number of visible rows.&lt;br /&gt;
* Page Down: down by the number of visible rows.&lt;br /&gt;
&lt;br /&gt;
====Selection====&lt;br /&gt;
* LMB on a data row: if clear, select it, and clear any other row.&lt;br /&gt;
* Alphanumeric string: Find and select topmost row with prefix match in first text column. Adjust set of visible rows as needed. Entry string (which is hidden) can be extended to change selection. Hidden string can be cleared by manually selecting a row.&lt;br /&gt;
* Any change of row selection: onAction handler.&lt;br /&gt;
* With a row selected, Enter or Keypad Enter: onEnter handler.&lt;br /&gt;
* Row LMB double-click: select (if not already) then onEnter handler.&lt;br /&gt;
&lt;br /&gt;
==Properties Shared with All GuiDef Types==&lt;br /&gt;
A listDef will employ [[GUI Scripting: Properties in Common | Properties in Common]] to size its rectangle and set the attributes of its text, including mouse hover. In practice, [[GUI Scripting: User Variables | User Variables]] don&amp;#039;t seem to be much used. [[GUI Scripting: Event Handlers | Event Handlers]] for onAction, onEnter, onMouseEnter, and onMouseExit are important.&lt;br /&gt;
 &lt;br /&gt;
==Properties Specific to ListDefs==&lt;br /&gt;
® = A property known as a &amp;quot;register&amp;quot;, that can be altered at runtime by binding it to a GUI:: parameter, or in a &amp;quot;set&amp;quot; or &amp;quot;transition&amp;quot; script command. Other properties cannot be so altered.&lt;br /&gt;
===Data Source===&lt;br /&gt;
====Listname &amp;quot;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
Specifies the C++ name of the list whose contents the listDef will display. This name may or may not be different from &amp;quot;listDef &amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;quot;. The listname string is referenced by the code to populate the list and to use as a prefix when naming internal state variables.&lt;br /&gt;
 listname &amp;quot;downloadSelectedList&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===For Multi-Column Lists===&lt;br /&gt;
These Properties take strings with comma-separated values, where each value is for a sequential &amp;quot;tab stop&amp;quot;, that is, table column.&lt;br /&gt;
====Tabaligns &amp;quot;&amp;#039;&amp;#039;comma_separated_values&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
Has &amp;quot;textalign&amp;quot; values for each column: 0 = Left, 1 = Center, 2 = Right.&lt;br /&gt;
 tabAligns &amp;quot;0, 1&amp;quot;       // From manmenu_newgame.gui, indicating &amp;quot;Left, Center&amp;quot;&lt;br /&gt;
====Tabstops &amp;quot;&amp;#039;&amp;#039;comma_separated_values&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
Has the x-axis offset of each column.&lt;br /&gt;
 tabstops &amp;quot;0, 228&amp;quot;&lt;br /&gt;
===For Icons in Multi-Column Lists===&lt;br /&gt;
These were not mentioned in Ref 1 of [[GUI Scripting: References &amp;amp; Resources]]; are they TDM specific?&lt;br /&gt;
====TabTypes &amp;quot;&amp;#039;&amp;#039;comma_separated_values&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
Content type for each column. 0 = text, 1 = icon. If not given, all columns are 0 (Text).&lt;br /&gt;
 tabTypes &amp;quot;0, 1&amp;quot;       // Text, Icon&lt;br /&gt;
====Tabvaligns &amp;quot;&amp;#039;&amp;#039;comma_separated_values&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
For icons, not text, has vertical alignment values for each column: 0=Top, 1=Center, 2=Bottom. Default alignments are Top.&lt;br /&gt;
 Tabvaligns &amp;quot;0, 1&amp;quot;&lt;br /&gt;
====TabIconSizes &amp;quot;&amp;#039;&amp;#039;comma_separated_value_pairs&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
This should have twice as many values as the number of columns. Text columns should have &amp;quot;0,0&amp;quot;.&lt;br /&gt;
 tabIconSizes   &amp;quot;0,0, 14,14&amp;quot; // TabStop 1 size is 15w x 15h&lt;br /&gt;
====TabIconVOffset &amp;quot;&amp;#039;&amp;#039;comma_separated_values&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
 tabIconVOffset &amp;quot;0, 1&amp;quot;&lt;br /&gt;
====Mtr_&amp;#039;&amp;#039;suffix&amp;#039;&amp;#039; &amp;quot;&amp;#039;&amp;#039;path_to_mtr&amp;#039;&amp;#039;&amp;quot;====&lt;br /&gt;
Specifies the material (e.g., image) used for the icon. Property name must start with prefix &amp;quot;mtr_&amp;quot;, then be unique. There may be any number of these in a GUI. For columns of tabtype &amp;quot;icon&amp;quot;:&lt;br /&gt;
* an &amp;quot;mtr...&amp;quot; name appearing in the data will be interpreted as an icon&amp;#039;s material definition, not a literal string.&lt;br /&gt;
* An empty string will indicate a table cell with no icon.&lt;br /&gt;
 mtr_complete   &amp;quot;guis/assets/mainmenu/buttons_start/icon_completed&amp;quot; // green checkmark&lt;br /&gt;
&lt;br /&gt;
===Addition ListDef Properties – Not Used in TDM Core===&lt;br /&gt;
====Horizontal &amp;#039;&amp;#039;bool&amp;#039;&amp;#039;====&lt;br /&gt;
If 1 (true), then the table uses a horizontal scrollbar instead of a vertical one. Untested, says Ref 1 of [[GUI Scripting: References &amp;amp; Resources]]. Unclear what behavior was intended. Default: 0 (false).&lt;br /&gt;
 horizontal 1&lt;br /&gt;
====Multiplesel &amp;#039;&amp;#039;bool&amp;#039;&amp;#039;====&lt;br /&gt;
Indicates if the user can select more than one row simultaneously. (Requires code support, says Ref 1 of [[GUI Scripting: References &amp;amp; Resources]].) Default: 0 (false).&lt;br /&gt;
 multilesel 1&lt;br /&gt;
&lt;br /&gt;
==New Game Example==&lt;br /&gt;
This fragment from mainmenu_newgame.gui is a good example of the Properties needed for a 2-column table with text and icons. As for event handlers, when a mission is selected for possible install, a lefthand windowDef, &amp;quot;modToInstallVisible&amp;quot;, will appear to describe it. Invocation of that window is done by the onAction handler shown here (though details of the windowDef itself is not).&lt;br /&gt;
 ...&lt;br /&gt;
 windowDef choosemod_parent&lt;br /&gt;
 {&lt;br /&gt;
     rect  330,164,320,245&lt;br /&gt;
     visible 1&lt;br /&gt;
     matcolor  1,1,1,1&lt;br /&gt;
 &lt;br /&gt;
     listDef choosemod_list&lt;br /&gt;
     {  &lt;br /&gt;
         rect           0,0,270,245&lt;br /&gt;
         bordercolor    0.0, 0.0, 0.0, 0.2&lt;br /&gt;
         forecolor      0, 0, 0, 1&lt;br /&gt;
         hovercolor     1, 1, 1, 1&lt;br /&gt;
         textscale      0.29&lt;br /&gt;
         listname       &amp;quot;missionList&amp;quot;&lt;br /&gt;
         font           &amp;quot;fonts/carleton&amp;quot;&lt;br /&gt;
         tabstops       &amp;quot;0, 228&amp;quot;     // Mission Name, Mission Complete Icon&lt;br /&gt;
         tabAligns      &amp;quot;0, 1&amp;quot;       // Left, Center&lt;br /&gt;
         tabTypes       &amp;quot;0, 1&amp;quot;       // Text, Icon&lt;br /&gt;
         tabIconSizes   &amp;quot;0,0, 14,14&amp;quot; // TabStop 1 size 15,15&lt;br /&gt;
         tabIconVOffset &amp;quot;0, 1&amp;quot;&lt;br /&gt;
         tabvaligns     &amp;quot;0, 1&amp;quot;       // Only works for icon columns&lt;br /&gt;
 &lt;br /&gt;
         mtr_complete   &amp;quot;guis/assets/mainmenu/buttons_start/icon_completed&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
         onAction {&lt;br /&gt;
             set &amp;quot;cmd&amp;quot; &amp;quot;onMissionSelected&amp;quot;;&lt;br /&gt;
             set &amp;quot;cmd&amp;quot; &amp;quot;play sound/meta/menu/mnu_select&amp;quot;;&lt;br /&gt;
             if (&amp;quot;gui:missionList_sel_0&amp;quot; &amp;gt;= 0)&lt;br /&gt;
             {&lt;br /&gt;
                 set &amp;quot;modToInstallVisible&amp;quot; &amp;quot;1&amp;quot;;&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
==Download Selected-List Example==&lt;br /&gt;
See the &amp;quot;Introduction&amp;quot; above for an overall description of the two download tables. Here, there&amp;#039;s a glimpse from mainmenu_download.gui, concerning the righthand &amp;quot;Selected for download&amp;quot; table. The fragment shows a 2-column list defined by tab stops. The user creates a download batch, with the mission names in the left column, download progress (initially blank) in the right column. If a mission needs to be removed from the batch, a LMB click (and the onAction handler shown) does it. Actual download processing, including updating the right column text values, is handled elsewhere.&lt;br /&gt;
 ... &lt;br /&gt;
 listDef selected_list&lt;br /&gt;
 {  &lt;br /&gt;
     rect         0,0,240,185&lt;br /&gt;
     bordercolor  0.0, 0.0, 0.0, 0.2&lt;br /&gt;
     forecolor    0, 0, 0, 1&lt;br /&gt;
     hovercolor   1, 1, 1, 1&lt;br /&gt;
     textscale    0.257&lt;br /&gt;
     listname     &amp;quot;downloadSelectedList&amp;quot;&lt;br /&gt;
     font         &amp;quot;fonts/carleton&amp;quot;&lt;br /&gt;
     tabstops     &amp;quot;0, 185&amp;quot;     // Mission Name, Download Progress&lt;br /&gt;
     tabAligns    &amp;quot;0, 0&amp;quot;       // Left, Left&lt;br /&gt;
     tabTypes     &amp;quot;0, 0&amp;quot;       // Text, Text&lt;br /&gt;
 &lt;br /&gt;
     onAction {&lt;br /&gt;
         set &amp;quot;cmd&amp;quot; &amp;quot;play sound/meta/menu/mnu_select;&amp;quot;;&lt;br /&gt;
         set &amp;quot;cmd&amp;quot; &amp;quot;onDeselectMissionForDownload&amp;quot;;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 ... &lt;br /&gt;
&lt;br /&gt;
==Additional Notes==&lt;br /&gt;
===Keystrokes and Mouse Actions===&lt;br /&gt;
====If Multiple Selection is Enabled====&lt;br /&gt;
If &amp;quot;multiplesel 1&amp;quot; is in effect for the listDef, then...&lt;br /&gt;
Ctrl+LMB on data row: If already selected, clear; if clear, select it too.&lt;br /&gt;
&lt;br /&gt;
====Load/Save&amp;#039;s Special Handling of Row Double-Click====&lt;br /&gt;
As indicated in the Introduction, a LMB double-click on a row will select that row (if not already selected) and call an onEnter handler. In the case of mainmenu_loadsave.gui, that handler will then do nothing when this is during a game, because both the Load and Save buttons are visible and it&amp;#039;s not clear which is meant. If it&amp;#039;s pre-game, though, only the Load button is present and so the double-clicks acts as if that was pushed.&lt;br /&gt;
&lt;br /&gt;
====Scrollbar Related====&lt;br /&gt;
LMB or RMB clicks in the scroller are ignored in ListWindow.cpp, and handled instead in the scrollbar&amp;#039;s idSliderWindow class.  That is, scrollbars for listDefs and editDefs are implemented by the idSliderWindow class in SliderWindow.cpp (not to be confused with sliderDef.) Mouse actions on the scrollbar are handled there in its HandleEvent function, as follows.&lt;br /&gt;
As mentioned in the Introduction, while the LMB is dragging the thumb, capture the mouse coordinates to move the thumb. Otherwise...&lt;br /&gt;
* RMB clicked above thumb: visible rows up a row&lt;br /&gt;
* RMB clicked below thumb: visible rows down a row&lt;br /&gt;
&lt;br /&gt;
The code has a treatment for these additional keys, but these &amp;#039;&amp;#039;&amp;#039;DON&amp;#039;T WORK&amp;#039;&amp;#039;&amp;#039;, presumably because the keystrokes are not reaching this code:&lt;br /&gt;
* Right Arrow or Keypad Right Arrow: visible rows up a row&lt;br /&gt;
* Left Arrow or Keypad Left Arrow: visible rows down a row&lt;br /&gt;
&lt;br /&gt;
Finally, a usability complaint. Because the implementation of the listDef&amp;#039;s vertical scrollbar shows its thumb just as black dot, its behavior (when clicked or dragged) can seem mysterious. It would be better if the thumb was a more-conventional rectangle whose height reflected the percentage of the number of rows that the visible rows exposed.&lt;br /&gt;
&lt;br /&gt;
===Layout and Data Implementation===&lt;br /&gt;
The operations of a listDef are supported by the idListGUILocal class in ListGUI.cpp and idListWindow in ListWindow.cpp. Incoming keystrokes and mouse actions are dealt with in ListWindow.cpp&amp;#039;s idListWindow::HandleEvent(...).&lt;br /&gt;
&lt;br /&gt;
Each GUI Parameter with comma-separated information about each column is first parsed, split, and stored into an associated internal array. The information in these arrays are then copied and repackaged together into a &amp;quot;tabInfo&amp;quot; array, representing the columns of any row, where each element describes all the attributes of the cell and its contents, including its border dimensions.&lt;br /&gt;
&lt;br /&gt;
Internally, the actual data representing each table row is in a tab-separated string, placed into string array &amp;quot;listItems&amp;quot;. This is pre-populated before rendering. There&amp;#039;s also an array of integers, currentSel, that contains the 0-based indices of rows currently selected. This information is also stored in state interger variables named listName_sel_number, with a count in listname_sel_numsel. If the count is zero, listname_sel_0 is -1.&lt;br /&gt;
&lt;br /&gt;
===A ListDef that Didn&amp;#039;t Make the Cut===&lt;br /&gt;
There was an initial attempt, In mainmenu_success.gui, to employ a listDef to show a list of statistics. This was replaced by a column of stacked windowDefs instead, because (reports greebo): &amp;quot;listDefs don&amp;#039;t get updated in the GUI unless you call gui-&amp;gt;StateChanged(), which in turn breaks the main menu. Hence: text fields instead of listDefs.&amp;quot;&lt;/div&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
</feed>