mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 08:59:10 +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 viewDidMoveToWindow; override;
|
||||||
procedure viewWillMoveToWindow(newWindow: NSWindow); override;
|
procedure viewWillMoveToWindow(newWindow: NSWindow); override;
|
||||||
procedure dealloc; override;
|
procedure dealloc; override;
|
||||||
|
procedure setHidden(aisHidden: Boolean); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaScrollView }
|
{ TCocoaScrollView }
|
||||||
@ -533,6 +534,22 @@ begin
|
|||||||
inherited dealloc;
|
inherited dealloc;
|
||||||
end;
|
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 }
|
{ TCocoaPanel }
|
||||||
|
|
||||||
function TCocoaPanel.windowShouldClose(sender: id): LongBool;
|
function TCocoaPanel.windowShouldClose(sender: id): LongBool;
|
||||||
|
@ -330,7 +330,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
cnt := TCocoaWindowContent.alloc.initWithFrame(R);
|
cnt := TCocoaWindowContent.alloc.initWithFrame(R);
|
||||||
cnt.callback := TCocoaPanel(win).callback;
|
|
||||||
|
|
||||||
if (AParams.Style and WS_CHILD) = 0 then
|
if (AParams.Style and WS_CHILD) = 0 then
|
||||||
begin
|
begin
|
||||||
@ -349,6 +348,7 @@ begin
|
|||||||
R.origin.x := 0;
|
R.origin.x := 0;
|
||||||
R.origin.y := 0;
|
R.origin.y := 0;
|
||||||
|
|
||||||
|
cnt.callback := TCocoaPanel(win).callback;
|
||||||
win.setContentView(cnt);
|
win.setContentView(cnt);
|
||||||
|
|
||||||
if AParams.WndParent <> 0 then
|
if AParams.WndParent <> 0 then
|
||||||
@ -356,6 +356,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
cnt.callback := TLCLCustomControlCallback.Create(cnt, AWinControl);
|
||||||
if AParams.WndParent <> 0 then
|
if AParams.WndParent <> 0 then
|
||||||
NSView(APArams.WndParent).addSubView(cnt);
|
NSView(APArams.WndParent).addSubView(cnt);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user