<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=DComboBox</id>
	<title>DComboBox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dabo.leafe.com/index.php?action=history&amp;feed=atom&amp;title=DComboBox"/>
	<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=DComboBox&amp;action=history"/>
	<updated>2026-11-21T14:16:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://wiki.dabo.leafe.com/index.php?title=DComboBox&amp;diff=4086&amp;oldid=prev</id>
		<title>Ed: Created page with &quot;This control allows the user to select one item from a pre-set list of items, or optionally type in an item that it not in the list. It is similar to dDropdownList, except...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.dabo.leafe.com/index.php?title=DComboBox&amp;diff=4086&amp;oldid=prev"/>
		<updated>2020-05-12T16:04:48Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This control allows the user to select one item from a pre-set list of items, or optionally type in an item that it not in the list. It is similar to &lt;a href=&quot;/index.php?title=DDropdownList&quot; title=&quot;DDropdownList&quot;&gt;dDropdownList&lt;/a&gt;, except...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This control allows the user to select one item from a pre-set list of items, or optionally type in an item that it not in the list. It is similar to [[dDropdownList]], except that this control contains an editable textbox for user-entered information.&lt;br /&gt;
&lt;br /&gt;
It normally appears as a single line displaying the selected item, along with an arrow button which the user clicks to &amp;quot;drop down&amp;quot; the full list. When a selection is made from that list, the list disappears, leaving the single-line control. Because its full list isn&amp;#039;t displayed until the user selects it, it is ideal for presenting a selection without taking up a lot of area on the screen.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Some of the more useful properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AppendOnEnter&amp;#039;&amp;#039;&amp;#039; - (bool): When this is &amp;lt;code&amp;gt;True&amp;lt;/code&amp;gt;, any item the user types into the textbox is automatically appended to the list of &amp;lt;code&amp;gt;Choices&amp;lt;/code&amp;gt; when they press the &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; key. There are two hook methods: &amp;lt;code&amp;gt;beforeAppendOnEnter(&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;afterAppendOnEnter()&amp;lt;/code&amp;gt;. These get automatically called before and after the new item is appended to the &amp;lt;code&amp;gt;Choices&amp;lt;/code&amp;gt; list. The &amp;lt;code&amp;gt;beforeAppendOnEnter()&amp;lt;/code&amp;gt; method gives you a chance to manipulate the user-entered value, and optionally prohibit the addition by returning &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt; from the method. The &amp;lt;code&amp;gt;afterAppendOnEnter()&amp;lt;/code&amp;gt; method gives you a chance to do post-processing.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Choices&amp;#039;&amp;#039;&amp;#039; - (list): This determines the options available for the control.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Keys&amp;#039;&amp;#039;&amp;#039; - (dict / list / tuple): Value that is associated with the &amp;lt;code&amp;gt;Choices&amp;lt;/code&amp;gt;. Many times you want to present the user with a list of choices that mean something to them, but internally in your program, you really need the ID or primary key or some other identifying value that is associated with the choice that the user made. The easiest way to set up the &amp;lt;code&amp;gt;Keys&amp;lt;/code&amp;gt; property is to make it a 1:1 list of values that correspond position-wise to the &amp;lt;code&amp;gt;Choices&amp;lt;/code&amp;gt; list. This way, when the user selects, say, the third choice in the list, &amp;lt;code&amp;gt;KeyValue&amp;lt;/code&amp;gt; will return the third value in the &amp;lt;code&amp;gt;Keys&amp;lt;/code&amp;gt; list.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;StringValue&amp;#039;&amp;#039;&amp;#039; - (str): Returns the text displayed by the control for the selected item.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PositionValue&amp;#039;&amp;#039;&amp;#039; - (int): Returns the position of the selected item in the list of available &amp;lt;code&amp;gt;Choices&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;KeyValue&amp;#039;&amp;#039;&amp;#039; - (varies): Returns the value in &amp;lt;code&amp;gt;Keys&amp;lt;/code&amp;gt; that corresponds to the selected item.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;UserValue&amp;#039;&amp;#039;&amp;#039; - (str): Represents the text typed in by the user. &amp;lt;code&amp;gt;UserValue&amp;lt;/code&amp;gt; can differ from &amp;lt;code&amp;gt;StringValue&amp;lt;/code&amp;gt;, which would mean that the user has typed in arbitrary text. Unlike &amp;lt;code&amp;gt;StringValue&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PositionValue&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;KeyValue&amp;lt;/code&amp;gt;, setting &amp;lt;code&amp;gt;UserValue&amp;lt;/code&amp;gt; does not change the currently selected item in the list portion of [[dComboBox]].&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ValueMode&amp;#039;&amp;#039;&amp;#039; (str): Can be one of &amp;lt;code&amp;gt;String&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Position&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;Key&amp;lt;/code&amp;gt;. Determines the result returned by accessing the &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt; property: either &amp;lt;code&amp;gt;StringValue&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;PositionValue&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;KeyValue&amp;lt;/code&amp;gt;. You can always refer to any of those different value types, but when you know which value your program will be needing, you can set &amp;lt;code&amp;gt;ValueMode&amp;lt;/code&amp;gt;, and afterwards just have the normal &amp;lt;code&amp;gt;Value&amp;lt;/code&amp;gt; binding work correctly.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
See the [https://web.archive.org/web/20110909131047/http://paul.dabodev.com/doc/api/dabodoc/ Dabo Class Documentation] for an exhaustive documentation of this control&amp;#039;s Properties, Events and Methods. (Note that this documentation is no longer live, but it&amp;#039;s still available via the Internet Archive).&lt;/div&gt;</summary>
		<author><name>Ed</name></author>
	</entry>
</feed>