ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Problem with groupindex?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AdrianKnowles

USA
35 Posts

Posted - Sep 14 2023 :  10:47:08  Show Profile  Reply
Hi,
I'm creating 4 layers (in 2 different procedures) and want to group them
so something like this

Procedure 1
With LineTestImageEnView do
begin
LockUpdate();
Layers[ 1 ].GroupIndex := 333;
Layers[ 2 ].GroupIndex := 333;
UnlockUpdate();
end;

Procedure 2
With LineTestImageEnView do
begin
LockUpdate();
Layers[ 3 ].GroupIndex := 666;
Layers[ 4 ].GroupIndex := 666;
UnlockUpdate();
end;

Layers 3 & 4 are correctly assigned to groupindex 666 but not 1 & 2(groupindex is zero)

I was wondering if there was something I'm missing?

Kind regards,
Adrian

xequte

38418 Posts

Posted - Sep 14 2023 :  15:02:53  Show Profile  Reply
Hi Adrian

I think something else might be going on here.

I assume the following returns the expected values?

With LineTestImageEnView do
  ShowMessage( Layers[ 1 ].GroupIndex.ToString + '/' + Layers[ 3 ].GroupIndex.ToString );

With LineTestImageEnView do
begin
  LockUpdate();
  Layers[ 1 ].GroupIndex := 333;
  Layers[ 2 ].GroupIndex := 333;
  UnlockUpdate();
end;

With LineTestImageEnView do
  ShowMessage( Layers[ 1 ].GroupIndex.ToString + '/' + Layers[ 3 ].GroupIndex.ToString );

With LineTestImageEnView do
begin
  LockUpdate();
  Layers[ 3 ].GroupIndex := 666;
  Layers[ 4 ].GroupIndex := 666;
  UnlockUpdate();
end;

With LineTestImageEnView do
  ShowMessage( Layers[ 1 ].GroupIndex.ToString + '/' + Layers[ 3 ].GroupIndex.ToString );



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

AdrianKnowles

USA
35 Posts

Posted - Sep 14 2023 :  17:09:30  Show Profile  Reply
Hi Nigel,
I think I've narrowed it down.

The groupindex's are successfully created. Checked with your showmessage code below.

I then used the following to enable to move the group

LineTestImageEnView.MouseInteractLayers:= [miMoveLayers];

I can move the group and the group index is still correct. Checked with your showmessage code below.

However If I click off the group (just onto the background image) then the groupindex changes to zero and you can then only select the individual layers.

Also if i dont click on the background but click on a button with the following code

LineTestImageEnView.MouseInteractLayers := [];
Then the groupindex changes to zero.

Repeating
LineTestImageEnView.MouseInteractLayers:= [miMoveLayers];
Highlights the layers but the groupindex is still zero.

Kind regards,
Adrian

Go to Top of Page

xequte

38418 Posts

Posted - Sep 15 2023 :  17:45:19  Show Profile  Reply
Hi Adrian

Are you sure? Are you checking Layer[n].GroupIndex or CurrentLayer.GroupIndex (as the layer index has changed). There are actually very few things that will automatically reset GroupIndex.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: