From 752f58ad162a5ca88803df02a5328f81dcce42b6 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 27 Jun 2011 23:14:07 +0000 Subject: [PATCH] Tree.Parent is in a special case a form, but it could also turn into some panel or whatever in the future. Be more stable when detecting the origin of the tree. --- source/main.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/main.pas b/source/main.pas index 7490a3e5..2314c070 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6657,7 +6657,7 @@ begin end; end; lntTable, lntView: - if Sender.Parent is TfrmSelectDBObject then begin + if GetParentFormOrFrame(Sender) is TfrmSelectDBObject then begin Columns := TTableColumnList.Create(True); DBObj.Connection.ParseTableStructure(DBObj.CreateCode, Columns, nil, nil); ChildCount := Columns.Count; @@ -6693,8 +6693,8 @@ begin 2: begin DBObjects := FConnections[Node.Parent.Parent.Index].GetDBObjects(FConnections[Node.Parent.Parent.Index].AllDatabases[Node.Parent.Index]); Item^ := DBObjects[Node.Index]; - if (Sender.Parent is TfrmSelectDBObject) and (Item.NodeType in [lntTable, lntView]) then - InitialStates := InitialStates + [ivsHasChildren]; + if (GetParentFormOrFrame(Sender) is TfrmSelectDBObject) and (Item.NodeType in [lntTable, lntView]) then + Include(InitialStates, ivsHasChildren); end; 3: begin Item^ := TDBObject.Create(FConnections[Node.Parent.Parent.Parent.Index]);