AnchorDocking: Cocoa: a better way to fix the issue that the embedded form is not shown in TAnchorDockPage

This commit is contained in:
rich2014 2023-06-06 00:13:19 +08:00
parent 13a8e36d2f
commit e0ab60ad95
2 changed files with 1 additions and 13 deletions

View File

@ -2468,19 +2468,6 @@ function TAnchorDockMaster.RestoreLayout(Tree: TAnchorDockLayoutTree;
AControl.Align:=alClient;
for Side:=Low(TAnchorKind) to high(TAnchorKind) do
AControl.AnchorSide[Side].Control:=nil;
{$IFDEF LCLCOCOA}
// trigger page to be ready, mainly for embedded Forms.
// eg. BreakPoints, Search Results, will be empty without trigger.
// for the embedding Form in TPageControl, the embedding Form cannot
// be self activated in Cocoa Interface.
// after long research, here is the least invasive.
// see also: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39763#note_1408260128
if AControl is TWinControl then
begin
TWinControl(AControl).HandleNeeded;
Site.Pages.PageIndex:= i;
end;
{$ENDIF}
end;
Site.Pages.PageIndex:=ANode.PageIndex;
finally

View File

@ -808,6 +808,7 @@ begin
begin
if AParams.WndParent <> 0 then
begin
cnt.isembedded:= true;
lDestView := NSObject(AParams.WndParent).lclContentView;
lDestView.addSubView(cnt);
//cnt.setAutoresizingMask(NSViewMaxXMargin or NSViewMinYMargin);