LayerControlSelectionInfo() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns information about a selected item in the Layer Control window.

Syntax

LayerControlSelectionInfo( selection_index, attribute )

selection_id is the index of a selected item in Layer Control.

attribute is a code indicating the type of information to return; see table below.

Description

The attribute parameter can be any value from the table below. Codes in the left column are defined in MAPBASIC.DEF.

attribute code ID LayerControlSelectionInfo() returns
LC_SEL_INFO_NAME 1 String result, representing the name of the selected item.
LC_SEL_INFO_TYPE 2 Smallint result, indicating the type of selected item. Return value will be one of the values:
  • LC_SEL_INFO_TYPE_MAP (0)
  • LC_SEL_INFO_TYPE_LAYER (1)
  • LC_SEL_INFO_TYPE_GROUPLAYER (2)
  • LC_SEL_INFO_TYPE_STYLE_OVR (3)
  • LC_SEL_INFO_TYPE_LABEL_OVR (4)
  • LC_SEL_INFO_TYPE_THEME_ITEM (5)
LC_SEL_INFO_MAPWIN_ID 3 Integer value, representing the window id of the mapper associated with the selected item.
LC_SEL_INFO_LAYER_ID 4 Smallint value, indicating the ID of the layer associated with the selected item. If you query this value when a map item is selected, the return value is -1. For a theme category item, this is the layer ID for the theme layer.
LC_SEL_INFO_OVR_ID 5 Smallint value, indicating the index of the override associated with the selected item. If you query this value when a map, layer, grouplayer or theme category item is selected, the return value is -1.

Example

LayerControlSelectionInfo(layer_number, LC_SEL_INFO_NAME)

See Also:

LayerControlInfo() function