mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 08:36:26 +02:00
cocoa: changed in window visiblity management
git-svn-id: trunk@43491 -
This commit is contained in:
parent
310fc7893e
commit
af918a5f9f
@ -345,6 +345,7 @@ type
|
||||
procedure viewDidMoveToWindow; override;
|
||||
procedure viewWillMoveToWindow(newWindow: NSWindow); override;
|
||||
procedure dealloc; override;
|
||||
procedure setHidden(aisHidden: Boolean); override;
|
||||
end;
|
||||
|
||||
{ TCocoaScrollView }
|
||||
@ -533,6 +534,22 @@ begin
|
||||
inherited dealloc;
|
||||
end;
|
||||
|
||||
procedure TCocoaWindowContent.setHidden(aisHidden: Boolean);
|
||||
begin
|
||||
if isembedded then
|
||||
begin
|
||||
inherited setHidden(aisHidden);
|
||||
end
|
||||
else
|
||||
begin
|
||||
if aisHidden and window.isVisible then
|
||||
window.orderOut(nil)
|
||||
else
|
||||
if not aisHidden and not window.isVisible then
|
||||
window.orderBack(nil);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TCocoaPanel }
|
||||
|
||||
function TCocoaPanel.windowShouldClose(sender: id): LongBool;
|
||||
|
@ -330,7 +330,6 @@ begin
|
||||
end;
|
||||
|
||||
cnt := TCocoaWindowContent.alloc.initWithFrame(R);
|
||||
cnt.callback := TCocoaPanel(win).callback;
|
||||
|
||||
if (AParams.Style and WS_CHILD) = 0 then
|
||||
begin
|
||||
@ -349,6 +348,7 @@ begin
|
||||
R.origin.x := 0;
|
||||
R.origin.y := 0;
|
||||
|
||||
cnt.callback := TCocoaPanel(win).callback;
|
||||
win.setContentView(cnt);
|
||||
|
||||
if AParams.WndParent <> 0 then
|
||||
@ -356,6 +356,7 @@ begin
|
||||
end
|
||||
else
|
||||
begin
|
||||
cnt.callback := TLCLCustomControlCallback.Create(cnt, AWinControl);
|
||||
if AParams.WndParent <> 0 then
|
||||
NSView(APArams.WndParent).addSubView(cnt);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user