From 1cfe855bae1b89a77ee9e48986a390165d731c3e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 22 Dec 2009 13:31:50 +0000 Subject: [PATCH] Fix uncheckable tree nodes when a database gets checked and tries to auto-check its children. Fixes issue #1552. --- source/tabletools.pas | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/tabletools.pas b/source/tabletools.pas index 8dd3afde..9ff19d7c 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -349,11 +349,17 @@ end; procedure TfrmTableTools.TreeObjectsChecking(Sender: TBaseVirtualTree; Node: PVirtualNode; var NewState: TCheckState; var Allowed: Boolean); +var + n: PVirtualNode; + hello: Widestring; begin - // Ensure to also toggle check state of not yet initialized nodes - if Sender.GetNodeLevel(Node) = 1 then - Sender.ReinitChildren(Node, false); + // Ensure to also toggle check state of not yet initialized nodes Allowed := True; + // Weird fix: Just iterate through all sub nodes for implicit initialization. Without this + // loop a checkbox click on a parent node would only auto-check its visible children. + n := Sender.GetFirstChild(Node); + while Assigned(n) do + n := Sender.GetNextSibling(n); end;