ImageEn, unit iexLayers

TIELayer.GroupIndex

TIELayer.GroupIndex


Declaration

property GroupIndex: Integer;


Description

Specifies the Group ID of the layer. When a layer is selected all other layers with the same group ID are automatically selected too.
GroupIndex can be any value. A GroupIndex of 0 means the layer is not grouped.

Note:
 GroupIndex is only valid if multiple layer selection is enabled
 When a grouped layer is selected, a "Link" icon will be drawn over all other layers of the same group (you can prevent this by assigning OnDrawLayer)

Default: 0


Example

// Group all layers (except background)
ImageEnView1.LockUpdate();
for i := 1 to ImageEnView1.LayersCount - 1 do
  ImageEnView1.Layers[ I ].GroupIndex := Random( MaxInt );
ImageEnView1.UnlockUpdate();

// Ungroup all layers
ImageEnView1.LockUpdate();
for i := 0 to ImageEnView1.LayersCount - 1 do
  ImageEnView1.Layers[ I ].GroupIndex := 0;
ImageEnView1.UnlockUpdate();

// Enable button if layer is grouped
btnUngroup.Enabled := ImageEnView1.CurrentLayer.GroupIndex > 0;


See Also

 LayersGroup
 LayersUngroup