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
 TIEFolderTree OnCheckBoxChanged
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aknapple

USA
2 Posts

Posted - Jun 22 2022 :  05:42:20  Show Profile  Reply
Support,

Using a TIEFolderTree in the OnCheckBoxChanged, How do you iterate through the child and sibling nodes marking the Checked property with the NewState?

Best regards,
Allen

Allen

xequte

38610 Posts

Posted - Jun 22 2022 :  20:44:19  Show Profile  Reply
Hi Allen

You can iterate items as with a regular TTreeView, e.g.

// Make checked all nodes below selection that contain the text "Temp"
CheckNodesContainingStr( TIEFolderNode( IEFolderTree1.Selected ), 'Temp' );

procedure CheckNodesContainingStr(ANode: TIEFolderNode; const SearchStr: string);
begin
  ANode.Expand(True);  // So content is filled
  ANode := TIEFolderNode( ANode.GetFirstChild );
  if ANode = nil then
    Exit;

  repeat
    ANode.Checked := Pos( Uppercase( SearchStr ), Uppercase( ANode.Text )) > 0;
    CheckNodesContainingStr( ANode, SearchStr );
    ANode := TIEFolderNode( ANode.getNextSibling );
  until ANode = nil;
end;


However, the content is filled on demand, so we need to get the content of each and every folder to check it. This means it would be very slow for an entire folder tree, for example.

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

aknapple

USA
2 Posts

Posted - Jun 23 2022 :  19:53:46  Show Profile  Reply
Thank you! With your example I was able to figure out what I needed to do.

Best regards,
Allen

Allen
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: