class function TEmbeddableForm.CreateInto(hostForm: TForm; hostControl: TWinControl): TEmbeddableForm;
begin
assert(Assigned(hostForm));
assert(Assigned(hostControl));
result:= TEmbeddableForm.Create(hostForm);
result.IntegrateInto(hostForm, hostControl);
end;
procedure TEmbeddableForm.RemoveFrom(hostForm: TForm; hostControl: TWinControl);
begin
ReParent(Self, False);
end;
procedure TEmbeddableForm.ReParent(hostControl: TWinControl; preserveItems: boolean = True);
var
subItemText: string;
begin
assert(Assigned(hostControl));
if preserveItems then
begin
{ item and subitems get lost when the list view is re-parented; Delphi bug! }
subItemText := ResultsView.Items[0].SubItems.Text;
end;
BottomPanel.Parent := hostControl;
BodyPanel.Parent := hostControl;
if preserveItems then
begin
with ResultsView.Items.Add do
begin
SubItems.Text := subItemText;
end;
end;
end;
procedure TEmbeddableForm.OnCloseHostForm(Sender: TObject);
begin
assert(Assigned(FHostForm));
if FTestResult <> nil then
FTestResult.stop;
FHostForm.Close;
end;