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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIEFolderTree OnCheckBoxChanged

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aknapple Posted - Jun 22 2022 : 05:42:20
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
2   L A T E S T    R E P L I E S    (Newest First)
aknapple Posted - Jun 23 2022 : 19:53:46
Thank you! With your example I was able to figure out what I needed to do.

Best regards,
Allen

Allen
xequte Posted - Jun 22 2022 : 20:44:19
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