Skip to main content

TdxCustomMapControl.Select(TdxMapItem,TShiftState,Boolean) Method

Switches the selected state of a specified map item.

Declaration

procedure Select(AMapItem: TdxMapItem; AShiftState: TShiftState = []; ACheckSelectionMode: Boolean = True);

Parameters

Name Type
AMapItem TdxMapItem
AShiftState TShiftState
ACheckSelectionMode Boolean

Remarks

This method modifies the current selection accessible using the SelectedMapItems property.

AMapItem specifies a map item to select. If this map item is already selected and ssCtrl is passed as the AShiftState parameter, the map item is deselected instead.

If True is passed as the ACheckSelectionMode parameter, the Select method takes into account the map control’s OptionsBehavior.MapItemSelectMode property setting, emulating an end-user action:

  • If the property is set to mismNone, the Select method does nothing.

  • If the property is set to mismSingle, the current selection is cleared prior to selecting the map item.

  • Otherwise, the selection is updated based on the AShiftState parameter value (see above).

Handle the map control’s OnSelectionChanged and OnSelectionChanging events to respond to selection changes and prohibit certain map items from being selected/deselected.

See Also