interface data_table set column
Allows you to alter the columns in a data table field.
The data table is similar to a spreadsheet where categorized data can be stored as an array locating each item by its row and column index. The data table can be created on a dialog box and the data is displayed using this command.
The properties of an entire column within a data table can be edited using this command.
Format:
interface data_table set column |
|---|
data_table_name= | An Existing GI_DATA_TABLE |
widths = | Integer |
labels = | String |
use_column_selected = | True_only |
range = | Integer |
indices = | Integer |
strings = | String |
reals = | Real |
integers = | Integer |
repeat_strings = | Boolean: yes/no |
enabled = | Boolean: yes/no |
action = | Col_action: replace/append/prefix |
value_type = | text_type |
db_object_type = | Ent |
push_button_label = | string |
push_button_command = | string |
option_menu_choices = | string |
option_menu_command = | string |
toggle_button_label = | string |
toggle_button_command = | String |
execute = | Boolean: yes/no |
Example:
1. Change cell value of column
interface data_table set column & |
|---|
data_table_name = | .gui.atv.dtable & |
widths = | 3 & |
labels = | Frequency, amplitude & |
range = | 1,2 & |
reals = | 1001 & |
repeat_strings = | yes & |
enabled = | yes & |
action = | replace & |
execute = | yes |
2. Set columns value type
interface data_table set column & |
|---|
data_table_name = | .gui.atv.dtable & |
widths = | 3 & |
labels = | Frequency, amplitude & |
range = | 1,2 & |
value_type = | integer & |
execute = | yes |
3. Use column as widget
interface data_table set column & |
|---|
data_table_name = | .gui.atv.dtable & |
widths = | 3 & |
labels = | Frequency, amplitude & |
range = | 1,2 & |
push_button_label = | "Modify" & |
push_button_command = | "marker modify marker_name=%1 location=%2,%3,%4" |
Description:
Parameter | Value Type | Description |
|---|
data_table _name | An Existing GI_data_table | Specifies the name of an existing data table. |
widths | Integer | Specifies the new widths for existing columns. |
labels | String | Specifies the new labels for existing columns. |
use_column_selected | True_only | Specifies the range of columns to be altered. |
range | Integer | Specifies the range of columns to be altered. |
indices | Integer | Specifies the range of columns to be altered. |
strings | String | Specifies the new STRING contents for the cells. |
reals | Real | Specifies the new REAL contents for the cells. |
integers | Integer | Specifies the new INTEGER contents for the cells. |
repeat_strings | Boolean | Specifies whether same STRING or REAL will be inserted to all marked cells; valid options are yes/no. |
enabled | Boolean | Specifies if the columns are read only or editable; valid options are yes/no. |
action | Col_action | Specifies the mode of insertion of new contents in to the cells; valid options are replace/append/prefix. |
value_type | text_type | Specifies column's cell text as string, integer, real or default. |
execute | Boolean | Specifies whether to execute command on cell change. |
Column as database object |
db_object_type | Ent | Specifies the entity type for column. |
Column as push button |
push_button_label | String | Specifies push button label for column. |
push_button_command | String | Specifies the command to be executed on push button click. |
Column as option menu |
option_menu_choices | String | Specifies option menu choices for column on option change. |
option_menu_command | String | Specifies the command to be executed. |
Column as toggle button |
toggle_button_label | String | Specifies toggle button label for column on toggles buttons state change. |
toggle_button_command | String | Specifies the command to be executed. |
Extended Definition:
1. The contents of an existing cell of a data table can be altered using the ‘SET’ command. The cells which will be altered can be specified by multiple – mutually exclusive – choices like ‘use_cell_selected’, ‘range’, or ‘indices’. The parameter ‘use_cells_selected’ can directly indicate the cells to be affected. Alternatively, the range of cell in a column can be entered in the ‘range’ or indices parameters. Specifying the range as ‘1,6’ or entering respective column numbers as ‘1,2,3,4,5,6’ will alter the columns with indices 1 through 6. As the three parameters namely, 1) use_column_selected, 2) range, and 3) indices are mutually exclusive, any one of the parameter is sufficient to specify the columns to be altered.
2. The parameter 'repeat_strings' is used to determine if all rows in the column should be set with the same values. If 'repeat strings' is set to 'yes' then all the rows in the column will be replaced by new contents. On the other hand, if 'repeat_strings' is set to 'no', then only the first row of the columns will be replaced by the new contents, hence the new contents will appear only once in each column. If the values should be repeated for all the rows then the parameter 'repeat strings' needs to be set to 'yes'.
3. The parameter 'strings' or 'reals' is used to specify the new contents of the cell which may replace, append or prefix the existing contents of the cell. To specify how the new contents should be inserted in the existing cell contents, the parameter 'action' has the options 'replace', 'append', or 'prefix'.
4. The parameter 'enabled' is used to specify if the specified columns can be editable or not. The rows are specified using the use_column_selected/range/indices parameter as discussed earlier.
5. Changing columns data, value_type and widgets are mutually exclusive.
6. The parameters ‘execute’ specify if the ‘command’ specified in data_table create interface is to be executed or not on cell change in a column.
7. Different data (value) types can be set per column. Data types are String, Integer, Real and Default. Cell validation is based upon this setting. To set the data type for a column set value_type as
a. String: This accepts only alpha numeric character string where first character is not a number or a special character.
b. Integer: This accepts only integer value.
c. Real: This accepts floating value and integer value.
d. Default: This accepts all types (except widgets). Cell validation will NOT happen in this case.
8. Apart from the basic data types, columns can be of type Widgets.
■value_type and widgets are mutually exclusive to each other.
■Adams command can be associated with Widget type column
■Adams command will be executed on widget click operation.
■Adams command is single line command and is same for all widgets in that column.
■Column's cell values of that row can be used using %1, %2, %3 and so on, while writing Adams command for Widget. Here, %1 is associated with the first cell of that row and %2 is associated with the second cell of that row, and so on.
■Modifying column's Widget property will reset values of that Widget.
■Following widgets can be used.
a. DB object: Data table cell can accept exiting DB object.
On this object, standard RMB operations will be available.
b. Option Menu: Data table cell act as option menu.
c. Push Button: Data table cell act as push button.
d. Toggle Button: Data table cell act as toggle button.
Valid values of any toggle button are "on" or "off".
Tips:
The parameters ‘use_column_selected’, ‘range’ and ‘indices’ are mutually exclusive. Any one of those is sufficient to indicate the cell to be altered.
To get the value of cells in CMD language use following function:
TABLE_GET_CELLS (table_name, start_row_index, end_row_index, start_column_index, end_column_index, "blank", 0))
Users can set cells of the table using following Adams command:
"interface data_table set cell data_table_name= DATA_TABLE row_index=index column_index=index string='value'"