Updated July 2023; see History
Used in conjunction with cformat code l to define the choices that will appear in the combo box.
List=item1, item2, ...itemn
As a convenience for applications sharing a list with INFLD, you can use the INFLD setdef syntax, which is the same as the above, except that the first character specifies the delimiter character, which is then used to separate the items. In the INFLD format, the list is typically terminated with two of the delimiter characters, although they aren't really necessary here since the list will be terminated by the tilde that marks the end of this and every other advanced coldef option.
Comments
• | Warning: if the first character is neither alphabetic nor numeric, and it matches the last character in the list, then XTREE assumes that it is the delimiter character. Otherwise, the delimiter is assumed to be a comma. This can lead to unexpected problems in lists of items that have both leading and trailing spaces—or any other non-numeric, non-alphabetic character. To avoid that possibility, make the delimiter explicit. |
• | For self-service combos, set the list to three dots (e.g. List="..."). You can still pre-load the cell with a value, and even allow the user to change it (if the E code is specified). But if they try to display the dropdown list (by clicking on the down arrow button or typing Alt+Down-arrow, it will exit with Exitcode= 29, so that your application can then display its own list or other control, independent of XTREE. |
• | For selection-only lists (where the user can only select from the items in the list, as opposed to real combo boxes where a new item may be entered), do not include the E code in cformat. To allow a blank choice in such a case, you must add an explicit blank item to the list definition, i.e. "List=red,blue, ~". Also note that any pre-loaded cell string must match an entry in the list, or else it will be displayed as blank when the cell becomes activated—i.e. turned into a combo box. |
• | If the List= clause is associated with column 0, it can be shared by multiple columns. Any column which specifies the cformat l (list) option, which does not have its own List= specified, will use the shared list associated with column 0. Note that although this capability overlaps somewhat with the CellList feature when it comes to sharing a single list between multiple columns, List= is easier to use because it doesn't require a special character in every cell to identify the list. But List= lacks the flexibility to allow different lists within the same column. |
• | To mark an individual cell within a combo box column as being non-editable, insert a vertical bar ("|") as the first character of the cell data. The vertical bar will not display, but the cell will be prevented from gaining the focus. |
• | There is no limit on the length of an individual combo list (defined with List= or CellList=). A 4K limit in an earlier version of A-Shell has been eliminated. |
• | Quote characters (") are treated as ordinary characters within all variations of the lists described here. If you had intended to use them to include a literal comma within a description, you will instead need to just change your delimiter character. See History. |
• | See CellList for defining cell-specific combo lists. |
See Also
History
2023 July, A-Shell 1734: Adjusted handling of quote characters.