Enhancement: Disable "Indexes" and "Foreign keys" node to indicate they have 0 child nodes

This commit is contained in:
Ansgar Becker
2010-06-14 06:04:39 +00:00
parent 56548f29c0
commit 3f60d711e7

View File

@@ -233,6 +233,10 @@ begin
if GetRegValue(Option, True) then
Node.CheckState := csCheckedNormal;
(Sender as TVirtualStringTree).OnChecked(Sender, Node);
// Disable node to indicate 0 children
if ((Node.Index = nKeys) and (FKeys.Count = 0))
or ((Node.Index = nForeignKeys) and (FForeignKeys.Count = 0)) then
Node.States := Node.States + [vsDisabled];
end;
1: if Node.Parent.CheckState in [csCheckedNormal, csCheckedPressed, csMixedNormal, csMixedPressed] then