cocoa: changed in window visiblity management

git-svn-id: trunk@43491 -
This commit is contained in:
dmitry 2013-11-28 03:04:12 +00:00
parent 310fc7893e
commit af918a5f9f
2 changed files with 19 additions and 1 deletions

View File

@ -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;

View File

@ -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;