nrGetIndexesFromSelection
nrGetIndexesFromSelection(t_widget l_selection) =>l_indices/ nil
Description
Expands the specified compact list representing a selection of items from other lists or tree widgets into the corresponding expanded list representation detailing each selected item.
The compact list representation is created when you select a range of items in a list or a tree widget, or is returned when you query the value property of a widget in the following way:
form->tree->value
Arguments
|
Name of the widget for which the expanded selection is required. |
|
|
Compact list representing a selection of other lists or tree widgets. |
Values Returned
|
List describing each selected index in the specified list or tree widget. |
|
Examples
Selects an adjacent range of items (Item_1 to Item_5) in a tree widget:
range = form->treeWidget->value
> (("Item_1" "Item_5"))
The variable range stores only the selected items from the extended range, instead of returning one item for each selected index.
If the range is stored in a variable, the indexes in that range can be queried in the following way:
nrGetIndexesFromSelection( form->treeWidget range)
The names of both the widget and the range are required. The widget is required to expand the compact list to a full list of indexes. The current selection in the widget does not impact the current selection or the return value from this function.
Returns the following list of expanded indexes:
(("Item_1" 0)
("Item_2" 0)
("Item_3" 0)
("Item_4" 0)
("Item_5" 0)
)
Each element in the list is itself a list representing a single selected index in a list or a tree widget, comprising an identifier for the row (usually the text in the first column), and the column number.
Most item views that select the full row (all columns) use 0 as the column number
Item views that feature more granular selection (allowing individual row/column combinations) use a non-zero column number.
Related Topics
Return to top