From 5e4157f40bc32d595239691921ee10891154d708 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 27 Aug 2019 19:11:22 +0000 Subject: [PATCH] cocoa: replacing use of GetNSObjectView with lclContentView git-svn-id: trunk@61763 - --- lcl/interfaces/cocoa/cocoaprivate.pas | 2 +- lcl/interfaces/cocoa/cocoawscommon.pas | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoaprivate.pas b/lcl/interfaces/cocoa/cocoaprivate.pas index 971ff45ecb..0351e04c8b 100644 --- a/lcl/interfaces/cocoa/cocoaprivate.pas +++ b/lcl/interfaces/cocoa/cocoaprivate.pas @@ -910,7 +910,7 @@ var begin p := nil; if (AParams.WndParent <> 0) then - p := CocoaUtils.GetNSObjectView(NSObject(AParams.WndParent)); + p := NSView(AParams.WndParent).lclContentView; if Assigned(p) then LCLToNSRect(Types.Bounds(AParams.X, AParams.Y, AParams.Width, AParams.Height), diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index 5048e00d8b..fcaeaa5342 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -1411,7 +1411,7 @@ var cr:TCocoaCursor; begin Result := False; - View := CocoaUtils.GetNSObjectView(Owner); + View := HandleFrame.lclContentView; if View = nil then Exit; if not Assigned(Target) then Exit; if not (csDesigning in Target.ComponentState) then @@ -1607,10 +1607,7 @@ var begin if not AWinControl.HandleAllocated then Exit; - //todo: GetNSObjectView must be replaced with oop approach - // note that client rect might be smaller than the bounds of TWinControl itself - // thus extra size should be adapted - lView := CocoaUtils.GetNSObjectView(NSObject(AWinControl.Handle)); + lView := NSObject(AWinControl.Handle).lclContentView; if lView = nil then Exit; //todo: using fittingSize is wrong - it's based on constraints of the control solely.