mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:19:32 +02:00
AnchorDocking: Cocoa: a better way to fix the issue that the embedded form is not shown in TAnchorDockPage
This commit is contained in:
parent
13a8e36d2f
commit
e0ab60ad95
@ -2468,19 +2468,6 @@ function TAnchorDockMaster.RestoreLayout(Tree: TAnchorDockLayoutTree;
|
|||||||
AControl.Align:=alClient;
|
AControl.Align:=alClient;
|
||||||
for Side:=Low(TAnchorKind) to high(TAnchorKind) do
|
for Side:=Low(TAnchorKind) to high(TAnchorKind) do
|
||||||
AControl.AnchorSide[Side].Control:=nil;
|
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;
|
end;
|
||||||
Site.Pages.PageIndex:=ANode.PageIndex;
|
Site.Pages.PageIndex:=ANode.PageIndex;
|
||||||
finally
|
finally
|
||||||
|
@ -808,6 +808,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if AParams.WndParent <> 0 then
|
if AParams.WndParent <> 0 then
|
||||||
begin
|
begin
|
||||||
|
cnt.isembedded:= true;
|
||||||
lDestView := NSObject(AParams.WndParent).lclContentView;
|
lDestView := NSObject(AParams.WndParent).lclContentView;
|
||||||
lDestView.addSubView(cnt);
|
lDestView.addSubView(cnt);
|
||||||
//cnt.setAutoresizingMask(NSViewMaxXMargin or NSViewMinYMargin);
|
//cnt.setAutoresizingMask(NSViewMaxXMargin or NSViewMinYMargin);
|
||||||
|
Loading…
Reference in New Issue
Block a user