[Contents] [TitleIndex] [WordIndex

Contributor - uicontrol: interactive table

Author(s): Samuel GOUGEON (2016)

Description

Since its first commit in 2010, the style "Table" proposed through uicontrol() is remained an alpha version. Yet, a workable version is requested by many users. A short list of bugs and missing features is already available on Scilab Bugzilla. A more extensive review of missing features is presented herebelow.
Implementation priorities are tentatively indicated from [1] (highest) to [5] (lowest).

Attribute

Features expected for the property

.string

[1]
[1]
[3]

Implement its update from an interactive input [report #11625]
Implement its update when columns are interactively reordered [report #14583]
Support LaTeX inputs [report #14474]

.enable="off"

[1]

Implement it. Presently, the "off" flag does not freeze the table (editing a cell is still possible). The table must become uneditable (and if possible with fixed columns).

Fonts & cells styles

.fontsize

[1]
[2]

Implement it. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.fontweight

[1]
[2]

Implement it. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.fontname

[1]
[2]

Implement it. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.fontangle

[2]
[3]

Implement it. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.foregroundColor

[1]
[2]

Implement it. "namedColor" input shall be allowed. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.backgroundColor

[1]
[2]

Implement it. "namedColor" input shall be allowed. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.horizontalAlignment

[1]

[2]

Use it to justify cells contents, more needed and useful than tuning the table position in the frame,
that can be controlled with .position. See the report #11728. If the value is a single input, it applies to all cells.
Otherwise, it must be a matrix applied in an element-wise way to the matrix of table cells.

.TooltipString

Dedicated report #11631

Present status: the input unique string is tooltiped only when the mouse is over the upper-left cell of the table. So, it is not really implemented.
Efficient usages of this attribute are proposed herebelow. For all of them, "\n" or ascii(10) included in input strings must be rendered as a new-line directive.

.
[1]



[2]
[4]

if =="" : no tooltip is displayed
if =="values" (special flag): The value of each cell of .string is tooltiped when overflying it.
....* This mode is required to ensure that the contents of too narrow cells can be fully seen without editing the cell.
....* Every .string modification must then be automatically copied on .tooltipstring
....* This processing includes left lines headers and top columns headers, that may need tooltips as well.
if ==TT where TT is a matrix of strings of .strings size: When overflying the cell(i,j), TT(i,j) is displayed as is in tooltip.
Add support to LaTeX inputs in tooltips. Report #12526

Heading row & column:

Report #11729 : presently, the first row and the first column of .string are always considered as headings. But we could need not to have headings, neither on the top, nor on the left, nor on both

[1]

The user must become able to specify what he/she wants. We see 3 possible implementations:
* either heading labels are included in .strings. This is not very handy, because then addressing "true" entries of the table is shifted by one index.
* or heading labels could be specified in a dedicated new .headings or Titles attribute. It might be a list() of 2 string vectors rowsTitles and colsTitles.
* or .strings could become a t-list() with 3 fields .rowsTitles, .colsTitles, .values.
=> Finally, we think that the current implementation is fine (see the rationale there):
* heading row and/or column shall stand included in the .string (and .tooltipstring) contents.
* they should be kept in .string(1,:) and/or .string(:,1)
* No special flag is required to indicate that the first row are headers and/or the first column are headers. There shall be always such headers, even if empty.
* In case of "empty" headers, an automatical labelling of rows and/or columns shall be implemented.

Columns widths:

Implement a way -- as a new .colwidths attribute -- to specify the initial columns widths. See the report #11730.

[1]




[1]

* If the provided width is scalar (only 1 value), it shall be considered as the full width of the table. Then,
....* if it is > .position(3) : show an horizontal scrollbar.
....* if it is ==0: the full width of the table is used, and all columns have the same widths.
....* If it is ==%nan (default): the full width of the table is used, and Scilab autotunes columns widths according to their maximal contents lengths.

* Otherwise:
....* the vector of widths must have as many components as there are columns.
....* A column's width set to %nan means that its width must be autotuned.
....* A column's width set to 0 means that the column must be masked.
....* Other positive values set true fixed widths, expressed according to the chosen .units attribute.

The autotuning mode might as well be specified through a negative value (say -1) instead of %nan.
If the full width of the table is > than .position(3): show an horizontal scrollbar. H-scrolling must send scrolled columns under the fixed heading column (if any)

Order of cols and rows

Presently, columns can be interactively reordered (except the heading one : ok)

[3]
[1]

* Implement and manage e.g. a new property .reordering = [0|1, 0|1] enabling/disabling the re-ordering for rows or/and columns.
* Propose a way to track columns and rows initial indices (= id). For instance, when extracting .strings, append a row ($+1,:) giving initial columns indices, and a column (:,$+1) giving initial rows indices.

Interactive resizing

Presently, the size of the whole table is set and fixed with .position(3:4).

[3]

Implement a way to allow/disable interactive resizing (typically through dragging the lower right corner of the table).
A new .resizing_mode attribute could be created: enable / disable H-resizing and V-resizing = ["on"|"off", "on"|"off"]. Then,
* the .position attribute shall be updated.
* Resizing without pressing SHIFT shall resize the table without resizing columns and rows ("solid" mode).
* Resizing while SHIFT is pressed shall resize columns and rows proportionally ("proportional elastic" mode)

.callback

Implement it: .callback=="myfunction"; then:

[1]




[3]
[4]
[3]

SHIFT + clicking on the cell(i,j) must call myfunction(tH, i, j) where
* myfunction is the string entered as callback, and
* tH is the handle of the table (or at least provide a way to get the tH handle from inside myfunction()).
Heading cells (if any) are clickable and callbackable as other ones (with index i=0 or j=0).
In particular, this element-wise callback will allow to easily implement simple or customized (lexicographic, etc) sortings of rows
The same must be done after entering <enter> in a cell.
Take into account an additional pressed key: SHIFT + key + clicking on the cell(i,j) must call myfunction(tH, i, j, keycode).
A sample callback function uitable_callback.sci performing simple sorts of rows when clicking of a column header (0,i) shall be provided. The sorting order shall be togglable. See the report #14475

Cells selection

[3]





[1]


[4]

* Interactive selection : It is presently possible only to select full rows. Detecting and using shift and CTRL keys + mouse shall enable implementing the following:
....* unique cell selection (default) (See the report #14188).
....* row-oriented selection.
....* column-oriented selection.
....* range selection

* Implement a way (such as a contextual menu, or a key shortcut, or whatever) enabling to copy the content of the selected "rectangle" to the clipboard (H-separator to be discussed : tab ? "" string delimiters ? etc)

* Targeting the top-left cell of the viewport: If the table has a H-scrolling or/and a V-scrolling bar(s), a new attribute (say .innerpos=[iv, jv], to be discussed) shall allow to scroll the table to put the specified cell at the top-left corner of the visible part of the table (= viewport), and hightlight the cell with the same background as with interactive selection. If a set of iv or/and ij rows and columns is provided, highlight all of them.
Other similar ideas using the .listboxtop attribute are reported as wish #11635


2022-09-08 09:26