Set result grid's parent control *before* hiding it. Fixes issue #1973.

This commit is contained in:
Ansgar Becker
2010-05-28 22:48:20 +00:00
parent 5351f8df23
commit 32c905524e

View File

@@ -8991,10 +8991,13 @@ end;
{ TQueryTab }
function TQueryTab.GetActiveResultTab: TResultTab;
var
idx: Integer;
begin
Result := nil;
if tabsetQuery.TabIndex > -1 then
Result := ResultTabs[tabsetQuery.TabIndex];
idx := tabsetQuery.TabIndex;
if (idx > -1) and (idx < ResultTabs.Count) then
Result := ResultTabs[idx];
end;
@@ -9007,10 +9010,10 @@ var
begin
inherited;
QueryTab := Mainform.ActiveQueryTab;
Grid := TVirtualStringTree.Create(QueryTab.TabSheet);
Grid.Visible := False;
OrgGrid := Mainform.QueryGrid;
Grid := TVirtualStringTree.Create(QueryTab.TabSheet);
Grid.Parent := QueryTab.TabSheet;
Grid.Visible := False;
Grid.Tag := OrgGrid.Tag;
Grid.BorderStyle := OrgGrid.BorderStyle;
Grid.Align := OrgGrid.Align;