"selectionMode"

The attribute "selectionMode" defines how an object, for example, a tree view reacts to selection by a user.

Synopsis

shape.selectionMode(string mode);

Parameters

Parameter Description
shape Name of the object
mode

"Single": When you select an item, any item selected already turns unselected. You can unselect a selected item by clicking on an empty space within the tree view.

"Multi": When you select an item in the usual way, the selection status of this item is toggled and the other items are ignored. Also, multiple items can be selected by dragging the cursor with the left mouse button staying pressed.

"Extended": When you select an item in the usual way, a selection is cleared and the new item selected. However, if you press CTRL when clicking on an item, the clicked item is toggled and all other items are ignored. If you press the Shift key while clicking on an item, all items between the current item and the clicked item get selected or unselected, depending on the state of the clicked item. Also, multiple items can be selected by dragging the cursor over them.

"NoSelection": Items cannot be selected.

Description

The attribute "selectionMode" specifies how an object, for example, a tree view reacts to selection by a user.

Example

The following example sets the selectionMode to "Multi" (multiple items can be selected by dragging the cursor with the left mouse button staying pressed).

main()
{
  TREE1.selectionMode("Multi");
}

Assignment

Tree widget, DPTypeView, DpTreeView