Att ColumnWidths

new to Analytica 5.0

Attribute Att_ColumnWidths

The attribute Att_ColumnWidths stores the widths of table columns that have been manually sized, and hence are not set to be automatically sized.

Initially, edit and result tables automatically select the width of columns based on the width of the content in the cells of that column. To manually set a column width, hover over the boundary between two columns, where the cursor changes to a left-right drag cursor, then hold the mouse down and drag to change the width of the column. You can also select a range of columns and then drag any boundary to change the width of all selected columns to be the same. To remove the manually configured size, enabling the column to again auto-size to the content, you can hover over the right-side column boundary (so that the cursor is a left-right drag cursor) and double click -- or select one or more columns and hover over any column boundary and double click to auto-size the selected columns.

The Att_ColumnWidths attribute is used internally by Analytica, and is not an attribute that Analytica users should read from or write to directly. This page documents the internal format used by this attribute.

Basic structure

The Att_ColumnWidths holds a list that consists of one number (or blank) followed by n pairs, so that the total number of elements is always odd, 2*n+1, where n is the number of pairs. Each pair identifies an index and the widths along that index.

The following is an example of the contents of the Att_ColumnWidths.

[ 67, In1, \([ ,,45,67,,88 ]), In2, \([ 123 ]) ]

In this example, a width of 67 pixels is used when there is no column index. When the column index is index In1, the third column is 45 pixels wide, the fourth column is 67 pixels wide, and the sixth column is 88 pixels wide. All other columns along In1 are auto-sized. When the index is In2, the first column is 123 pixels wide, and all other columns are auto-sized. If In1 has only 5 elements, the Totals column along In1 has a width of 88 pixels.

In this example, the first element of each pair is an index identifier, and the second element is a reference to a list of widths. Any width can be blank (including the first number), which indicates that the element is auto-sized. Internally, these blanks are the special system value Undefined, but print as blanks when viewing or saving the attribute for conciseness.

Local indexes

When the widths are specified along a local index, then the first element of each pair uses Sys_LocalIndex('name') as illustrated in this example:

[, Sys_LocalIndex('L1'), \([101,,,,80]) ]

Comparison Indexes

A result table may have two column indexes when you have selected a Comparison Index. In this case, the column widths are associated with the comparison index (the bottom and fastest varying column header). The attribute encoding is the same as for any other index, but the manually set width for that column is shared by all repeats of that Comparison Index column. For example, in the table shown here

Width of comparison columns.png

the Att_ColumnWidths Of Width_example is

[, In2, \([26,54,89]) ]

Hence, all In2=1 columns are 26 pixels wide, all In2=2 columns are 54 pixels wide and all In2=3 columns are 89 pixels wide. If you change the width of any one of these columns, all the other columns corresponding to the same In2 element change with it.

Comparison columns

When a result table contains comparison variable or expression columns, Sys_ComparisonExpr(...) is used, as illustrated here

[,Sys_ComparisonExpr(In1),59,In2,\([130,226,53])]

Width of comparison variable columns.png

In this image, Va2 is a comparison variable. Each Va2 has a width of 59 pixels. When manually sized, the widths of all Va2 columns will be the same. When automatically sized, they are sized to the content of each column independently. The second element of the pair when Sys_ComparisonExpr is used is a single width number.

The main result columns, labeled with the variable's name, Width example, use the widths along the column index In2. In this example, each of the three main value columns is sized to a different width (130, 226 and 53 pixels respectively). When the column index is set to nothing, then the first number in the list determines the main value's column width.

Splicing

When an index value changes, the list of widths corresponding to that index are automatically spliced.

When an index is used in a table's Att_ColumnWidths attribute, the index's Att_ColWidthsKids attribute contains the table identifier. This is automatically managed by Analytica, you cannot set Att_ColWidthKids yourself.

When an index is deleted, it and its associated heights are automatically removed from all Att_ColumnWidths attributes that use it.

History

The Att_ColumnWidths attribute was introduced in Analytica 5.0. Prior to that release, manually changed column widths were retained only as long as the result window remained open, and were also lost following a pivot. With the introduction of this attribute in Analytica 5.0, manually configured column widths are retained after a pivot, after a table as closed and reopened, and after a model is saved and reloaded.

See Also

Comments


You are not allowed to post comments.