Multicolumn table widget. More...
Multicolumn table widget.
Following widget variants exist: Table
listitems the items contained in the selection box Non-standard Opt() arguments:
immediatemake :notify trigger immediately when the selected item changes Non-standard Opt() arguments:
keepSortingkeep the insertion order - don't let the user sort manually by clicking Non-standard Opt() arguments:
multiSelectionuser can select multiple items (rows) at once (shift-click, ctrl-click) Example:
The Table widget is a selection list with multiple columns. By default, the user can select exactly one row (with all its columns) from that list. With Opt(:multiSelection), the user can select one or more rows (with all their columns) from that list (In that case, use the :SelectedItems property, not :Value).
Each cell (each column within each row) has a label text and an optional icon.
(Note: Not all UIs (in particular not text-based UIs) support displaying icons, so an icon should never be an exclusive means to display any kind of information).
This widget is similar to SelectionBox, but it has several columns for each item (each row). If just one column is desired, consider using SelectionBox instead.
Note: This is not something like a spread sheet, and it doesn't pretend or want to be. Actions are performed on rows, not on individual cells (columns within one row).
The first argument (after Opt() and Id() which both are optional) is Header() which specifies the column headers (and implicitly the number of columns) and optionally the alignment for each column. Default alignment is left.
In the list of items, an ID is specified for each item. Each item can have less cells (columns) than the table has columns (from Header()), in which case any missing cells are assumed to be empty. If an item has more cells than the table has columns, any extra cells are ignored.
Each cell has a text label (which might also be an empty string) and optionally an icon. If a cell has an icon, it has to be specified with cell(Icon("myiconname.png", "Label text")).
A simple table is specified like this:
This will create a 3-column table. The first column ("Nick") and the third column ("Role") will be left aligned. The second column ("Age") will be right aligned. note that "Wannabe" doesn't have a Role. This field will be empty.
A table that uses icons is specified like this:
In this example, "Bluebird" has an additional icon in his "Role" column, and "Wannabe" and "Coxxan" both have additional icons in their "Age" columns.