nrGetSelectedIndexes
nrGetSelectedIndexes(t_widget) =>l_indices/ nil
Description
Returns a list comprising the selected indexes of lists or tree widgets.
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:
This function can be used to obtain the expanded list.
Arguments
|
Name of the widget for which the expanded selection is required. |
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.
Retrieve the extended list of selected indexes directly from the widget.
nrGetSelectedIndexes( form->treeWidget )
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