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
 Visual indication of Grouped Layers?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - May 24 2023 :  16:34:58  Show Profile  Reply
The documentation says: "A GroupIndex of 0 means the layer is not grouped."

So this means: A GroupIndex > 0 means the layer is grouped. Is this correct?

Is it possible to get a visual indication of Layers that are grouped? (I.e., Layers with a GroupIndex > 0, e.g., a Group icon).

xequte

38610 Posts

Posted - May 24 2023 :  20:43:27  Show Profile  Reply
Hi Peter

Yes, GroupIndex > 0 means the layer is grouped. We'll look at adding a visual indication in a future version.


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

PeterPanino

933 Posts

Posted - May 25 2023 :  00:34:09  Show Profile  Reply
Hi Nigel,

Thank you for the information.

I wrote this code to TOGGLE the selected Layers between Grouped and UnGrouped modes:

procedure TformMain.ButtonToggleLayerGroupingClick(Sender: TObject);
begin
  // Iterate through all selected layers (except background):
  with ImageEnView1 do
  begin
    LockUpdate();
    try
      var ThisGroupIndex := Random(Max_Int);
      for var i := 1 to LayersCount - 1 do
      begin
        if Layers[i].Selected then
        begin
          if Layers[i].GroupIndex = 0 then // if Layer is UNGROUPED
            Layers[i].GroupIndex := ThisGroupIndex
          else // if Layer is GROUPED
            Layers[i].GroupIndex := 0;
        end;
      end;
    finally
      UnlockUpdate();
    end;
  end;
end;


But to select only Grouped or only Ungrouped Layers to toggle, the user needs a visual indication of whether a Layer is Grouped or not Grouped. Otherwise, this code could not work as intended. Otherwise, I would have to implement TWO buttons: One for Grouping and one for Ungrouping.

Go to Top of Page

xequte

38610 Posts

Posted - May 25 2023 :  17:47:06  Show Profile  Reply
Hi

You might want to use one the drawing events to add an icon to the layer:

http://www.imageen.com/help/TImageEnView.OnDrawLayer.html

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

xequte

38610 Posts

Posted - Oct 08 2023 :  23:44:49  Show Profile  Reply
FYI, in the next update a "Link" glyph is shown in the corner of selected layers of the same group.


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