Yes you are correct, making a layer selectable or not, only affects the selected layer. In order for a layer to appear selected the layer must be unlocked (CurrentLayer.Locked := False), selectable must be true (CurrentLayer.Selectable := True) and VisibleBox must be true (CurrentLayer.VisibleBox := True).
But even then, you can not make as layer selectable again if you make the layer not selectable, because once you do, there is no way to select the layer to make the layer selectable again once you set the layers Selectable to False, because the layer can not be selected to make the layer selectable again.
You can add a popupmenu to TImageEnMView which toggles selectability of a layer off and on, so this works for any layer selected in ImageEnMView:
procedure Tfmain.Selectable1Click(Sender: TObject);
{ Toggle a layer s selectability }
begin
with ImageEnView1 do
begin
Layers[ImageEnMView1.SelectedImage].Selectable := not Layers[ImageEnMView1.SelectedImage].Selectable;
Layers[ImageEnMView1.SelectedImage].Locked := False;
Layers[ImageEnMView1.SelectedImage].VisibleBox := True;
Update;
end;
end;
So to make a layer selected and to have the layers grips appear, three parameters must be true. The layer must be selectable and unlocked, and visiblebox must be true.
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development